移植QT5.9到嵌入式开发板(详细)

1、硬件平台

开发板是飞凌OK335XD

具体参数介绍:https://blog.csdn.net/Ternence_zq/article/details/109691911

OK335XD开发平台基于 TI AM335X 处理器,运行主频最高达 1G,支持 Linux,WinCE, Android 三大操作系统,及 StarterWare 裸机程序,可用于工业产品设计。 OK335xD 由核心板和底板组成,核心板主要芯片有: CPU, NandFlash, Memory, PowerManage。

OK335xD 产品是工业级版本,核心板 FET335xD 也是工业级版本。工业级版本更强调系统在复杂环境下运行的稳定性,比如高低温环境,振动环境,电磁干扰环境。
在这里插入图片描述

2、软件平台介绍

Linux操作系统

PC端:Ubuntu16.04、Linux内核是4.15、gcc是5.4.0
开发板:交叉编译器4.9.4、u-boot-2011.09、linux-3.2.0、文件系统ubi

uname -a
Linux Tavi 4.15.0-106-generic #107~16.04.1-Ubuntu SMP Thu Jun 4 15:40:05 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
 gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 5.4.0-6ubuntu1~16.04.12' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.12) 

移植的要求

交叉编译器至少是4.7,才能支持C++11的新特性,例如lambda表达式等,而且QT开发时,用到这些新特性。

QT下默认C++11是不启用的,要想使用C++11,可以在QT的project里面的.pro文件上加上一行 CONFIG += c++11 ,这样就可以开始使用C++ 11的一些特性了。

具体介绍可以参考该链接:https://blog.csdn.net/haluoluo211/article/details/71141093

3、源码下载与编译

交叉编译器

https://blog.csdn.net/Ternence_zq/article/details/109691911

更新中。。。

4、系统烧录

制作SD卡烧录

推荐方法: 首先将SD卡插入到自己的笔记本SD卡插槽里,准备制作SD卡启动盘。这里建议使用官方推荐的HPUSBFW工具格式化SD卡,该工具可将SD卡分区设置为活动分区,这样开发板在上电的时可以正常从SD卡启动,否则开发板无法失败SD卡信息导致无法正常启动。
在这里插入图片描述

另一种方法:使用SD Card Formatter软件来格式化SD卡,但该软件格式化后并不会将相应分区设置为活动分区,导致无法启动。
在这里插入图片描述
这时我们可以使用Windows自带的diskpart命令来设置,具体方法为: 首先Windows+R键打开运行,并输入diskpart 运行该命令:
在这里插入图片描述
接下来输入相关命令来设置SD卡分区为活动分区:
在这里插入图片描述
磁盘格式化分区制作好之后,把之前编译生成的bootloader镜像文件MLO和u-boot.img拷贝到分区根路径下即可:
在这里插入图片描述

命令行烧录

OK335X开发板支持SD卡和Nandflash启动,因为Nandflash在出厂时没有程序,所以我们可以从SD卡启动u-boot,然后在U-boot下使用相应命令下载u-boot、linux内核和根文件系统到Nandflash上。其中SD卡和Nandflash启动由下图所示的拨码开关决定:

  1. SD 卡启动设置: 1 On, 2 On (On 代表拨到上方,Off 代表拨到下方)
  2. NandFlash 启动设置:1 Off ,2 On (On 代表拨到上方,Off 代表拨到下方)

现在,我们将SD卡放入到SD卡槽,并将拨码开关1,2设置到上方,然后将系统上电,这时系统将从SD卡启动:
在这里插入图片描述
注意: 现在新买的OK335XD拨码简化成一个,设置SD/Nandflash启动方式如下:

  1. SD 卡启动设置: 直接拨到 On(On 代表拨到上方, Off 代表拨到下方)
  2. NandFlash 启动设置: 直接拨到 Off(On 代表拨到上方, Off 代表拨到下方)

启动开发板,使用串口监听console口,按任意键停止U-boot的自动启动,然后输入0进入到uboot 命令行模式:
在这里插入图片描述

OK335X# setenv ipaddr 192.168.2.222   	//设置U-boot的IP地址
OK335X# setenv serverip 192.168.2.2 	//设置 tftp 服务器的IP地址
OK335X# pri 		//打印u-boot的当前环境变量
OK335X# nand erase.chip 		//擦除整片Nandflash上内容
NAND erase.chip: device 0 whole chip
100% complete
OK
OK335X# save 	//保存环境变量

通过uboot下写的脚本文件,一键编译烧录uboot、内核和根文件系统到Nandflash中:

OK335X# run bsys 		//使用该命令一键烧录u-boot、linux内核和根文件系统

