i.MX6Q的qnx调试笔记---安装IDE和编写BSP,boot启动板子

来源:互联网 发布:怎么通过mac地址查ip 编辑:程序博客网 时间:2024/05/18 00:16

锋影

e-mail 174176320@qq.com


1、安装SDP

QNX_SDP分为Windows版和Linux版的,个人习惯Linux下开发,所以这里只记录Linux的安装。

开发环境:Ubuntu12.04-32bit

刚好有一个32位的Ubuntu系统,所以省略了安装32位库的步骤了,如果是64位的,还需要安装下面的32位的库文件


然后在 http://www.qnx.com/download/group.html?programid=26071 下载Linux的安装bin文件:qnx-sdp-6.6-nnnnnnnnnnnn.bin

点击运行,会出现图像安装界面,一直点下一步就好,到最后需要输入License Key。

安装成功后会出现一个:~/qnx660目录

其中包括什么编译工具,所需要的各个库文件,一个安装就全搞定了,只需要编译前运行下 :source~/qnx660/qnx660-env.sh

$ qconfigQNX Installations    Installation Name: QNX Software Development Platform 6.6              Version: 6.6.0       Base Directory: /home/my_userid/qnx660             QNX_HOST: /home/my_userid/qnx660/host/linux/x86           QNX_TARGET: /home/my_userid/qnx660/target/qnx6

输入qconfig进行检测,如果出现版本信息,说明安装成功了


2、BSP编译

在对BSP进行编译之前,先了解下QNX大致的软件结构。在启动过程中QNX和其他系统有一些区别,流程是:

芯片固化程序--->IPL(Initial Program Loader)--->启动程序(Startup)--->微内核和进程管理器(procnto)--->驱动和应用程序


IPL的始任务是对硬件进行最低配置(配置时钟,设置堆栈等),以创建一个环境,允许启动程序,进而使微内核运行。这部分的工作可以由QNX的BSP中自带的IPL源码来完成,也可以用uboot代替

②Startup的任务是拷贝镜像并解压,配置处理器和硬件,检测系统资源,并启动操作系统。这里的硬件处理并不包括像配置串口波特率,以太网和磁盘控制等,这些工作都是后面驱动自己完成的


源码目录下三大主分支,在定制自己的板卡时,需要修改最多的地方就这三个了。


QNX支持的板卡还是挺多的,可以在http://community.qnx.com/sf/wiki/do/viewPage/projects.bsp/wiki/BSPAndDrivers

选择和自己最接近的板卡BSP,这里选择   i.MX6Q SabreSmart


下载解压到工作目录 $ unzip bspname.zip

解压后目录结构如下:


①生成内核文件

在bsp_working_dir :

# source ~/qnx660/qnx660-env.sh# make

完事!生成好的二进制文件 ifs-mx6q-sabresmart.raw 就在 bsp_dir/images 中 


②生成IPL文件

# cd bsp_dir/images# ./mkflashimge

会在当前文件夹生成一个:ipl-mx6q-sabresmart.bin


3、启动板子

①将板子设置成SD卡启动,按下面流程格式化一张SD卡

8. Build a new DOS disk label:$ sudo fdisk /dev/sdd
Command (m for help): uChanging display/entry units to cylinders (DEPPRECATED!)
Command (m for help): oBuilding a new DOS disklabel with disk identifier 0xcdd1b702.Changes will remain in memory only, until you decide to writethem.After that, of course, the previous content won't be recoverable.Warning: invalid flag 0x0000 of partition table 4 will becorrected by write.WARNING: cylinders as display units are deprecated. Use command'u' to change units to sectors.
Command (m for help): dSelected partition 1
9. Remove the existing partitions. Keep entering the d command until no partitionsare left:Command (m for help): d
No partition is defined yet!10. Create a new partition:Command (m for help): nPartition type:p primary (0 primary, 0 extended, 4 free)e extended
11. Set the partition as the primary partition:Select (default p): pPartition number (1-4, default 1): 1First cylinder (1-240, default 1): 1Last cylinder, (100-240, default 240): <ENTER>Using default value 240© 2015, QNX Software Systems Limited 17Building and installing the BSP
12. Set the active partition:
Command (m for help): aPartition number (1-4): 1
13. Set the partition type:Command (m for help): tSelected partition 1Hex code (type L to list codes): cChanged system type of partition 1 to c (W95 FAT32 (LBA))14. Write the changes:Command (m for help): wThe partition table has been altered!Calling ioctl() to re-read partition table.Syncing disks.
15. Format the SD card. Note that the number 1 at the end of the mountpoint mustbe included:$ sudo mkfs.vfat /dev/sdd1mkfs.msdos 3.0.12 (29 Oct 2011)$


