在wsl下开发T113的主线linux(4)-编译kernel

本文详细介绍了如何编译全志D1的Linux内核,包括应用补丁、修改配置以及处理设备树以支持T113芯片。尽管内核成功启动,但由于缺少文件系统,系统无法启动成功。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

接下来编译kernel,编译过程可能会出现缺少命令的报错,大概是下面这几个

sudo apt update
sudo apt install flex bison bc libncurses-dev

目前linux主线的最新版本并没有适配t113的相关外设驱动,虽然能启动并串口打印,但其他的一些外设并没有驱动,还不是可用的状态,所以这里选择全志D1的kernel进行修改。
GitHub - smaeul/linux at d1/allPatches include sunxi platform support and various driver fixes - GitHub - smaeul/linux at d1/allhttps://github.com/smaeul/linux/tree/d1/all

unzip linux-d1-all.zip
cd linux-d1-all

应用awboot提供的linux补丁

  • linux/allow_select_d1_ccu_on_t113.patch
  • linux/ccu-sun20i-make_cpux_clk_critical_for_t113.patch
  • linux/second_core_support_in_platsmp.patch
  • linux/d1s_t113_can_bus.patch

在arch\arm\configs\sunxi_defconfig中添加D1时钟

CONFIG_SUN20I_D1_CCU=y
CONFIG_SUN20I_D1_R_CCU=y

添加sun8i-t113.dtsi和sun8i-t113-mangopi-dual.dts设备树配置文件到arch\arm\boot\dts\
在arch\arm\boot\dts\Makefile的line:1389 处,CONFIG_MACH_SUN8I配置中添加sun8i-t113-mangopi-dual.dtb

awboot提供的sun8i-t113-mangopi-dual.dts设备树文件调试终端串口是5,需要改成uart0。

make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabihf- sunxi_defconfig
make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabihf- zImage -j4
make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabihf- dtbs

xfel spinand write 0x40000 arch/arm/boot/dts/sun8i-t113-mangopi-dual.dtb
xfel spinand write 0x80000 arch/arm/boot/zImage

 

 复位,串口成功打印内核信息,目前spinand中还没有文件系统,所以系统无法启动成功。

