Skip to content

Commit c85946b

Browse files
committed
update readme
1 parent 74812c0 commit c85946b

File tree

1 file changed

+83
-22
lines changed

1 file changed

+83
-22
lines changed

bsp/raspberry-pi/raspi4-32/README.md

Lines changed: 83 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -20,45 +20,99 @@ scons
2020
来编译这个板级支持包。如果编译正确无误,会产生rtthread.elf、kernel7.img文件。
2121

2222

23-
## 3. 执行
23+
## 3. 环境搭建
24+
### 3.1 准备好串口线
2425

25-
### 3.1 下载**Raspberry Pi Imager**,生成可以运行的raspbian SD卡
26+
目前版本是使用raspi4的 GPIO 14, GPIO 15来作路口输出,连线情况如下图所示:
2627

27-
首先下载镜像
28+
![raspi2](../raspi3-32/figures/raspberrypi-console.png)
2829

29-
* [Raspberry Pi Imager for Ubuntu](https://downloads.raspberrypi.org/imager/imager_amd64.deb)
30-
* [Raspberry Pi Imager for Windows](https://downloads.raspberrypi.org/imager/imager.exe)
31-
* [Raspberry Pi Imager for macOS](https://downloads.raspberrypi.org/imager/imager.dmg)
30+
串口参数: 115200 8N1 ,硬件和软件流控为关。
3231

33-
### 3.2 准备好串口线
32+
### 3.2 RTT固件放在SD卡运行
3433

35-
目前版本是使用raspi4的 GPIO 14, GPIO 15来作路口输出,连线情况如下图所示:
34+
首先需要准备一张空的32GB以下的SD卡,如果不想自己制作启动固件,可以直接从百度网盘上下载boot的固件。
3635

37-
![raspi2](../raspi3-32/figures/raspberrypi-console.png)
36+
```
37+
链接:https://pan.baidu.com/s/1PxgvXAChUIOgueNXhgMs8w
38+
提取码:pioj
39+
```
3840

39-
串口参数: 115200 8N1 ,硬件和软件流控为关。
41+
解压后将sd目录下的文件拷贝到sd卡即可。以后每次编译后,将生成的kernel7.img进行替换即可。上电后可以看到程序正常运行。
42+
43+
### 3.3 RTT程序用uboot加载
4044

41-
### 3.3 程序下载
45+
为了调试方便,已经将uboot引导程序放入uboot目录下,直接将这些文件放到sd卡中即可。
4246

43-
当编译生成了rtthread.bin文件后,我们可以将该文件放到sd卡上,并修改sd卡中的`config.txt`文件如下:
47+
需要注意的以下步骤:
48+
49+
**1.电脑上启动tftp服务器**
50+
51+
windows系统电脑上可以安装tftpd搭建tftp服务器。将目录指定到`bsp\raspberry-pi\raspi4-32`
52+
53+
**2.修改设置uboot**
54+
55+
在控制台输入下列命令:
4456

4557
```
46-
enable_uart=1
47-
arm_64bit=0
48-
kernel_addr=0x8000
49-
kernel=kernel7.img
50-
core_freq=250
58+
setenv bootcmd "dhcp 0x00200000 x.x.x.x:kernel7.img;dcache flush;go 0x00200000"
59+
saveenv
60+
reset
5161
```
5262

53-
按上面的方法做好SD卡后,插入树莓派4,通电可以在串口上看到如下所示的输出信息:
63+
其中`x.x.x.x`为tftp服务器的pc的ip地址。
5464

55-
```text
56-
heap: 0x00044270 - 0x04044270
65+
**3.修改链接脚本**
66+
67+
将树莓派`bsp\raspberry-pi\raspi4-32\link.ld`的文件链接地址改为`0x200000`
68+
69+
```
70+
SECTIONS
71+
{
72+
. = 0x8000;
73+
. = ALIGN(4096);
74+
.
75+
.
76+
.
77+
}
78+
```
79+
80+
改为
81+
82+
```
83+
SECTIONS
84+
{
85+
. = 0x200000;
86+
. = ALIGN(4096);
87+
.
88+
.
89+
.
90+
}
91+
```
92+
93+
重新编译程序:
94+
95+
```
96+
scons -c
97+
scons
98+
```
99+
100+
**3.插入网线**
101+
102+
上述准备完成后,将网线插入,保证开发板和tftp服务器在同一个网段的路由器上。上电后uboot可以自动从tftp服务器上获取固件,然后开始执行了。
103+
104+
完成后可以看到串口的输出信息
105+
106+
```
107+
heap: 0x000607e8 - 0x040607e8
57108
58109
\ | /
59110
- RT - Thread Operating System
60-
/ | \ 4.0.3 build May 25 2020
111+
/ | \ 4.0.3 build Oct 27 2020
61112
2006 - 2020 Copyright by rt-thread team
113+
[I/SDIO] SD card capacity 31205376 KB.
114+
found part[0], begin: 1048576, size: 29.777GB
115+
file system initialization done!
62116
Hi, this is RT-Thread!!
63117
msh />
64118
```
@@ -71,8 +125,15 @@ msh />
71125
| GPIO | 支持 | - |
72126
| SPI | 支持 | SPI0 |
73127
| MAILBOX | 支持 | - |
128+
| WATCHDOG | 支持 | - |
129+
| HDMI | 支持 | - |
130+
| SDIO | 支持 | - |
131+
132+
## 5. 注意事项
133+
134+
目前rt-thread程序可以使用的内存在100MB以内,可以通过调整`board.c``platform_mem_desc`表的数据进行相关内存的映射以及修改`board.h`来确定程序使用的堆栈大小。目前在地址`0x08000000`处的1M空间被映射成非cache区供树莓派4的CPU与GPU通信的消息管道。若需要扩大系统内存使用,可自行修改代码进行调整。
74135

75-
## 5. 联系人信息
136+
## 6. 联系人信息
76137

77138
维护人:[bernard][5]
78139

0 commit comments

Comments
 (0)