②将IPL拷贝到SD中

$ sudo dd if=ipl-mx6q-sabresmart.bin of=/dev/sdd bs=512 seek=2 skip=437+1 records in37+1 records out19268 bytes (19 KB) copied, 0.0178466s, 1.1 MB/s$ sync


③将IFS拷贝到SD中

$ mount  /dev/sdx1  /media/074B-DAC7$ mv ifs-mx6q-sabresmart.raw  QNX-IFS$ cp QNX-IFS /media/074B-DAC7$ sync


这里需要将编译好的 ifs-xxx-xxx.raw 更名为 QNX-IFS,因为IPL已经设置了读取的镜像文件名称为:QNX-IFS


④上电启动

Welcome to QNX Neutrino Initial Program Loader for Freescale i.MX6Q Sabre-Smart (ARM Cortex-A9 MPCore)SDMMC download...load image done.Found image               @ 0x18000008Jumping to startup        @ 0x108068F8SCU_CONFIG = 00005503, 4 cpusL2 cache enabledCPU0: L1 Icache: 1024x32CPU0: L1 Dcache: 1024x32 WBCPU0: VFP-d32 FPSID=41033094CPU0: NEON MVFR0=10110222 MVFR1=01111111CPU0: 412fc09a: Cortex A9 MPCore rev 10 792MHzDetected i.MX6 Dual/Quad, revision Unknown RevisionPLL1 - System     : 792MHzPLL2 - System Bus : 528MHzPLL3 - OTG USB    : 480MHzPLL4 - Audio      : 36MHzPLL5 - Video      : 339MHzPLL7 - Host USB   : 480MHzPLL8 - Enet       : 50MHzIPG clock     : 66000000HzIPG per clock : 66000000HzUART clock    : 80000000HzCSPI clock    : 60000000HzAHB clock     : 132000000HzAXI clock     : 264000000HzEMI_SLOW clock: 29333333HzDDR clock     : 528000000HzUSDHC1 clock  : 198000000HzUSDHC2 clock  : 198000000HzUSDHC3 clock  : 198000000HzUSDHC4 clock  : 198000000HzENFC clock    : 24000000Hzdecompressing...doneCPU1: L1 Icache: 1024x32CPU1: L1 Dcache: 1024x32 WBCPU1: VFP-d32 FPSID=41033094CPU1: NEON MVFR0=10110222 MVFR1=01111111CPU1: 412fc09a: Cortex A9 MPCore rev 10 792MHzCPU2: L1 Icache: 1024x32CPU2: L1 Dcache: 1024x32 WBCPU2: VFP-d32 FPSID=41033094CPU2: NEON MVFR0=10110222 MVFR1=01111111CPU2: 412fc09a: Cortex A9 MPCore rev 10 792MHzCPU3: L1 Icache: 1024x32CPU3: L1 Dcache: 1024x32 WBCPU3: VFP-d32 FPSID=41033094CPU3: NEON MVFR0=10110222 MVFR1=01111111CPU3: 412fc09a: Cortex A9 MPCore rev 10 792MHzcpu_startnext: cpu1 -> fc411d58cpu_startnext: cpu2 -> fc411d58cpu_startnext: cpu3 -> fc411d58System page at phys:10023000 user:fc410000 kern:fc410000Starting next program at vfe054e3ccpu_startnext: cpu0 -> fe054e3cWelcome to QNX Neutrino 6.6.0 on the i.mx6 Smart-Device (ARM Cortex-A9 MPCore)Starting watchdog... Starting I2C1,2,3 driver (/dev/i2c1,2,3)...Starting SD3 memory card driver...Starting SD2 (microSD connector) memory card driver...Unable to access "/dev/sd20" (2)Starting Emmc Nand Flash driverStarting USB host 1 OTG driver (host mode)Starting Ethernet driversetting env variables.Starting Screen Graphics...Mempool Map addr range[28000000-2c600000]Mempool Map paddr range[4b100000-4f700000][Interrupt] Attached irqLine 41 with id 13.[Interrupt] Attached irqLine 42 with id 14.Attached resmgr to /dev/galcore with id:0.Memory fault done.Launching devb-umass...done# # 

阅读全文
0 0