Nandflash启动OK335XD

系统烧录好后,关闭开发板电源并拔除SD卡,然后设置拨码开关从Nandflash启动,并重新上电:

在这里插入图片描述
这时我们可以看到系统从Nandflash上启动成功了:

在这里插入图片描述
下面是系统上电后的整个启动流程,如果想升级U-boot、Linux内核或文件系统,我们也可以进入到U-boot命令行,用相关命令升级。

U-Boot SPL 2011.09-00000-g0c27dde (Jun 25 2020 - 11:42:33)
Texas Instruments Revision detection unimplemented
Booting from NAND...
U-Boot 2011.09-00000-g0c27dde (Jun 25 2020 - 11:42:33)
I2C: ready
DRAM: 512 MiB
WARNING: Caches not enabled
Did not find a recognized configuration, assuming General purpose EVM in Profile
0 with Daughter boardNAND: HW ECC Hamming Code selected
256 MiB
MMC: OMAP SD/MMC: 0
*** Warning - bad CRC, using default environment
Net: cpsw
Hit any key to stop autoboot: 0
HW ECC BCH8 Selected
NAND read: device 0 offset 0x100000, size 0x500000
5242880 bytes read: OK
## Booting kernel from Legacy Image at 80200000 ...
Image Name: Linux-3.2.0
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 3434864 Bytes = 3.3 MiB
Load Address: 80008000
Entry Point: 80008000
Verifying Checksum ... OK
Loading Kernel Image ... OK
OK
Starting kernel ...
Uncompressing Linux... done, booting the kernel.
[ 0.000000] Linux version 3.2.0 (guowenxue@ubuntu-master) (gcc version 4.9.4
(Linaro GCC 4.9-2017.01) ) #1 Thu Jun 25 11:53:32 CST 2020
[ 0.000000] CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c53c7d
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction
cache
[ 0.000000] Machine: am335xevm
[ 0.000000] Memory policy: ECC disabled, Data cache writeback
[ 0.000000] AM335X ES2.1 (sgx neon )
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total
pages: 130048
[ 0.000000] Kernel command line: console=ttyO0,115200n8 root=ubi0:rootfs rw
ubi.mtd=4,2048 rootfstype=ubifs rootwait=1
[ 0.000000] PID hash table entries: 2048 (order: 1, 8192 bytes)
[ 0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
[ 0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
[ 0.000000] Memory: 512MB = 512MB total
[ 0.000000] Memory: 512540k/512540k available, 11748k reserved, 0K highmem
[ 0.000000] Virtual kernel memory layout:
[ 0.000000] vector : 0xffff0000 - 0xffff1000 ( 4 kB)
[ 0.000000] fixmap : 0xfff00000 - 0xfffe0000 ( 896 kB)
[ 0.000000] vmalloc : 0xe0800000 - 0xff000000 ( 488 MB)
[ 0.000000] lowmem : 0xc0000000 - 0xe0000000 ( 512 MB)
[ 0.000000] modules : 0xbf000000 - 0xc0000000 ( 16 MB)
[ 0.000000] .text : 0xc0008000 - 0xc0632000 (6312 kB)
[ 0.000000] .init : 0xc0632000 - 0xc0669000 ( 220 kB)
[ 0.000000] .data : 0xc066a000 - 0xc06d9f60 ( 448 kB)
[ 0.000000] .bss : 0xc06d9f84 - 0xc070aaa8 ( 195 kB)
[ 0.000000] NR_IRQS:396
[ 0.000000] IRQ: Found an INTC at 0xfa200000 (revision 5.0) with 128
interrupts
[ 0.000000] Total of 128 interrupts on 1 active controller
[ 0.000000] OMAP clockevent source: GPTIMER2 at 24000000 Hz
[ 0.000000] omap_dm_timer_switch_src: Switching to HW default
clocksource(sys_clkin_ck) for timer1, this may impact timekeeping in low power
state
[ 0.000000] OMAP clocksource: GPTIMER1 at 24000000 Hz
[ 0.000000] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every
178956ms
[ 0.000000] Console: colour dummy device 80x30
[ 0.000189] Calibrating delay loop... 718.02 BogoMIPS (lpj=3590144)
[ 0.057154] pid_max: default: 32768 minimum: 301
[ 0.057285] Security Framework initialized
[ 0.057389] Mount-cache hash table entries: 512
[ 0.057779] CPU: Testing write buffer coherency: ok
[ 0.058554] devtmpfs: initialized
[ 0.078148] omap_hwmod: pruss: failed to hardreset[ 0.079276] print_constraints: dummy:
[ 0.079651] NET: Registered protocol family 16
[ 0.081834] OMAP GPIO hardware version 0.1
[ 0.084435] omap_mux_init: Add partition: #1: core, flags: 0
[ 0.086259] omap_i2c.1: alias fck already exists
[ 0.087328] omap_hsmmc.0: alias fck already exists
[ 0.088040] da8xx_lcdc.0: alias fck already exists
[ 0.088341] omap_i2c.2: alias fck already exists
[ 0.089874] d_can.0: alias fck already exists
[ 0.090189] davinci-mcasp.1: alias fck already exists
[ 0.091431] omap2_mcspi.1: alias fck already exists
[ 0.091668] omap2_mcspi.2: alias fck already exists
[ 0.091956] edma.0: alias fck already exists
[ 0.091976] edma.0: alias fck already exists
[ 0.091995] edma.0: alias fck already exists
[ 0.119475] bio: create slab <bio-0> at 0
[ 0.121738] SCSI subsystem initialized
[ 0.123722] usbcore: registered new interface driver usbfs
[ 0.124031] usbcore: registered new interface driver hub
[ 0.124233] usbcore: registered new device driver usb
[ 0.124539] registerd cppi-dma Intr @ IRQ 17
[ 0.124553] Cppi41 Init Done Qmgr-base(e087a000) dma-base(e0878000)
[ 0.124564] Cppi41 Init Done
[ 0.124590] musb-ti81xx musb-ti81xx: musb0, board_mode=0x13, plat_mode=0x3
[ 0.124900] musb-ti81xx musb-ti81xx: musb1, board_mode=0x13, plat_mode=0x1
[ 0.126049] omap_i2c omap_i2c.1: bus 1 rev2.4.0 at 100 kHz
[ 0.127771] tps65217 1-0024: TPS65217 ID 0xe version 1.2
[ 0.129805] print_constraints: DCDC1: 900 <--> 1800 mV at 1500 mV
[ 0.131826] print_constraints: DCDC2: 900 <--> 3300 mV at 1100 mV
[ 0.133821] print_constraints: DCDC3: 900 <--> 1500 mV at 1100 mV
[ 0.135798] print_constraints: LDO1: 1000 <--> 3300 mV at 1800 mV
[ 0.137778] print_constraints: LDO2: 900 <--> 3300 mV at 3300 mV
[ 0.139764] print_constraints: LDO3: 1800 <--> 3300 mV at 1800 mV
[ 0.141773] print_constraints: LDO4: 1800 <--> 3300 mV at 3300 mV
[ 0.142640] omap_i2c omap_i2c.2: bus 2 rev2.4.0 at 100 kHz
[ 0.144422] Advanced Linux Sound Architecture Driver Version 1.0.24.
[ 0.145835] cfg80211: Calling CRDA to update world regulatory domain
[ 0.147049] Switching to clocksource gp timer
[ 0.164826] musb-hdrc: version 6.0, ?dma?, otg (peripheral+host)
[ 0.165035] musb-hdrc musb-hdrc.0: dma type: dma-cppi41
[ 0.165362] MUSB0 controller's USBSS revision = 4ea20800
[ 0.165396] musb0: Enabled SW babble control
[ 0.166347] musb-hdrc musb-hdrc.0: USB OTG mode controller at e083c000 using
DMA, IRQ 18
[ 0.166516] musb-hdrc musb-hdrc.1: dma type: dma-cppi41
[ 0.166822] MUSB1 controller's USBSS revision = 4ea20800
[ 0.166851] musb1: Enabled SW babble control
[ 0.167357] musb-hdrc musb-hdrc.1: MUSB HDRC host driver
[ 0.167448] musb-hdrc musb-hdrc.1: new USB bus registered, assigned bus number
1
[ 0.167595] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[ 0.167611] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 0.167625] usb usb1: Product: MUSB HDRC host driver
[ 0.167635] usb usb1: Manufacturer: Linux 3.2.0 musb-hcd
[ 0.167646] usb usb1: SerialNumber: musb-hdrc.1
[ 0.168583] hub 1-0:1.0: USB hub found
[ 0.168613] hub 1-0:1.0: 1 port detected
[ 0.169227] musb-hdrc musb-hdrc.1: USB Host mode controller at e083e800 using
DMA, IRQ 19
[ 0.169678] NET: Registered protocol family 2
[ 0.169873] IP route cache hash table entries: 4096 (order: 2, 16384 bytes)
[ 0.170185] TCP established hash table entries: 16384 (order: 5, 131072 bytes)
[ 0.170484] TCP bind hash table entries: 16384 (order: 4, 65536 bytes)
[ 0.170659] TCP: Hash tables configured (established 16384 bind 16384)
[ 0.170672] TCP reno registered
[ 0.170685] UDP hash table entries: 256 (order: 0, 4096 bytes)
[ 0.170707] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[ 0.170897] NET: Registered protocol family 1
[ 0.171164] RPC: Registered named UNIX socket transport module.
[ 0.171178] RPC: Registered udp transport module.[ 0.171187] RPC: Registered tcp transport module.
[ 0.171195] RPC: Registered tcp NFSv4.1 backchannel transport module.
[ 0.171268] NetWinder Floating Point Emulator V0.97 (double precision)
[ 0.171493] omap-gpmc omap-gpmc: GPMC revision 6.0
[ 0.171511] Registering NAND on CS0
[ 0.191027] VFS: Disk quotas dquot_6.5.2
[ 0.191101] Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[ 0.191655] msgmni has been set to 1001
[ 0.194786] alg: No test for stdrng (krng)
[ 0.194862] io scheduler noop registered
[ 0.194873] io scheduler deadline registered
[ 0.194978] io scheduler cfq registered (default)
[ 0.196553] da8xx_lcdc da8xx_lcdc.0: GLCD: Found NHD-7.0-ATXI#-T-1 panel
[ 0.207208] Console: switching to colour frame buffer device 100x30
[ 0.214566] omap_uart.0: ttyO0 at MMIO 0x44e09000 (irq = 72) is a OMAP UART0
[ 0.906849] console [ttyO0] enabled
[ 0.911275] omap_uart.1: ttyO1 at MMIO 0x48022000 (irq = 73) is a OMAP UART1
[ 0.919244] omap_uart.2: ttyO2 at MMIO 0x48024000 (irq = 74) is a OMAP UART2
[ 0.927145] omap_uart.3: ttyO3 at MMIO 0x481a6000 (irq = 44) is a OMAP UART3
[ 0.935044] omap_uart.4: ttyO4 at MMIO 0x481a8000 (irq = 45) is a OMAP UART4
[ 0.942956] omap_uart.5: ttyO5 at MMIO 0x481aa000 (irq = 46) is a OMAP UART5
[ 0.961141] brd: module loaded
[ 0.969566] loop: module loaded
[ 0.973300] i2c-core: driver [tsl2550] using legacy suspend method
[ 0.979796] i2c-core: driver [tsl2550] using legacy resume method
[ 0.986529] at24 1-0050: 32768 byte 24c256 EEPROM, writable, 1 bytes/write
[ 0.996597] mtdoops: mtd device (mtddev=name/number) must be supplied
[ 1.003957] omap2-nand driver initializing
[ 1.008604] ONFI flash detected
[ 1.012010] ONFI param page 0 valid
[ 1.015658] NAND device: Manufacturer ID: 0x2c, Chip ID: 0xda (Micron
MT29F2G08ABAEAWP)
[ 1.024393] Creating 6 MTD partitions on "omap2-nand.0":
[ 1.029975] 0x000000000000-0x000000080000 : "SPL"
[ 1.036704] 0x000000080000-0x0000000c0000 : "U-Boot"
[ 1.043414] 0x0000000c0000-0x000000100000 : "U-Boot Env"
[ 1.050555] 0x000000100000-0x000000600000 : "Kernel"
[ 1.059183] 0x000000600000-0x000009c00000 : "Rootfs"
[ 1.127858] 0x000009c00000-0x000010000000 : "Apps"
[ 1.175691] OneNAND driver initializing
[ 1.179931] usb 1-1: new high-speed USB device number 2 using musb-hdrc
[ 1.187755] UBI: attaching mtd4 to ubi0
[ 1.191780] UBI: physical eraseblock size: 131072 bytes (128 KiB)
[ 1.198344] UBI: logical eraseblock size: 126976 bytes
[ 1.203979] UBI: smallest flash I/O unit: 2048
[ 1.208896] UBI: VID header offset: 2048 (aligned 2048)
[ 1.215164] UBI: data offset: 4096
[ 1.337841] usb 1-1: New USB device found, idVendor=0424, idProduct=2514
[ 1.344847] usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[ 1.368308] hub 1-1:1.0: USB hub found
[ 1.372299] hub 1-1:1.0: 4 ports detected
[ 1.688048] usb 1-1.3: new high-speed USB device number 3 using musb-hdrc
[ 1.847228] usb 1-1.3: New USB device found, idVendor=0c45, idProduct=6340
[ 1.854410] usb 1-1.3: New USB device strings: Mfr=2, Product=1,
SerialNumber=0
[ 1.862054] usb 1-1.3: Product: USB 2.0 Camera
[ 1.866690] usb 1-1.3: Manufacturer: Sonix Technology Co., Ltd.
[ 2.220640] UBI: max. sequence number: 0
[ 2.255306] UBI: volume 0 ("rootfs") re-sized from 1074 to 1184 LEBs
[ 2.262981] UBI: attached mtd4 to ubi0
[ 2.266897] UBI: MTD device name: "Rootfs"
[ 2.272203] UBI: MTD device size: 150 MiB
[ 2.277397] UBI: number of good PEBs: 1200
[ 2.282302] UBI: number of bad PEBs: 0
[ 2.286937] UBI: number of corrupted PEBs: 0
[ 2.291578] UBI: max. allowed volumes: 128
[ 2.296392] UBI: wear-leveling threshold: 4096
[ 2.301319] UBI: number of internal volumes: 1
[ 2.305953] UBI: number of user volumes: 1
[ 2.310598] UBI: available PEBs: 0[ 2.315231] UBI: total number of reserved PEBs: 1200
[ 2.320417] UBI: number of PEBs reserved for bad PEB handling: 12
[ 2.326775] UBI: max/mean erase counter: 1/0
[ 2.331234] UBI: image sequence number: 22181041
[ 2.336232] UBI: background thread "ubi_bgt0d" started, PID 598
[ 2.357751] CAN device driver interface
[ 2.361757] CAN bus driver for Bosch D_CAN controller 1.0
[ 2.377377] d_can d_can.0: device registered (irq=52, irq_obj=53)
[ 2.447212] davinci_mdio davinci_mdio.0: davinci mdio revision 1.6
[ 2.453673] davinci_mdio davinci_mdio.0: detected phy mask fffffffe
[ 2.477546] davinci_mdio.0: probed
[ 2.481102] davinci_mdio davinci_mdio.0: phy[0]: device 0:00, driver unknown
[ 2.497180] PPP generic driver version 2.4.2
[ 2.507755] PPP BSD Compression module registered
[ 2.512672] PPP Deflate Compression module registered
[ 2.527384] usbcore: registered new interface driver rtl8192cu
[ 2.537168] usbcore: registered new interface driver zd1201
[ 2.557096] usbcore: registered new interface driver cdc_ether
[ 2.567320] usbcore: registered new interface driver cdc_eem
[ 2.577336] usbcore: registered new interface driver dm9601
[ 2.583197] cdc_ncm: 04-Aug-2011
[ 2.597160] usbcore: registered new interface driver cdc_ncm
[ 2.603066] Initializing USB Mass Storage driver...
[ 2.617188] usbcore: registered new interface driver usb-storage
[ 2.623460] USB Mass Storage support registered.
[ 2.647201] usbcore: registered new interface driver usbserial
[ 2.653438] USB Serial support registered for generic
[ 2.667164] usbcore: registered new interface driver usbserial_generic
[ 2.673979] usbserial: USB Serial Driver core
[ 2.687413] USB Serial support registered for ch341-uart
[ 2.697173] usbcore: registered new interface driver ch341
[ 2.707148] USB Serial support registered for cp210x
[ 2.727092] usbcore: registered new interface driver cp210x
[ 2.732908] cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor driver
[ 2.747150] USB Serial support registered for FTDI USB Serial Device
[ 2.767161] usbcore: registered new interface driver ftdi_sio
[ 2.773161] ftdi_sio: v1.6.0:USB FTDI Serial Converters Driver
[ 2.787459] USB Serial support registered for GSM modem (1-port)
[ 2.807395] usbcore: registered new interface driver option
[ 2.813219] option: v0.7.2:USB Driver for GSM modems
[ 2.827150] USB Serial support registered for pl2303
[ 2.832531] usbcore: registered new interface driver pl2303
[ 2.838364] pl2303: Prolific PL2303 USB to serial adaptor driver
[ 2.857095] gadget: Mass Storage Function, version: 2009/09/11
[ 2.863280] gadget: Number of LUNs=1
[ 2.867113] lun0: LUN: removable file: (no medium)
[ 2.872232] gadget: Mass Storage Gadget, version: 2009/09/11
[ 2.878244] gadget: userspace failed to provide iSerialNumber
[ 2.884343] gadget: g_mass_storage ready
[ 2.888549] musb-hdrc musb-hdrc.0: MUSB HDRC host driver
[ 2.894150] musb-hdrc musb-hdrc.0: new USB bus registered, assigned bus number
2
[ 2.902000] usb usb2: New USB device found, idVendor=1d6b, idProduct=0002
[ 2.909106] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 2.916643] usb usb2: Product: MUSB HDRC host driver
[ 2.921835] usb usb2: Manufacturer: Linux 3.2.0 musb-hcd
[ 2.927387] usb usb2: SerialNumber: musb-hdrc.0
[ 2.957213] hub 2-0:1.0: USB hub found
[ 2.961147] hub 2-0:1.0: 1 port detected
[ 2.977777] mousedev: PS/2 mouse device common for all mice
[ 2.998068] input: ft5x0x_ts as /devices/virtual/input/input0
[ 3.179420] uc_reg_value=20
[ 3.197435] rtc-ds1307 1-0068: rtc core: registered ds1307 as rtc0
[ 3.203904] rtc-ds1307 1-0068: 56 bytes nvram
[ 3.217167] i2c /dev entries driver
[ 3.228149] Linux video capture interface: v2.00
[ 3.237344] uvcvideo: Found UVC 1.00 device USB 2.0 Camera (0c45:6340)
[ 3.277780] input: USB 2.0 Camera as /devices/platform/omap/musb-ti81xx/musbhdrc.1/usb1/1-1/1-1.3/1-1.3:1.0/input/input1
[ 3.307187] usbcore: registered new interface driver uvcvideo[ 3.313230] USB Video Class driver (1.1.1)
[ 3.327194] OMAP Watchdog Timer Rev 0x01: initial timeout 60 sec
[ 3.347522] cpuidle: using governor ladder
[ 3.357294] cpuidle: using governor menu
[ 3.417696] usbcore: registered new interface driver usbhid
[ 3.423520] usbhid: USB HID core driver
[ 3.437860] tiadc tiadc: attached adc driver
[ 3.445182] _regulator_get: 2-001b supply IOVDD not found, using dummy
regulator
[ 3.453009] _regulator_get: 2-001b supply DVDD not found, using dummy
regulator
[ 3.460697] _regulator_get: 2-001b supply AVDD not found, using dummy
regulator
[ 3.468392] _regulator_get: 2-001b supply DRVDD not found, using dummy
regulator
[ 3.478993] asoc: tlv320aic3x-hifi <-> davinci-mcasp.1 mapping ok
[ 3.519574] ALSA device list:
[ 3.522678] #0: AM335X EVM
[ 3.525689] oprofile: hardware counters not available
[ 3.530988] oprofile: using timer interrupt.
[ 3.535470] nf_conntrack version 0.5.0 (8008 buckets, 32032 max)
[ 3.542329] ip_tables: (C) 2000-2006 Netfilter Core Team
[ 3.548025] TCP cubic registered
[ 3.551403] NET: Registered protocol family 17
[ 3.556050] can: controller area network core (rev 20090105 abi 8)
[ 3.562614] NET: Registered protocol family 29
[ 3.567289] can: raw protocol (rev 20090105)
[ 3.571743] can: broadcast manager protocol (rev 20090105 t)
[ 3.577699] Registering the dns_resolver key type
[ 3.582681] VFP support v0.3: implementor 41 architecture 3 part 30 variant c
rev 3
[ 3.590703] ThumbEE CPU extension supported.
[ 3.595223] mux: Failed to setup hwmod io irq -22
[ 3.600843] Power Management for AM33XX family
[ 3.605701] Trying to load am335x-pm-firmware.bin (60 secs timeout)
[ 3.612408] Copied the M3 firmware to UMEM
[ 3.616761] Cortex M3 Firmware Version = 0x181
[ 3.626582] clock: disabling unused clocks to save power
[ 3.634306] Detected MACID=20:cd:39:e1:f5:ce
[ 3.639991] cpsw: Detected MACID = 20:cd:39:e1:f5:d0
[ 3.647311] input: gpio-keys as /devices/platform/gpio-keys/input/input2
[ 3.656098] rtc-ds1307 1-0068: setting system clock to 2000-01-01 00:23:20 UTC
(946686200)
[ 3.735013] UBIFS: start fixing up free space
[ 12.500567] UBIFS: free space fixup complete
[ 12.578344] UBIFS: mounted UBI device 0, volume 0, name "rootfs"
[ 12.584628] UBIFS: file system size: 138911744 bytes (135656 KiB, 132 MiB,
1094 LEBs)
[ 12.593016] UBIFS: journal size: 9023488 bytes (8812 KiB, 8 MiB, 72
LEBs)
[ 12.600655] UBIFS: media format: w4/r0 (latest is w4/r0)
[ 12.606743] UBIFS: default compressor: lzo
[ 12.611024] UBIFS: reserved for root: 0 bytes (0 KiB)
[ 12.651467] VFS: Mounted root (ubifs filesystem) on device 0:14.
[ 12.660950] devtmpfs: mounted
[ 12.664379] Freeing init memory: 220K
[ 13.411750] UBI: attaching mtd5 to ubi5
[ 13.415774] UBI: physical eraseblock size: 131072 bytes (128 KiB)
[ 13.422358] UBI: logical eraseblock size: 126976 bytes
[ 13.428001] UBI: smallest flash I/O unit: 2048
[ 13.432907] UBI: VID header offset: 2048 (aligned 2048)
[ 13.439180] UBI: data offset: 4096
[ 13.890820] UBI: empty MTD device detected
[ 13.895174] UBI: max. sequence number: 0
[ 13.899920] UBI: create volume table (copy #1)
[ 13.912772] UBI: create volume table (copy #2)
[ 13.933200] UBI: attached mtd5 to ubi5
[ 13.937201] UBI: MTD device name: "Apps"
[ 13.942289] UBI: MTD device size: 100 MiB
[ 13.947478] UBI: number of good PEBs: 800[ 13.952292] UBI: number of bad PEBs: 0
[ 13.956923] UBI: number of corrupted PEBs: 0
[ 13.961565] UBI: max. allowed volumes: 128
[ 13.966378] UBI: wear-leveling threshold: 4096
[ 13.971292] UBI: number of internal volumes: 1
[ 13.975923] UBI: number of user volumes: 0
[ 13.980563] UBI: available PEBs: 788
[ 13.985377] UBI: total number of reserved PEBs: 12
[ 13.990380] UBI: number of PEBs reserved for bad PEB handling: 8
[ 13.996648] UBI: max/mean erase counter: 0/0
[ 14.001105] UBI: image sequence number: 644108343
[ 14.006121] UBI: background thread "ubi_bgt5d" started, PID 751
[ 15.124227] UBIFS: default file-system created
[ 15.228930] UBIFS: mounted UBI device 5, volume 0, name "apps"
[ 15.235044] UBIFS: file system size: 96882688 bytes (94612 KiB, 92 MiB, 763
LEBs)
[ 15.243056] UBIFS: journal size: 4825088 bytes (4712 KiB, 4 MiB, 38
LEBs)
[ 15.250697] UBIFS: media format: w4/r0 (latest is w4/r0)
[ 15.256780] UBIFS: default compressor: lzo
[ 15.261063] UBIFS: reserved for root: 4576008 bytes (4468 KiB)
[ 15.411633] net eth0: CPSW phy found : id is : 0x4dd074
OK335xD login:

Default Password: 12345
OK335xD login: root 输入用户名
Password: 这里输入密码,默认为12345
~ >:
~ >: ls
apps data home lib media proc stat usr
backup dev info linuxrc mnt root sys var
bin etc init logs opt sbin tmp
~ >:
~ >:

5、tslib与QT移植

tslib移植

tslib-1.16下载:。。。
tslib存放的目录为/home/tavi/ok335x/3rdparty/qt/tslib/tslib-1.16
tslib编译的结果存放在/home/tavi/ok335x/3rdparty/install目录下

tavi@Tavi:~/ok335x/3rdparty/install$ ls			//编译结果
bin  etc  include  lib  share
tavi@Tavi:~/ok335x/3rdparty/install$ ls
bin  etc  include  lib  share
tavi@Tavi:~/ok335x/3rdparty/install$ ls etc/
ts.conf
tavi@Tavi:~/ok335x/3rdparty/install$ ls bin/
iconv  ts_calibrate  ts_finddev  ts_harvest  ts_print  ts_print_mt  ts_print_raw  ts_test  ts_test_mt  ts_uinput  ts_verify
tavi@Tavi:~/ok335x/3rdparty/install$ ls lib/
charset.alias  libcharset.la  libcharset.so.1      libiconv.la  libiconv.so.2      libts.la  libts.so.0      pkgconfig                ts
libcharset.a   libcharset.so  libcharset.so.1.0.0  libiconv.so  libiconv.so.2.6.0  libts.so  libts.so.0.9.1  preloadable_libiconv.so
tavi@Tavi:~/ok335x/3rdparty/install$ ls include/
iconv.h  libcharset.h  localcharset.h  tslib.h

将以上的etc、lib、plugins、bin、share和include文件夹及所有内容全部打包压缩,拷贝到开发板当中。
其中bin文件里面是tslib的测试程序、lib为程序执行时需要的动态库、etc为tslib的模块配置。

注: 一般通过PC上的tftp软件,通过网线形成局域网进行传输

tftp 192.168.1.231 -g -r etc.tar.gz

配置完成后,更改开发板的环境变量,我的环境变量如下:

/opt/QT5.9_A8/tslib >: pwd
/opt/QT5.9_A8/tslib
/opt/QT5.9_A8/tslib >: vim /etc/profile 
# ~/.bashrc: executed by bash(1) for non-login interactive shells.

export PATH=\
/bin:\
/sbin:\
/usr/bin:\
/usr/sbin:\
/opt/QT5.9_A8/lib

export PS1='\w >: '

export USER=`id -un`
export LOGNAME=$USER
export HOSTNAME=`/bin/hostname`
export HISTSIZE=500
export HISTFILESIZE=500
export PAGER='/bin/more '
export EDITOR='/bin/vi'
export INPUTRC=/etc/inputrc
export network_cfg_dir=/apps/etc/network

### Some aliases
alias vim='vi'
alias ll='ls -l'
alias l.='ls -d .*'
alias df='df -h'

# QT configuration
export QTDIR=/opt/QT5.9_A8				//开发板上QT存放的路径
export QT_QPA_FONTDIR=$QTDIR/fonts		//还未移植fonts,这里写了但是没有该文件夹
export QT_QPA_PLATFORM_PLUGIN_PATH=$QTDIR/plugins/
export LD_LIBRARY_PATH=$QTDIR/lib:$QTDIR/tslib/lib:$LD_LIBRARY_PATH 
export QT_QPA_PLATFORM=linuxfb:fb=/dev/fb0:size=1024x600:mmSize=1024x600:offset=0x0:tty=/dev/tty1 

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/lib:/usr/lib
export PATH=$PATH:/opt/QT5.9_A8/tslib/lib

# Touch Screen configuration
export QT_QPA_GENERIC_PLUGINS=tslib
export TSLIB_FBDEVICE=/dev/fb0
export TSLIB_TSDEVICE=/dev/input/event0
export TSLIB_CALIBFILE=/etc/pointercal
export TSLIB_CONFFILE=$QTDIR/tslib/etc/ts.conf
export TSLIB_PLUGINDIR=$QTDIR/tslib/plugins
export QML2_IMPORT_PATH=$QTDIR/qml		//为了QT支持QML模块,没有用到可以不写

最后测试tslib移植是否完成,运行ts_calibrate校准程序,开发板能弹出该界面即可成功(这里把bin文件夹名称改为tests文件夹了)

/opt/QT5.9_A8/tslib >: ls
etc      include  lib      plugins  share    tests
/opt/QT5.9_A8/tslib >: cd tests/
/opt/QT5.9_A8/tslib/tests >: ls
iconv               ts_print_mt         ts_uinput_start.sh
ts_calibrate        ts_print_raw        ts_verify
ts_finddev          ts_test             ts_verify_ts.conf
ts_harvest          ts_test_mt
ts_print            ts_uinput
/opt/QT5.9_A8/tslib/tests >: ./ts_calibrate 

移植tslib的一些小问题:https://blog.csdn.net/Ternence_zq/article/details/109778136

官网下载QT:http://download.qt.io/archive/qt/5.9/5.9.8/single/qt-everywhere-opensource-src-5.9.8.tar.xz

QT移植

通过自己写的脚本build_QT5.sh一键编译安装

tavi@Tavi:~/ok335x/3rdparty/qt$ ls
build_QT5.sh  iconv  qt-everywhere-opensource-src-5.9.8  qt-everywhere-opensource-src-5.9.8.tar.xz  tslib
tavi@Tavi:~/ok335x/3rdparty/qt$ sudo ./build_QT5.sh 

因为在根文件系统新建了/app文件夹,所以要用sudo
编译出来的结果如下:

tavi@Tavi:/apps/QT5.9_A8$ ls
bin  doc  include  lib  mkspecs  plugins  qml  translations

将lib动态库、plugins插件、qml支持文件全部拷贝到开发板当中,同样可以通过tftp进行下载。

环境变量更改在tslib那部分展示的一样

/opt/QT5.9_A8 >: ls		//拷贝到开发板当中的文件(夹),tslib之前已拷贝
bin      lib      plugins  qml      tslib
/opt/QT5.9_A8 >: vim /etc/profile 

到次就完成了QT的移植了

测试: 可以在Ubuntu下新建测试文件,配置交叉编译器,生成可执行文件,拷贝到开发板上面运行即可。

QT图形化界面配置

关于QT creater安装与配置这个写的比较详细,可以参考该贴https://blog.csdn.net/vickycheung3/article/details/82182136

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值