[I] AWBoot r6143 starting...
[I] SPI-NAND: W25N01GV detected
[I] SPI-NAND: read dt blob of size 22242 at 43.00MB/S
[I] SPI-NAND: read Image of size 5424416 at 49.00MB/S
[I] booting linux...
[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 6.1.0-rc3 (wsl@DESKTOP-NQRKTHB) (arm-none-linux-gnueabihf-gcc (Arm GNU Toolchain 12.2.Rel1 (Build arm-12.24)) 12.2.1 20221205, GNU ld (Arm GNU Toolchain 12.2.Rel1 (Build arm-12.24)) 2.39.0.20221210) #7 SMP Fri Dec 30 18:52:12 CST 2022
[    0.000000] CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=10c5387d
[    0.000000] CPU: div instructions available: patching division code
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] OF: fdt: Machine model: MangoPi MQ-Dual
[    0.000000] Memory policy: Data cache writealloc
[    0.000000] cma: Reserved 16 MiB at 0x47000000
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x0000000040000000-0x0000000047ffffff]
[    0.000000]   HighMem  empty
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000040000000-0x0000000047ffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000040000000-0x0000000047ffffff]
[    0.000000] percpu: Embedded 11 pages/cpu s15764 r8192 d21100 u45056
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 32512
[    0.000000] Kernel command line: mem=128M ubi.mtd=3 rootfstype=ubifs root=ubi0:rootfs rw rootwait console=ttyS0,115200
[    0.000000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes, linear)
[    0.000000] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes, linear)
[    0.000000] mem auto-init: stack:all(zero), heap alloc:off, heap free:off
[    0.000000] Memory: 99804K/131072K available (8192K kernel code, 952K rwdata, 2188K rodata, 1024K init, 270K bss, 14884K reserved, 16384K cma-reserved, 0K highmem)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=2, Nodes=1
[    0.000000] rcu: Hierarchical RCU implementation.
[    0.000000] rcu:     RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=2.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
[    0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=2
[    0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[    0.000000] rcu: srcu_init: Setting srcu_struct sizes based on contention.
[    0.000000] arch_timer: cp15 timer(s) running at 24.00MHz (phys).
[    0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x588fe9dc0, max_idle_ns: 440795202592 ns
[    0.000001] sched_clock: 56 bits at 24MHz, resolution 41ns, wraps every 4398046511097ns
[    0.000013] Switching to timer-based delay loop, resolution 41ns
[    0.000187] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[    0.000685] Console: colour dummy device 80x30
[    0.000729] Calibrating delay loop (skipped), value calculated using timer frequency.. 48.00 BogoMIPS (lpj=240000)
[    0.000744] pid_max: default: 32768 minimum: 301
[    0.000903] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.000918] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.001466] CPU: Testing write buffer coherency: ok
[    0.001776] /cpus/cpu@0 missing clock-frequency property
[    0.001806] /cpus/cpu@1 missing clock-frequency property
[    0.001817] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[    0.002592] Setting up static identity map for 0x40100000 - 0x40100060
[    0.002736] rcu: Hierarchical SRCU implementation.
[    0.002743] rcu:     Max phase no-delay instances is 1000.
[    0.003267] smp: Bringing up secondary CPUs ...
[    0.003968] CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
[    0.004097] smp: Brought up 1 node, 2 CPUs
[    0.004108] SMP: Total of 2 processors activated (96.00 BogoMIPS).
[    0.004116] CPU: All CPU(s) started in SVC mode.
[    0.004636] devtmpfs: initialized
[    0.008729] VFP support v0.3: implementor 41 architecture 2 part 30 variant 7 rev 5
[    0.008927] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.008954] futex hash table entries: 512 (order: 3, 32768 bytes, linear)
[    0.009552] pinctrl core: initialized pinctrl subsystem
[    0.010921] NET: Registered PF_NETLINK/PF_ROUTE protocol family
[    0.011973] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.012788] thermal_sys: Registered thermal governor 'step_wise'
[    0.012965] hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers.
[    0.012977] hw-breakpoint: maximum watchpoint size is 8 bytes.
[    0.020813] platform 5460000.tcon-top: Fixing up cyclic dependency with 5200000.mixer
[    0.020879] platform 5460000.tcon-top: Fixing up cyclic dependency with 5100000.mixer
[    0.021147] platform 5461000.lcd-controller: Fixing up cyclic dependency with 5460000.tcon-top
[    0.021496] platform 5470000.lcd-controller: Fixing up cyclic dependency with 5604000.tv-encoder
[    0.021552] platform 5470000.lcd-controller: Fixing up cyclic dependency with 5460000.tcon-top
[    0.022299] platform 7090000.rtc: Fixing up cyclic dependency with 7010000.clock-controller
[    0.032144] SCSI subsystem initialized
[    0.032631] usbcore: registered new interface driver usbfs
[    0.032668] usbcore: registered new interface driver hub
[    0.032704] usbcore: registered new device driver usb
[    0.032895] mc: Linux media interface: v0.10
[    0.032937] videodev: Linux video capture interface: v2.00
[    0.033021] pps_core: LinuxPPS API ver. 1 registered
[    0.033027] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    0.033043] PTP clock support registered
[    0.033457] Advanced Linux Sound Architecture Driver Initialized.
[    0.034305] clocksource: Switched to clocksource arch_sys_counter
[    0.041567] NET: Registered PF_INET protocol family
[    0.041769] IP idents hash table entries: 2048 (order: 2, 16384 bytes, linear)
[    0.042309] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes, linear)
[    0.042333] Table-perturb hash table entries: 65536 (order: 6, 262144 bytes, linear)
[    0.042345] TCP established hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.042361] TCP bind hash table entries: 1024 (order: 2, 16384 bytes, linear)
[    0.042396] TCP: Hash tables configured (established 1024 bind 1024)
[    0.042483] UDP hash table entries: 256 (order: 1, 8192 bytes, linear)
[    0.042516] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes, linear)
[    0.042672] NET: Registered PF_UNIX/PF_LOCAL protocol family
[    0.043362] RPC: Registered named UNIX socket transport module.
[    0.043375] RPC: Registered udp transport module.
[    0.043378] RPC: Registered tcp transport module.
[    0.043382] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.044740] workingset: timestamp_bits=30 max_order=15 bucket_order=0
[    0.049688] NFS: Registering the id_resolver key type
[    0.049743] Key type id_resolver registered
[    0.049748] Key type id_legacy registered
[    0.049910] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 246)
[    0.049919] io scheduler mq-deadline registered
[    0.049925] io scheduler kyber registered
[    0.110062] Serial: 8250/16550 driver, 8 ports, IRQ sharing disabled
[    0.120343] CAN device driver interface
[    0.123619] sun6i-rtc 7090000.rtc: registered as rtc0
[    0.123743] sun6i-rtc 7090000.rtc: setting system clock to 1970-01-02T00:01:57 UTC (86517)
[    0.123898] sun6i-rtc 7090000.rtc: RTC enabled
[    0.124274] i2c_dev: i2c /dev entries driver
[    0.126297] sunxi-wdt 20500a0.watchdog: Watchdog enabled (timeout=16 sec, nowayout=0)
[    0.127485] sun8i-ce 3040000.crypto: Set mod clock to 300000000 (300 Mhz) from 400000000 (400 Mhz)
[    0.127851] sun8i-ce 3040000.crypto: will run requests pump with realtime priority
[    0.128180] sun8i-ce 3040000.crypto: will run requests pump with realtime priority
[    0.128389] sun8i-ce 3040000.crypto: will run requests pump with realtime priority
[    0.128567] sun8i-ce 3040000.crypto: will run requests pump with realtime priority
[    0.128715] sun8i-ce 3040000.crypto: Register cbc(aes)
[    0.128742] sun8i-ce 3040000.crypto: Register ecb(aes)
[    0.128753] sun8i-ce 3040000.crypto: Register cbc(des3_ede)
[    0.128761] sun8i-ce 3040000.crypto: Register ecb(des3_ede)
[    0.128790] sun8i-ce 3040000.crypto: CryptoEngine Die ID 0
[    0.129660] usbcore: registered new interface driver usbhid
[    0.129671] usbhid: USB HID core driver
[    0.132334] NET: Registered PF_PACKET protocol family
[    0.132349] can: controller area network core
[    0.132414] NET: Registered PF_CAN protocol family
[    0.132422] can: raw protocol
[    0.132428] can: broadcast manager protocol
[    0.132437] can: netlink gateway - max_hops=1
[    0.132536] Key type dns_resolver registered
[    0.132624] Registering SWP/SWPB emulation handler
[    0.153531] sun20i-d1-pinctrl 2000000.pinctrl: initialized sunXi PIO driver
[    0.154838] printk: console [ttyS0] disabled
[    0.175117] 2500000.serial: ttyS0 at MMIO 0x2500000 (irq = 231, base_baud = 1500000) is a 16550A
[    0.982678] printk: console [ttyS0] enabled
[    0.989524] spi-nand spi0.0: Winbond SPI NAND was found.
[    0.994905] spi-nand spi0.0: 128 MiB, block size: 128 KiB, page size: 2048, OOB size: 64
[    1.003735] 4 fixed-partitions partitions found on MTD device spi0.0
[    1.010126] Creating 4 MTD partitions on "spi0.0":
[    1.014929] 0x000000000000-0x000000040000 : "awboot"
[    1.020734] 0x000000040000-0x000000080000 : "dtb"
[    1.026242] 0x000000080000-0x000000800000 : "kernel"
[    1.040692] 0x000000800000-0x000008000000 : "rootfs"
[    1.196327] phy phy-4100400.phy.0: Changing dr_mode to 1
[    1.197449] usb_phy_generic usb_phy_generic.1.auto: dummy supplies not allowed for exclusive requests
[    1.201666] ehci-platform 4101000.usb: EHCI Host Controller
[    1.211437] musb-hdrc musb-hdrc.2.auto: MUSB HDRC host driver
[    1.216521] ehci-platform 4101000.usb: new USB bus registered, assigned bus number 1
[    1.222258] musb-hdrc musb-hdrc.2.auto: new USB bus registered, assigned bus number 2
[    1.231036] ehci-platform 4200000.usb: EHCI Host Controller
[    1.238618] hub 2-0:1.0: USB hub found
[    1.245347] ohci-platform 4200400.usb: Generic Platform OHCI controller
[    1.247320] hub 2-0:1.0: 1 port detected
[    1.257869] ehci-platform 4101000.usb: irq 233, io mem 0x04101000
[    1.264003] ehci-platform 4200000.usb: new USB bus registered, assigned bus number 3
[    1.271865] ohci-platform 4200400.usb: new USB bus registered, assigned bus number 4
[    1.276328] ubi0: attaching mtd3
[    1.283122] ehci-platform 4200000.usb: irq 235, io mem 0x04200000
[    1.289344] ehci-platform 4101000.usb: USB 2.0 started, EHCI 1.00
[    1.289449] ohci-platform 4200400.usb: irq 237, io mem 0x04200400
[    1.302048] hub 1-0:1.0: USB hub found
[    1.302066] sunxi-mmc 4020000.mmc: Got CD GPIO
[    1.306205] hub 1-0:1.0: 1 port detected
[    1.324365] ehci-platform 4200000.usb: USB 2.0 started, EHCI 1.00
[    1.331672] hub 3-0:1.0: USB hub found
[    1.334613] sunxi-mmc 4020000.mmc: initialized, max. request size: 2047 KB, uses new timings mode
[    1.335864] hub 3-0:1.0: 1 port detected
[    1.369028] hub 4-0:1.0: USB hub found
[    1.373134] hub 4-0:1.0: 1 port detected
[    1.444413] ohci-platform 4101400.usb: Generic Platform OHCI controller
[    1.451108] ohci-platform 4101400.usb: new USB bus registered, assigned bus number 5
[    1.459159] ohci-platform 4101400.usb: irq 236, io mem 0x04101400
[    1.539220] hub 5-0:1.0: USB hub found
[    1.543024] hub 5-0:1.0: 1 port detected
[    1.634337] random: crng init done
[    1.752292] ubi0: scanning is finished
[    1.756075] ubi0: empty MTD device detected
[    1.780913] ubi0: attached mtd3 (name "rootfs", size 120 MiB)
[    1.786721] ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
[    1.793593] ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
[    1.800387] ubi0: VID header offset: 2048 (aligned 2048), data offset: 4096
[    1.807350] ubi0: good PEBs: 960, bad PEBs: 0, corrupted PEBs: 0
[    1.813351] ubi0: user volume: 0, internal volumes: 1, max. volumes count: 128
[    1.820582] ubi0: max/mean erase counter: 0/0, WL threshold: 4096, image sequence number: 434364822
[    1.829631] ubi0: available PEBs: 936, total reserved PEBs: 24, PEBs reserved for bad PEB handling: 20
[    1.838948] ubi0: background thread "ubi_bgt0d" started, PID 84
[    1.839303] ALSA device list:
[    1.847860]   No soundcards found.
[    1.851862] VFS: Cannot open root device "ubi0:rootfs" or unknown-block(0,0): error -19
[    1.859912] Please append a correct "root=" boot option; here are the available partitions:
[    1.868283] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[    1.876543] CPU: 1 PID: 1 Comm: swapper/0 Not tainted 6.1.0-rc3 #7
[    1.882722] Hardware name: Generic DT based system
[    1.887517]  unwind_backtrace from show_stack+0x10/0x14
[    1.892758]  show_stack from dump_stack_lvl+0x40/0x4c
[    1.897817]  dump_stack_lvl from panic+0x108/0x2fc
[    1.902615]  panic from mount_block_root+0x174/0x20c
[    1.907585]  mount_block_root from prepare_namespace+0x9c/0x18c
[    1.913505]  prepare_namespace from kernel_init+0x18/0x12c
[    1.918993]  kernel_init from ret_from_fork+0x14/0x2c
[    1.924047] Exception stack(0xc8815fb0 to 0xc8815ff8)
[    1.929097] 5fa0:                                     00000000 00000000 00000000 00000000
[    1.937266] 5fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[    1.945434] 5fe0: 00000000 00000000 00000000 00000000 00000013 00000000
[    1.952045] CPU0: stopping
[    1.954760] CPU: 0 PID: 84 Comm: ubi_bgt0d Not tainted 6.1.0-rc3 #7
[    1.961022] Hardware name: Generic DT based system
[    1.965808]  unwind_backtrace from show_stack+0x10/0x14
[    1.971037]  show_stack from dump_stack_lvl+0x40/0x4c
[    1.976089]  dump_stack_lvl from do_handle_IPI+0xec/0x124
[    1.981489]  do_handle_IPI from ipi_handler+0x18/0x20
[    1.986542]  ipi_handler from handle_percpu_devid_irq+0x78/0x134
[    1.992552]  handle_percpu_devid_irq from generic_handle_domain_irq+0x28/0x38
[    1.999691]  generic_handle_domain_irq from gic_handle_irq+0x74/0x88
[    2.006050]  gic_handle_irq from generic_handle_arch_irq+0x34/0x44
[    2.012230]  generic_handle_arch_irq from call_with_stack+0x18/0x20
[    2.018502]  call_with_stack from __irq_svc+0x98/0xb0
[    2.023558] Exception stack(0xc8b85918 to 0xc8b85960)
[    2.028604] 5900:                                                       047868c0 0000000e
[    2.036772] 5920: 059dd8f2 00000000 05f5e100 05f5e100 00000010 0000000e 00000008 047868c0
[    2.044940] 5940: 00000008 23c34600 c049cc30 c8b85968 c049ccc8 c0882338 20000013 ffffffff
[    2.053105]  __irq_svc from __aeabi_uidiv+0x0/0x9c
[    2.057898]  __aeabi_uidiv from ccu_mp_round_rate+0x98/0x2d8
[    2.063560]  ccu_mp_round_rate from ccu_mux_helper_determine_rate+0xb8/0x1f8
[    2.070611]  ccu_mux_helper_determine_rate from ccu_mp_determine_rate+0x28/0x30
[    2.077919]  ccu_mp_determine_rate from clk_core_set_rate_nolock+0x60/0x294
[    2.084883]  clk_core_set_rate_nolock from clk_set_rate+0x30/0x154
[    2.091065]  clk_set_rate from sun6i_spi_transfer_one+0x548/0x6e4
[    2.097166]  sun6i_spi_transfer_one from spi_transfer_one_message+0x284/0x65c
[    2.104306]  spi_transfer_one_message from __spi_pump_transfer_message+0x2ec/0x4f8
[    2.111876]  __spi_pump_transfer_message from __spi_sync+0x244/0x2e4
[    2.118232]  __spi_sync from spi_sync+0x24/0x3c
[    2.122767]  spi_sync from spi_mem_exec_op+0x280/0x3d8
[    2.127910]  spi_mem_exec_op from spinand_write_page+0x1c4/0x224
[    2.133920]  spinand_write_page from spinand_mtd_write+0x14c/0x268
[    2.140098]  spinand_mtd_write from mtd_write+0x60/0x8c
[    2.145327]  mtd_write from ubi_io_write+0x10c/0x610
[    2.150299]  ubi_io_write from ubi_io_write_ec_hdr+0xd4/0x134
[    2.156050]  ubi_io_write_ec_hdr from sync_erase+0x90/0x1d0
[    2.161630]  sync_erase from __erase_worker+0x2c/0x47c
[    2.166775]  __erase_worker from erase_worker+0x14/0x64
[    2.172007]  erase_worker from do_work+0x9c/0x11c
[    2.176718]  do_work from ubi_thread+0xf8/0x19c
[    2.181257]  ubi_thread from kthread+0xd0/0xec
[    2.185713]  kthread from ret_from_fork+0x14/0x2c
[    2.190420] Exception stack(0xc8b85fb0 to 0xc8b85ff8)
[    2.195468] 5fa0:                                     00000000 00000000 00000000 00000000
[    2.203637] 5fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[    2.211803] 5fe0: 00000000 00000000 00000000 00000000 00000013 00000000
[    2.218414] ---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0) ]---
t113-i编译信息: I have already read, understood and accepted the above terms? [Y/N]y You select Yes, Build continue.... 07-21 10:58:06.673 3620 D mkcommon : ========ACTION List: mk_autoconfig -o openwrt -i t113_i -b evb1_auto -n default;======== 07-21 10:58:06.680 3620 D mkcommon : options : 07-21 10:58:09.421 3620 I mkcommon : kernel relative recovery defconfig: ../../../../../device/config/chips/t113_i/configs/evb1_auto/linux-5.4/config-5.4-recovery 07-21 10:58:09.426 3620 I mkcommon : kernel absolute recovery defconfig: /home/szbaijie/workspace/t113_i/T113_Tina5.0-V1.2/tina5.0-t113/device/config/chips/t113_i/configs/evb1_auto/linux-5.4/config-5.4-recovery 07-21 10:58:09.517 3620 I mkcommon : Prepare toolchain ... 07-21 10:58:09.554 3620 D mkcommon : Uncompressing '/home/szbaijie/workspace/t113_i/T113_Tina5.0-V1.2/tina5.0-t113/prebuilt/kernelbuilt/arm/gcc-linaro-5.3.1-2016.05-x86_64_arm-linux-gnueabi.tar.xz' to '/home/szbaijie/workspace/t113_i/T113_Tina5.0-V1.2/tina5.0-t113/out/toolchain/gcc-linaro-5.3.1-2016.05-x86_64_arm-linux-gnueabi' ... 07-21 10:58:44.025 3620 I mkcommon : kernel defconfig: generate /home/szbaijie/workspace/t113_i/T113_Tina5.0-V1.2/tina5.0-t113/out/t113_i/kernel/build/.config by /home/szbaijie/workspace/t113_i/T113_Tina5.0-V1.2/tina5.0-t113/device/config/chips/t113_i/configs/evb1_auto/linux-5.4/config-5.4 07-21 10:58:44.028 3620 I mkcommon : Prepare toolchain ... 07-21 10:58:44.162 3620 D mkcommon : make: Entering directory '/home/szbaijie/workspace/t113_i/T113_Tina5.0-V1.2/tina5.0-t113/kernel/linux-5.4' 07-21 10:58:44.206 3620 D mkcommon : make[1]: Entering directory '/home/szbaijie/workspace/t113_i/T113_Tina5.0-V1.2/tina5.0-t113/out/t113_i/kernel/build' 07-21 10:58:44.582 3620 D mkcommon : GEN Makefile 07-21 10:58:44.683 3620 D mkcommon : HOSTCC scripts/basic/fixdep 07-21 10:58:45.316 3620 D mkcommon : HOSTCC scripts/kconfig/conf.o 07-21 10:58:45.704 3620 D mkcommon : HOSTCC scripts/kconfig/confdata.o 07-21 10:58:46.309 3620 D mkcommon : HOSTCC scripts/kconfig/expr.o 07-21 10:58:46.848 3620 D mkcommon : LEX scripts/kconfig/lexer.lex.c 07-21 10:58:46.911 3620 D mkcommon : YACC scripts/kconfig/parser.tab.[ch] 07-21 10:58:47.101 3620 D mkcommon : HOSTCC scripts/kconfig/lexer.lex.o 07-21 10:58:47.640 3620 D mkcommon : HOSTCC scripts/kconfig/parser.tab.o 07-21 10:58:48.494 3620 D mkcommon : HOSTCC scripts/kconfig/preprocess.o 07-21 10:58:48.812 3620 D mkcommon : HOSTCC scripts/kconfig/symbol.o 07-21 10:58:49.826 3620 D mkcommon : HOSTLD scripts/kconfig/conf 07-21 10:58:49.979 3620 D mkcommon : *** Default configuration is based on '../../../../../device/config/chips/t113_i/configs/evb1_auto/linux-5.4/config-5.4' 07-21 10:58:53.228 3620 D mkcommon : # 07-21 10:58:53.234 3620 D mkcommon : # configuration written to .config 07-21 10:58:53.238 3620 D mkcommon : # 07-21 10:58:53.256 3620 D mkcommon : make[1]: Leaving directory '/home/szbaijie/workspace/t113_i/T113_Tina5.0-V1.2/tina5.0-t113/out/t113_i/kernel/build' 07-21 10:58:53.273 3620 D mkcommon : make: Leaving directory '/home/szbaijie/workspace/t113_i/T113_Tina5.0-V1.2/tina5.0-t113/kernel/linux-5.4' 07-21 10:58:54.539 3620 I mkcommon : clean buildserver 07-21 10:58:54.544 3620 I mkcommon : prepare_buildserver 07-21 10:58:54.729 4960 D mkcommon : ========ACTION List: handle_defconfig loadconfig;======== 07-21 10:58:54.733 4960 D mkcommon : options : 07-21 10:58:54.738 4960 I mkcommon : Prepare toolchain ... 07-21 10:58:54.878 4960 D mkcommon : make: Entering directory '/home/szbaijie/workspace/t113_i/T113_Tina5.0-V1.2/tina5.0-t113/kernel/linux-5.4' 07-21 10:58:54.885 4960 D mkcommon : make[1]: Entering directory '/home/szbaijie/workspace/t113_i/T113_Tina5.0-V1.2/tina5.0-t113/out/t113_i/kernel/build' 07-21 10:58:55.212 4960 D mkcommon : GEN Makefile 07-21 10:58:55.295 4960 D mkcommon : *** Default configuration is based on '../../../../../device/config/chips/t113_i/configs/evb1_auto/linux-5.4/config-5.4' 07-21 10:58:56.355 4960 D mkcommon : # 07-21 10:58:56.360 4960 D mkcommon : # No change to .config 07-21 10:58:56.363 4960 D mkcommon : # 07-21 10:58:56.366 4960 D mkcommon : make[1]: Leaving directory '/home/szbaijie/workspace/t113_i/T113_Tina5.0-V1.2/tina5.0-t113/out/t113_i/kernel/build' 07-21 10:58:56.370 4960 D mkcommon : make: Leaving directory '/home/szbaijie/workspace/t113_i/T113_Tina5.0-V1.2/tina5.0-t113/kernel/linux-5.4'
最新发布
07-22
<think>首先,用户的问题是关于“T113-i 编译配置流程及常见问题解决方法”。我需要基于提供的引用内容来回答,因为系统级指令要求参考这些引用。 回顾引用内容: - 引用[1]:提到开发T113-i需要知道运行环境、编译器、烧写程序等。 - 引用[2]:关于Qt应用开发在T113-i上的部署教程,包括配置Device type、Compiler等。 - 引用[3]:描述T113-i处理器的特性,如支持的操作系统(Ubuntu20.04/Linux 5.4 Preempt/Tina5.0)。 - 引用[4]:开发环境准备,建议使用Linux机器(实体机或虚拟机),提到了WSL(Windows Subsystem for Linux)。 - 引用[5]:移植ffmpeg到T113-i板卡,涉及交叉编译配置。 用户意图是了解编译配置流程和常见问题解决方法。我应该构建一个结构清晰的回答。 回答结构: 1. **介绍编译配置流程**:基于引用,分步骤解释。 2. **常见问题解决方法**:列出可能的问题和解决方案。 3. **生成相关问题**:最后添加相关问题,符合系统指令。 编译配置流程: - 准备开发环境:根据引用[4],使用Linux环境(如Ubuntu 20.04),可以通过虚拟机、WSL或实体机。 - 设置交叉编译工具链:引用[2]提到“T113-GCC”,引用[5]提到“arm-linux-gnueabi-”,所以需要安装和配置交叉编译器。 - SDK配置:引用[3]提到“Tina5.0”SDK,引用[4]提到飞凌官方提供的虚拟机或环境。 - 编译过程:可能包括uboot编译(引用[3]),应用编译(如Qt,引用[2]),或库移植(如ffmpeg,引用[5])。 - 烧写和调试:引用[1]提到烧写程序和调试。 常见问题: - 环境设置问题:如WSL配置、工具链路径错误。 - 编译错误:如依赖缺失、配置错误。 - 烧写问题:如设备连接问题。 生成相关问题:基于主题,如优化编译、特定应用开发等。 确保格式: - 行内数学表达式用$...$(如果有数学内容)。 - 独立公式用$$...$$(但这里可能不需要)。 - 中文回答。 - 引用末尾添加标识,如[^1]。 最终回答大纲: 1. 编译配置流程: - 步骤1: 准备开发环境(参考[4])。 - 步骤2: 获取和配置SDK(参考[3])。 - 步骤3: 设置交叉编译工具链(参考[2],[5])。 - 步骤4: 编译uboot或内核(参考[3])。 - 步骤5: 编译应用程序(参考[2],[5])。 - 步骤6: 烧写和调试(参考[1])。 2. 常见问题及解决方法: - 问题1: 环境配置错误。 - 问题2: 编译失败。 - 问题3: 烧写问题。 3. 相关问题:生成3-5个相关问题。</think>### T113-i 编译配置流程及常见问题解决方法 T113-i 是一款基于全志处理器的嵌入式开发板,广泛应用于工业控制、多媒体处理等领域。编译配置是开发的关键步骤,涉及环境搭建、工具链设置、代码编译和烧写等环节。以下基于引用内容,我将逐步解析标准流程,并提供常见问题的解决方法。流程主要参考 Tina5.0 SDK(一种常用的 Linux 发行版),但适用于其他环境如 Ubuntu 或 WSL。 #### 一、编译配置流程(分步骤详解) 编译配置的核心是设置交叉编译环境,确保代码能在主机(如 PC)上编译,并在目标板(T113-i)上运行。以下是标准流程: 1. **准备开发环境**(参考引用[4]) 开发 T113-i 需要使用 Linux 系统,推荐 Ubuntu 20.04。您可以选择: - **实体机或虚拟机**:安装 Ubuntu 20.04,并确保网络通畅。 - **Windows WSL**:在 Windows 中启用 WSL 2,安装 Ubuntu 20.04 子系统,更轻量级且无需虚拟机。 关键操作: - 更新系统:`sudo apt update && sudo apt upgrade` - 安装必要工具:`sudo apt install build-essential git cmake`(用于编译基础工具) - 验证环境:`gcc --version` 应显示版本信息。 2. **获取和配置 SDK**(参考引用[3]) T113-i 常用 Tina5.0 SDK,它包含 uboot、内核和根文件系统。 - 下载 SDK:从官方或供应商(如盈鹏飞)获取 Tina5.0 SDK 包,或使用 Git: ```bash git clone https://github.com/allwinner-tina/tina-sdk.git # 示例仓库,实际需替换为官方源 cd tina-sdk ``` - 初始化 SDK:运行配置脚本,选择目标板(如 `evb1_auto`): ```bash source build/envsetup.sh lunch t113_i_evb1-tina # 选择对应配置 ``` - 此步骤确保 SDK 路径和依赖正确设置,避免后续编译错误。 3. **设置交叉编译工具链**(参考引用[2],[5]) 交叉编译器让主机代码编译为 ARM 架构可执行文件。T113-i 常用 `arm-linux-gnueabi-` 或 `T113-GCC`。 - 安装工具链: - 如果 SDK 自带工具链,在 SDK 目录运行:`./build.sh config` 选择工具链路径。 - 手动安装(如无 SDK): ```bash sudo apt install gcc-arm-linux-gnueabi g++-arm-linux-gnueabi # 安装标准 ARM 工具链 ``` - 配置环境变量:在 `~/.bashrc` 添加路径,例如: ```bash export CROSS_COMPILE=arm-linux-gnueabi- export PATH=$PATH:/path/to/toolchain/bin # 替换为实际工具链路径 ``` 生效:`source ~/.bashrc`。 - 验证:`arm-linux-gnueabi-gcc --version` 应输出编译器版本。 4. **编译 uboot 或内核**(参考引用[3]) uboot 是启动加载器,需优先编译- 编译 uboot: ```bash cd tina-sdk make uboot # 或单独进入 uboot 目录:cd u-boot; make t113_i_defconfig; make ``` - 输出文件:`u-boot.bin`(在 `out/t113_i/evb1_auto/u-boot/`)。 - 编译内核(可选): ```bash make kernel # 或进入内核目录配置 ``` 此步骤生成 `zImage` 内核镜像。 5. **编译应用程序**(参考引用[2],[5]) 针对具体应用,如 Qt 或 ffmpeg,需配置交叉编译- 示例:编译 Qt 应用(参考引用[2]): - 在 Qt Creator 中,设置 Device type 为 "Generic Linux Device",Compiler 选 "T113-GCC",Debugger 选 "T113-Debugger"。 - 命令行编译: ```bash qmake -spec linux-arm-gnueabi-g++ # 指定交叉编译 make ``` - 示例:移植 ffmpeg(参考引用[5]): ```bash ./configure --prefix=/install/path --cross-prefix=arm-linux-gnueabi- --arch=arm --target-os=linux --enable-shared make && make install ``` 输出文件在指定路径,如动态库 `.so`。 6. **烧写和调试**(参考引用[1]) 将编译好的文件烧写到 T113-i 板卡。 - 烧写工具:使用 `sunxi-fel` 或供应商工具(如 PhoenixSuit)。 - 连接板卡:通过 USB-OTG 连接主机。 - 烧写 uboot:`sunxi-fel -v uboot u-boot.bin` - 烧写系统:使用 TF 卡或 eMMC,复制文件到存储设备。 - 调试:通过串口(如 `minicom`)查看启动日志,确保系统正常运行。 整个流程耗时约 30-60 分钟,具体取决于项目复杂度。关键点:环境一致性(如 Ubuntu 20.04)、工具链路径正确性、和配置脚本的准确执行[^4][^3]。 #### 二、常见问题及解决方法 以下是编译过程中常见问题,基于典型错误和引用内容总结: 1. **环境配置错误** - **问题**:WSL 或虚拟机中工具链无法识别,报错如 "arm-linux-gnueabi-gcc: command not found"。 **原因**:环境变量未设置或路径错误。 **解决**: - 检查 `~/.bashrc` 中的 `PATH` 和 `CROSS_COMPILE`,确保无拼写错误。 - 运行 `which arm-linux-gnueabi-gcc` 验证路径。 - 如果使用 WSL,确保 Windows 路径未干扰(在 WSL 中运行 `mount` 检查)。 - 参考引用[4],建议使用官方打包的虚拟机减少配置问题。 2. **编译失败(依赖缺失或配置错误)** - **问题**:编译 uboot 或应用时报错,如 "undefined reference" 或 "missing library"。 **原因**:依赖库未安装或 SDK 配置不全。 **解决**: - 安装缺失依赖:`sudo apt install libssl-dev libncurses-dev`(常见于内核编译)。 - 对于 SDK,运行 `make menuconfig` 检查配置,确保所有选项启用(如文件系统支持)。 - 应用程序(如 ffmpeg)需指定 pkg-config 路径(参考引用[5]):添加 `--pkg-config=/path/to/pkg-config` 到 configure 命令。 - 清理并重编译:`make clean && make`。 3. **烧写问题** - **问题**:烧写后板卡无法启动,串口无输出。 **原因**:镜像文件损坏、烧写工具不兼容或设备连接问题。 **解决**: - 验证镜像完整性:`md5sum u-boot.bin` 比对官方哈希值。 - 确保使用正确的烧写模式(如 T113-i 的 FEL 模式)。 - 检查 USB 连接:在 Linux 中运行 `lsusb` 查看设备是否识别。 - 参考引用[1],优先使用供应商提供的烧写工具,如 PhoenixSuit。 4. **性能问题(编译慢或应用卡顿)** - **问题**:编译耗时过长,或板卡上应用运行缓慢。 **原因**:主机资源不足或编译选项未优化。 **解决**: - 增加并行编译:`make -j$(nproc)` 使用多核加速。 - 优化代码:针对 T113-i 特性(如双核 Cortex-A7),在编译时添加 `-mcpu=cortex-a7` 选项。 - 减少调试符号:使用 `strip` 工具瘦身可执行文件(参考引用[5])。 如果问题持续,建议查阅官方文档或社区论坛(如全志开发者社区),许多问题源于特定硬件版本或 SDK 更新[^3][^5]。 ####
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值