Skip to content

Commit 89164b1

Browse files
authored
fix art-pi smart boot from emmc (#8904)
* fix art-pi smart boot from emmc * fix art-pi smart boot from emmc * fix art-pi smart boot from emmc
1 parent a7a8c59 commit 89164b1

File tree

10 files changed

+74
-5
lines changed

10 files changed

+74
-5
lines changed

bsp/nxp/imx/imx6ull-smart/README.md

+23-4
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,14 @@ ART-pi smart采用了米尔科技的imx6ull核心板,硬件由韦东山团队
3030
> * [x] xmake 构建环境
3131
> * [x] busybox
3232
> * [x] smart-apps
33+
> * [x] ash 支持ash开机自启动
34+
> * [x] emmc 从emmc启动内核、挂载文件系统
3335
>
3436
> ### 待完善、修复
35-
> * [ ] ash 支持ash开机自启动
37+
3638
> * [ ] 网络 以太网网络问题修复
37-
> * [ ] emmc 从emmc启动内核、挂载文件系统
39+
> * [ ] 信号 信号处理问题修复
40+
3841

3942
## 应用编译
4043

@@ -64,7 +67,7 @@ scons -j12
6467

6568
## 启动内核
6669

67-
* 从eMMC中加载运行(目前不推荐)
70+
* 从eMMC中加载运行
6871

6972
```bash
7073
bootcmd=fatload mmc 1:1 0x80001000 /kernel/rtthread.bin; dcache flush; go 0x80001000
@@ -78,8 +81,24 @@ dcache flush
7881
go 0x80001000
7982
```
8083

81-
* 从sd卡启动 (目前推荐)
84+
* 从sd卡启动
8285

8386
```bash
8487
fatload mmc 0:1 0x80001000 rtthread.bin; dcache flush; go 0x80001000
8588
```
89+
90+
## 制作从emmc启动所用映像文件
91+
92+
* 在rt-thread/bsp/nxp/imx/imx6ull-smart/emmc下按照emmc.sh内容进行制作,
93+
生成物art-pi.img在rt-thread/bsp/nxp/imx/imx6ull-smart/emmc/image/images下
94+
95+
* 使用100ask_imx6ull_flashing_tool.exe工具进行烧写
96+
97+
* 工具获取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
98+
99+
* 烧写说明:
100+
101+
* 在烧写软件的基础版,点击更新uboot![alt text](image-1.png)
102+
103+
* 在烧写软件的专业版,烧写制作的映像文件art-pi.img![alt text](image-2.png)
104+

bsp/nxp/imx/imx6ull-smart/applications/mnt.c

+9
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,15 @@ int mnt_init(void)
2020
rt_thread_mdelay(500);
2121

2222
int part_id = 0;
23+
if (dfs_mount("emmc0", "/", "elm", 0, (void *)part_id) != 0)
24+
{
25+
rt_kprintf("Dir / emmc mount failed!\n");
26+
return -1;
27+
}
28+
else
29+
{
30+
rt_kprintf("emmc file system initialization done!\n");
31+
}
2332

2433
if (dfs_mount("sd0", "/", "elm", 0, (void *)part_id) != 0)
2534
{

bsp/nxp/imx/imx6ull-smart/emmc.sh

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
sudo mount ./boot.fat ./tmp/
2+
sudo rm -rf tmp/kernel/*
3+
sudo cp -rp ../rtthread.bin tmp/kernel/
4+
sudo cp -rp ../rtthread.elf tmp/kernel/
5+
sudo cp -rp ../rtthread.img tmp/kernel/
6+
sudo cp -rp ../rtthread.imx tmp/kernel/
7+
sudo sync
8+
sudo umount ./tmp
9+
sudo cp boot.fat image/input/
10+
cd image
11+
rm -rf tmp
12+
./genimage
100 MB
Binary file not shown.
92.8 KB
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Minimal SD card image for the Freescale boards Template
2+
#
3+
# We mimic the .sdcard Freescale's image format:
4+
# * the SD card must have 1 kB free space at the beginning,
5+
# * U-Boot is dumped as is,
6+
# * a FAT partition at offset 8 MB is containing zImage/uImage and DTB files
7+
# * a single root filesystem partition is required (ext2, ext3 or ext4)
8+
#
9+
10+
11+
image art-pi.img {
12+
hdimage {
13+
}
14+
partition u-boot {
15+
in-partition-table = "no"
16+
image = "u-boot-dtb.imx"
17+
offset = 1024
18+
size = 2M
19+
}
20+
21+
partition rootfs {
22+
partition-type = 0xc
23+
image = "boot.fat"
24+
size = 200M
25+
}
26+
27+
}
Binary file not shown.

bsp/nxp/imx/imx6ull-smart/image-1.png

78.2 KB
Loading

bsp/nxp/imx/imx6ull-smart/image-2.png

74.2 KB
Loading

bsp/nxp/imx/imx6ull-smart/rtconfig.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
CFLAGS += ' -Os'
4242
CXXFLAGS += ' -Os'
4343
CXXFLAGS += ' -Woverloaded-virtual -fno-rtti'
44+
MKIMAGE = '-t imximage -b rtthread.bin -o rtthread.imx -g rtthread.img -a 0x80001000'
4445

4546
M_CFLAGS = CFLAGS + ' -mlong-calls -fPIC '
4647
M_CXXFLAGS = CXXFLAGS + ' -mlong-calls -fPIC'
@@ -49,4 +50,5 @@
4950
M_POST_ACTION = STRIP + ' -R .hash $TARGET\n' + SIZE + ' $TARGET \n'
5051

5152
DUMP_ACTION = OBJDUMP + ' -D -S $TARGET > rtt.asm\n'
52-
POST_ACTION = OBJCPY + ' -O binary $TARGET rtthread.bin\n' + SIZE + ' $TARGET \n'
53+
POST_ACTION = OBJCPY + ' -O binary $TARGET rtthread.bin\n' + SIZE + ' $TARGET \n' +\
54+
'python3 mkimage.py ' + MKIMAGE + '\n'

0 commit comments

Comments
 (0)