|
@@ -1,107 +1,96 @@
|
|
|
-# Raspberry PI 3B(32位)板级支持包说明
|
|
|
+# Raspberry PI 3B 32 BSP (Board Support Package) Execution Instruction
|
|
|
|
|
|
-## 1. 简介
|
|
|
+[中文页](README_zh.md) |
|
|
|
|
|
|
-树莓派由注册于英国的慈善组织“Raspberry Pi 基金会”开发,莓派3采用4核Broadcom BCM2837 (ARMv8)芯片、双核VideoCore IV GPU和1GB内存。
|
|
|
+## Introduction
|
|
|
|
|
|
-这份RT-Thread BSP是针对 Raspberry Pi 3B (32位)的一份移植,树莓派价格便宜, 使用者甚众,是研究和运行RT-Thread的可选平台之一。
|
|
|
+This document records the execution instruction of the BSP (board support package) provided by the RT-Thread development team for the Raspberry PI 3B 32 development board.
|
|
|
|
|
|
-随着RT-Thread的发展,它越来越多的向一些Cortex-A等AP类处理器提供支持,例如全志的ARM9、Cortex-A处理器,Xilinx的Zynq处理器等。
|
|
|
+[](https://github.com/RT-Thread/rt-thread/blob/master/bsp/raspberry-pi/raspi3-32/figures/raspi3_f.jpg)
|
|
|
|
|
|
-而RT-Thread也是一套高度社区化发展的操作系统,所以在一些方向推进上希望以社区化方式,大家一起来推动的方式向前发展,在这个过程中RT-Thread得到了不同开发者、不同领域的应用,一步步把RT-Thread推向成熟。而在Cortex-A平台上,目前最流行的硬件平台是树莓派,分树莓派[2B](https://www.raspberrypi.org/products/raspberry-pi-2-model-b/)、[3B](https://www.raspberrypi.org/products/raspberry-pi-3-model-b/)以及最新的[4B](https://www.raspberrypi.org/products/raspberry-pi-4-model-b/)等。
|
|
|
+[](https://github.com/RT-Thread/rt-thread/blob/master/bsp/raspberry-pi/raspi3-32/figures/raspi3_b.jpg)
|
|
|
|
|
|
-RT-Thread对树莓派的支持主要从树莓派2B开始,它是一个四核Cortex-A7的平台,以32位单核的模式运行。后续将推动着RT-Thread向树莓派3,四核Cortex-A53 64位模式发展(中间当然也可能出现四核Cortex-A7模式执行的过渡性版本)。
|
|
|
+## Hardware Features
|
|
|
|
|
|
-
|
|
|
+| Hardware | Description |
|
|
|
+| -------------- | ----------------------------------------- |
|
|
|
+| CPU | quad-core ARM Cortex A53(ARMv8) |
|
|
|
+| Main Frequency | 1.2 GHz |
|
|
|
+| GPU | VideoCore IV |
|
|
|
+| GPU Frequency | 400MHz |
|
|
|
+| Memory | 1GB (0x0000000 - 0x40000000) |
|
|
|
+| | 0x3f000000 - 0x40000000 is for peripheral |
|
|
|
|
|
|
-
|
|
|
+**The description of functional pins is as shown as follow:**
|
|
|
|
|
|
-当前Raspberry Pi 3B对应的硬件特性:
|
|
|
+[](https://github.com/RT-Thread/rt-thread/blob/master/bsp/raspberry-pi/raspi3-32/figures/GPIO-Pinout-Diagram-2.png)
|
|
|
|
|
|
-| 硬件 | 描述 |
|
|
|
-|------- | ------------------------------- |
|
|
|
-| CPU | quad-core ARM Cortex A53(ARMv8) |
|
|
|
-| 主频 | 1.2 GHz |
|
|
|
-| GPU | VideoCore IV |
|
|
|
-| GPU频率 | 400MHz |
|
|
|
-| Memory | 1GB (0x0000000 - 0x40000000) |
|
|
|
-| | 其中0x3f000000 - 0x40000000为peripheral |
|
|
|
+## **Compilation Instruction**
|
|
|
|
|
|
-硬件引脚分布情况
|
|
|
+The [env](https://www.rt-thread.io/download.html?download=Env) tool is recommended for compiling in Windows environments.
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-## 2. 编译说明
|
|
|
-
|
|
|
-Windows环境下推荐使用[env工具][1]进行编译。
|
|
|
-
|
|
|
-Linux下推荐使用gcc工具 gcc-arm-none-eabi-5_4-2016q3,如果还没有编译工具,下载后,解开文件。
|
|
|
+The cross-compiler gcc-arm-none-eabi-4_8-2014q1_linux is recommended in Linux environment. If you don’t have compiling tool, please uncompress the downloaded package like this:
|
|
|
|
|
|
```
|
|
|
-tar vxf gcc-arm-none-eabi-5_4-2016q3-20160926-linux.tar.bz2
|
|
|
+tar vxf gcc-arm-none-eabi-4_8-2014q1_linux.tar.bz2
|
|
|
```
|
|
|
|
|
|
-Linux环境下需要修改编译器目录设置,修改`bsp/raspi3-32/rtconfig.py`中的
|
|
|
+In Linux environment, you need to modify the settings of the compiler directory, and modify the actual directory of the compiling tool in bsp/raspi3-32/rtconfig. py, remember to add the suffix /bin here.
|
|
|
|
|
|
```
|
|
|
-EXEC_PATH = r'/opt/gcc-arm-none-eabi-5_4-2016q3/bin'
|
|
|
+EXEC_PATH = r'/opt/gcc-arm-none-eabi-4_8-2014q1_gri/bin'
|
|
|
```
|
|
|
|
|
|
-为编译工具的实际所在目录,这里注意要加上后缀 `/bin`
|
|
|
-
|
|
|
-进入到`rt-thread/bsp/raspi3-32`目录中,运行以下命令:
|
|
|
+Enter the rt-thread/bsp/raspi3-32 directory and run the following command to compile this BSP:
|
|
|
|
|
|
```
|
|
|
scons
|
|
|
```
|
|
|
|
|
|
-来编译这个板级支持包。如果编译正确无误,会产生rtthread.elf、kernel7.img文件。
|
|
|
-kernel7.img即是要cp到raspberry SD卡中根目录的文件
|
|
|
+If everything goes well, a new 'rtthread.elf' and 'kernel7.img' file will be generated. ‘kernel7.img' is what we need to put into the root directory of the Raspberry PI 3B SD card.
|
|
|
|
|
|
-### 2.1 eclipse 编码环境 ###
|
|
|
-第一步: 安装 eclipse cdt
|
|
|
-第二步: 打开 eclipse cdt 设置workspace ,推荐设置于xxx\xxx\rt-thread\bsp
|
|
|
-第三步: Import 工程 General-> Existing Peojects into Workspace 然后 Browse.. 你的raspi3目录,点击Finish
|
|
|
+### **Eclipse compiling environment**
|
|
|
|
|
|
-btw:编译依旧使用scons,目前不支持qemu debug,后期如果有大佬实现ARM JTAG调试
|
|
|
+- Step 1: Install the eclipse plugin 'cdt'.
|
|
|
+- Step 2: Open eclipse cdt and set workspace, and set the workspace to 'rt-thread/bsp/raspberry-pi/raspi3-32'.
|
|
|
+- Step 3: Import the project by selecting 'General->Existing Projects into Workspace' and then 'Browse ...'. Noted that the compiling only supports scons now.
|
|
|
+
|
|
|
|
|
|
-## 3. 执行
|
|
|
+## **Running**
|
|
|
|
|
|
-### 3.1 下载[raspbian镜像][3],生成可以运行的raspbian SD卡
|
|
|
+### **Prepare the [Raspbian](https://downloads.raspberrypi.org/raspbian_lite_latest) SD card**
|
|
|
|
|
|
-Windows下,去[etcher.io][4]下载etcher,这是个可以烧写img的工具
|
|
|
+Download the raspbian image, for example, "2018-06-27-raspbian-stretch-lite.zip". Unpack it.
|
|
|
|
|
|
-解开下载的镜像文件, linux下使用如下的命令
|
|
|
+**Burn the SD card on Windows**
|
|
|
|
|
|
-```
|
|
|
-unzip 2018-06-27-raspbian-stretch-lite.zip
|
|
|
-```
|
|
|
+On Windows, download the burning tool " [etcher.io](https://www.balena.io/etcher/) ", run it and choose the unpacked image "2018-06-27-raspbian-stretch-lite.img".
|
|
|
|
|
|
-准备一张空SD卡,linux环境下,插入电脑并执行
|
|
|
+When the burning process is completed, put "kernel8.img" into the boot partition to replace the file wit the same name.
|
|
|
|
|
|
-```
|
|
|
-sudo dd if=2018-06-27-raspbian-stretch-lite.img of=/dev/xxx bs=32M conv=fsync
|
|
|
-```
|
|
|
+**Burn the SD card on Linux**
|
|
|
+
|
|
|
+Prepare an empty SD card, plug it in the computer and then execute the command below:
|
|
|
|
|
|
-**注意: /dev/xxx 要换成真实环境中的SD卡所在设置,千万不要弄错。**
|
|
|
+"sudo dd if=2018-06-27-raspbian-stretch-lite.img of=/dev/xxx bs=32M conv=fsync"
|
|
|
|
|
|
-Windows环境下,执行etcher选择解压后的2018-06-27-raspbian-stretch-lite.img文件和SD卡就可以开始烧写了。
|
|
|
+Note that the device file "/dev/xxx" should be replaced with the real SD card.
|
|
|
|
|
|
-最后把kernel7.img放入SD boot分区,覆盖原来的文件。
|
|
|
+### **Prepare the serial port wire**
|
|
|
|
|
|
-### 3.2 准备好串口线
|
|
|
+The BSP uses GPIO 14 & GPIO 15 of raspi 3 as the communication ports, as shown in the following image:
|
|
|
|
|
|
-目前版本是使用raspi3的 GPIO 14, GPIO 15来作路口输出,连线情况如下图所示:
|
|
|
|
|
|
|
|
|
+[](https://github.com/RT-Thread/rt-thread/blob/master/bsp/raspberry-pi/raspi3-32/figures/raspberrypi-console.png)
|
|
|
|
|
|
-
|
|
|
+The serial port parameters: 115200 8N1, hardware and software flow control is off.
|
|
|
|
|
|
-串口参数: 115200 8N1 ,硬件和软件流控为关。
|
|
|
+## **Running Result**
|
|
|
|
|
|
-按上面的方法做好SD卡后,插入树莓派3B,通电可以在串口上看到如下所示的输出信息:
|
|
|
+Insert the burned SD card into Raspberry Pi, power up, the output information on the serial port should be like this:
|
|
|
|
|
|
-```text
|
|
|
+```
|
|
|
heap: 0x0005d784 - 0x0045d784
|
|
|
|
|
|
\ | /
|
|
@@ -131,23 +120,14 @@ Hello RT-Thread!
|
|
|
msh />
|
|
|
```
|
|
|
|
|
|
-## 4. 支持情况
|
|
|
-
|
|
|
-| 驱动 | 支持情况 | 备注 |
|
|
|
-| ------ | ---- | :------: |
|
|
|
-| UART | 支持 | UART0|
|
|
|
-| GPIO | 支持 | |
|
|
|
-| IIC | 支持 | |
|
|
|
-| SPI | 支持 | |
|
|
|
-| CPU Timer | 支持 | |
|
|
|
-| SD卡驱动 | 支持 | |
|
|
|
-
|
|
|
-## 5. 联系人信息
|
|
|
+## **Peripheral Condition**
|
|
|
|
|
|
-维护人:[bernard][5]
|
|
|
+| Drive | Support | Remark |
|
|
|
+| -------------- | ------- | ------ |
|
|
|
+| UART | Support | UART0 |
|
|
|
+| GPIO | Support | |
|
|
|
+| IIC | Support | |
|
|
|
+| SPI | Support | |
|
|
|
+| CPU Timer | Support | |
|
|
|
+| SD card driver | Support | |
|
|
|
|
|
|
-[1]: https://www.rt-thread.org/page/download.html
|
|
|
-[2]: https://launchpad.net/gcc-arm-embedded/4.8/4.8-2014-q1-update/+download/gcc-arm-none-eabi-4_8-2014q1-20140314-linux.tar.bz2
|
|
|
-[3]: https://downloads.raspberrypi.org/raspbian_lite_latest
|
|
|
-[4]: https://etcher.io
|
|
|
-[5]: https://github.com/BernardXiong
|