Author Topic: Unitizing RT-Thread BSP on Raspberry PI 3B(32 bites) Board  (Read 921 times)

0 Members and 1 Guest are viewing this topic.

Offline Peter9090Topic starter

  • Contributor
  • Posts: 11
  • Country: au
Unitizing RT-Thread BSP on Raspberry PI 3B(32 bites) Board
« on: January 22, 2020, 03:12:36 am »
This BSP was created by RT-Thread Community contributor.
Hardware Features of Raspberry Pi 3B:

Hardware                    Description
CPU                            quad-core ARM Cortex A53(ARMv8)
Frequency                    1.2 GHz
GPU                            VideoCore IV
GPU Frequency            400MHz
Memory                    1GB (0x0000000 - 0x40000000)
                            0x3f000000 - 0x40000000 is peripheral

Hardware pin distribution, shown as follow:


1. Compiling Process
The env tool is recommended for compiling in Windows environments.
The  gcc-arm-none-eabi-4_8-2014q1_linux is recommended under Linux, and if the tool is not compiled, unzip the file after downloading.

Code: [Select]
tar vxf gcc-arm-none-eabi-4_8-2014q1_linux.tar.bz2
In the Linux environment, you need to modify the compiler directory settings, modify the actual directory of the compiling tool in bsp/raspi3-32/rtconfig.py, note to add the suffix /bin here.

Code: [Select]
EXEC_PATH = r'/opt/gcc-arm-none-eabi-4_8-2014q1_gri/bin'
Enter the rt-thread/bsp/raspi3-32 directory and run the following command to compile this BSP:

Code: [Select]
scons
If compiled correctly, a rtthread.elf, kernel7.img file is generated. kernel7.img is the file that is going to cp to the root directory of the raspberry SD card.

1.1 eclipse compiling environment
Step 1: Install eclipse cdt
Step 2: Open eclipse cdt and set workspace, set it as xxx\xxx\rt-thread\bsp is recommended. 
Step 3: Import project General-Existing Peojects into Workspace , and then browse Your raspi3 directory, click Finish.
However compiling still uses scons, currently does not support qemu debug.
2. Execution
2.1 Download the raspbian mirroring to generate a running raspbian SD card
Under Windows, find etcher.io and download etcher, it is a tool that can burn img
Unzip the downloaded mirroring file, and use the following command under linux:
Code: [Select]
unzip 2018-06-27-raspbian-stretch-lite.zip
Prepare an empty SD card, plug in the computer and execute under linux environment
Code: [Select]
sudo dd if=2018-06-27-raspbian-stretch-lite.img of=/dev/xxx bs=32M conv=fsync
Note: /dev/xxx SD card settings should be change into a real environment, don’t forget this.
In the Windows environment, executed the unzipped file of etcher 2018-06-27-raspbian-stretch-lighte.img and SD card, you can start burning.
Finally, put kernel7.img into the SD boot partition and overwrite the original file.

2.2 Prepare the serial port line
The current version uses the GPIO 14 and GPIO 15 of raspi3 and as the junction output, as shown in the following figure:


Serial port parameters: 115200 8N1, hardware and software flow control is off.
After conducting the SD card according to the above method, insert the Raspberry Pi 3B and power it up, you can see the output information on the serial port, which is shown as follow:

Code: [Select]
heap: 0x0005d784 - 0x0045d784

 \ | /
- RT -     Thread Operating System
 / | \     4.0.2 build Jan  9 2020
 2006 - 2019 Copyright by rt-thread team
[I/I2C] I2C bus [i2c0] registered
[I/I2C] I2C bus [i2c1] registered
[I/SDIO] SD card capacity 15558144 KB.
found part[0], begin: 1048576, size: 63.0MB
found part[1], begin: 67108864, size: 14.793GB
file system initialization done!
boot cpu:3
msh />cpu = 0x00000003
cpu 3 startup.
start OK: CPU 3
boot cpu:2
cpu = 0x00000002
cpu 2 startup.
start OK: CPU 2
boot cpu:1
cpu = 0x00000001
cpu 1 startup.
start OK: CPU 1
Hello RT-Thread!

msh />

3. Supporting Status

Driver       Supporting Status         Remark
UART       Support                         UART0
GPIO        Support   
IIC               Support   
SPI               Support   
CPU Timer       Support   


If you have any questions you can reach out at https://github.com/RT-Thread/rt-thread/tree/master/bsp/raspberry-pi/raspi3-32
And for more information about RT-Thread, refer to https://github.com/RT-Thread

 

Offline Peter9090Topic starter

  • Contributor
  • Posts: 11
  • Country: au
Re: Unitizing RT-Thread BSP on Raspberry PI 3B(32 bites) Board
« Reply #1 on: January 22, 2020, 03:17:09 am »

Hardware pin distribution, shown as follow:
 

Offline Peter9090Topic starter

  • Contributor
  • Posts: 11
  • Country: au
Re: Unitizing RT-Thread BSP on Raspberry PI 3B(32 bites) Board
« Reply #2 on: January 22, 2020, 03:18:15 am »

The current version uses the GPIO 14 and GPIO 15 of raspi3 and as the junction output, as shown in the following figure:
 

Offline Peter9090Topic starter

  • Contributor
  • Posts: 11
  • Country: au
Re: Unitizing RT-Thread BSP on Raspberry PI 3B(32 bites) Board
« Reply #3 on: February 03, 2020, 06:08:33 am »
BSP is Board Support Package. And it is necessary when it comes to a RTOS(Real-time operating system)
RT-Thread is an open source real-time operating system, if we wanna port RT-Thread or any of the RTOSs into a board, let's say Raspberry PI 3B board, it needs a connection, and BSP is kind of connection between the board and the RTOS. Most of the cases are you need to create this BSP by yourself if you wanna port the RTOS, but RT-Thread and its community already created the BSP for different board, you can just take and use. This is the point why I would share this post.

For more information, you could check wikipedia: https://en.wikipedia.org/wiki/Board_support_package
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf