diff --git a/bsp/nxp/imx/imx6ull-smart/README.md b/bsp/nxp/imx/imx6ull-smart/README.md index 29cfc83225..cd2e34abef 100644 --- a/bsp/nxp/imx/imx6ull-smart/README.md +++ b/bsp/nxp/imx/imx6ull-smart/README.md @@ -30,11 +30,14 @@ ART-pi smart采用了米尔科技的imx6ull核心板,硬件由韦东山团队 > * [x] xmake 构建环境 > * [x] busybox > * [x] smart-apps +> * [x] ash 支持ash开机自启动 +> * [x] emmc 从emmc启动内核、挂载文件系统 > > ### 待完善、修复 -> * [ ] ash 支持ash开机自启动 + > * [ ] 网络 以太网网络问题修复 -> * [ ] emmc 从emmc启动内核、挂载文件系统 +> * [ ] 信号 信号处理问题修复 + ## 应用编译 @@ -64,7 +67,7 @@ scons -j12 ## 启动内核 -* 从eMMC中加载运行(目前不推荐) +* 从eMMC中加载运行 ```bash bootcmd=fatload mmc 1:1 0x80001000 /kernel/rtthread.bin; dcache flush; go 0x80001000 @@ -78,8 +81,24 @@ dcache flush go 0x80001000 ``` -* 从sd卡启动 (目前推荐) +* 从sd卡启动 ```bash fatload mmc 0:1 0x80001000 rtthread.bin; dcache flush; go 0x80001000 ``` + +## 制作从emmc启动所用映像文件 + +* 在rt-thread/bsp/nxp/imx/imx6ull-smart/emmc下按照emmc.sh内容进行制作, + 生成物art-pi.img在rt-thread/bsp/nxp/imx/imx6ull-smart/emmc/image/images下 + +* 使用100ask_imx6ull_flashing_tool.exe工具进行烧写 + +* 工具获取https://github.com/100askTeam/gui_for_nxp_uuu/blob/master/100ask_imx6ull%E7%83%A7%E5%86%99%E5%B7%A5%E5%85%B7/100ask_imx6ull_flashing_tool.exe + +* 烧写说明: + + * 在烧写软件的基础版,点击更新uboot![alt text](image-1.png) + + * 在烧写软件的专业版,烧写制作的映像文件art-pi.img![alt text](image-2.png) + \ No newline at end of file diff --git a/bsp/nxp/imx/imx6ull-smart/applications/mnt.c b/bsp/nxp/imx/imx6ull-smart/applications/mnt.c index 7ff39c4a03..d1cb5083e2 100644 --- a/bsp/nxp/imx/imx6ull-smart/applications/mnt.c +++ b/bsp/nxp/imx/imx6ull-smart/applications/mnt.c @@ -20,6 +20,15 @@ int mnt_init(void) rt_thread_mdelay(500); int part_id = 0; + if (dfs_mount("emmc0", "/", "elm", 0, (void *)part_id) != 0) + { + rt_kprintf("Dir / emmc mount failed!\n"); + return -1; + } + else + { + rt_kprintf("emmc file system initialization done!\n"); + } if (dfs_mount("sd0", "/", "elm", 0, (void *)part_id) != 0) { diff --git a/bsp/nxp/imx/imx6ull-smart/emmc.sh b/bsp/nxp/imx/imx6ull-smart/emmc.sh new file mode 100644 index 0000000000..17ee1344fd --- /dev/null +++ b/bsp/nxp/imx/imx6ull-smart/emmc.sh @@ -0,0 +1,12 @@ +sudo mount ./boot.fat ./tmp/ +sudo rm -rf tmp/kernel/* +sudo cp -rp ../rtthread.bin tmp/kernel/ +sudo cp -rp ../rtthread.elf tmp/kernel/ +sudo cp -rp ../rtthread.img tmp/kernel/ +sudo cp -rp ../rtthread.imx tmp/kernel/ +sudo sync +sudo umount ./tmp +sudo cp boot.fat image/input/ +cd image +rm -rf tmp +./genimage \ No newline at end of file diff --git a/bsp/nxp/imx/imx6ull-smart/emmc/boot.fat b/bsp/nxp/imx/imx6ull-smart/emmc/boot.fat new file mode 100644 index 0000000000..79cc9cc8c0 Binary files /dev/null and b/bsp/nxp/imx/imx6ull-smart/emmc/boot.fat differ diff --git a/bsp/nxp/imx/imx6ull-smart/emmc/image/genimage b/bsp/nxp/imx/imx6ull-smart/emmc/image/genimage new file mode 100755 index 0000000000..7bc31fff91 Binary files /dev/null and b/bsp/nxp/imx/imx6ull-smart/emmc/image/genimage differ diff --git a/bsp/nxp/imx/imx6ull-smart/emmc/image/genimage.cfg b/bsp/nxp/imx/imx6ull-smart/emmc/image/genimage.cfg new file mode 100644 index 0000000000..2ad3faa2dd --- /dev/null +++ b/bsp/nxp/imx/imx6ull-smart/emmc/image/genimage.cfg @@ -0,0 +1,27 @@ +# Minimal SD card image for the Freescale boards Template +# +# We mimic the .sdcard Freescale's image format: +# * the SD card must have 1 kB free space at the beginning, +# * U-Boot is dumped as is, +# * a FAT partition at offset 8 MB is containing zImage/uImage and DTB files +# * a single root filesystem partition is required (ext2, ext3 or ext4) +# + + +image art-pi.img { + hdimage { + } + partition u-boot { + in-partition-table = "no" + image = "u-boot-dtb.imx" + offset = 1024 + size = 2M + } + + partition rootfs { + partition-type = 0xc + image = "boot.fat" + size = 200M + } + +} diff --git a/bsp/nxp/imx/imx6ull-smart/emmc/image/input/boot.fat b/bsp/nxp/imx/imx6ull-smart/emmc/image/input/boot.fat new file mode 100644 index 0000000000..79cc9cc8c0 Binary files /dev/null and b/bsp/nxp/imx/imx6ull-smart/emmc/image/input/boot.fat differ diff --git a/bsp/nxp/imx/imx6ull-smart/image-1.png b/bsp/nxp/imx/imx6ull-smart/image-1.png new file mode 100644 index 0000000000..889bfb4903 Binary files /dev/null and b/bsp/nxp/imx/imx6ull-smart/image-1.png differ diff --git a/bsp/nxp/imx/imx6ull-smart/image-2.png b/bsp/nxp/imx/imx6ull-smart/image-2.png new file mode 100644 index 0000000000..f8c2e1f742 Binary files /dev/null and b/bsp/nxp/imx/imx6ull-smart/image-2.png differ diff --git a/bsp/nxp/imx/imx6ull-smart/rtconfig.py b/bsp/nxp/imx/imx6ull-smart/rtconfig.py index 42f8483971..cb1d737b99 100644 --- a/bsp/nxp/imx/imx6ull-smart/rtconfig.py +++ b/bsp/nxp/imx/imx6ull-smart/rtconfig.py @@ -41,6 +41,7 @@ if PLATFORM == 'gcc': CFLAGS += ' -Os' CXXFLAGS += ' -Os' CXXFLAGS += ' -Woverloaded-virtual -fno-rtti' + MKIMAGE = '-t imximage -b rtthread.bin -o rtthread.imx -g rtthread.img -a 0x80001000' M_CFLAGS = CFLAGS + ' -mlong-calls -fPIC ' M_CXXFLAGS = CXXFLAGS + ' -mlong-calls -fPIC' @@ -49,4 +50,5 @@ if PLATFORM == 'gcc': M_POST_ACTION = STRIP + ' -R .hash $TARGET\n' + SIZE + ' $TARGET \n' DUMP_ACTION = OBJDUMP + ' -D -S $TARGET > rtt.asm\n' - POST_ACTION = OBJCPY + ' -O binary $TARGET rtthread.bin\n' + SIZE + ' $TARGET \n' + POST_ACTION = OBJCPY + ' -O binary $TARGET rtthread.bin\n' + SIZE + ' $TARGET \n' +\ + 'python3 mkimage.py ' + MKIMAGE + '\n'