Unitizing RT-Thread BSP on Raspberry PI 3B(32 bites) Board - Page 1
Forum section: electronics / general

author: Peter9090
author_rank: Contributor
timestamp: January 22, 2020, 03:12:36 am
content: This BSP was created by RT-Thread Community contributor.Hardware Features of Raspberry Pi 3B：Hardware DescriptionCPU quad-core ARM Cortex A53(ARMv8)Frequency 1.2 GHzGPU VideoCore IVGPU Frequency 400MHzMemory 1GB (0x0000000 - 0x40000000)0x3f000000 - 0x40000000 is peripheralHardware pin distribution, shown as follow:1. Compiling ProcessThe 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:tar vxf gcc-arm-none-eabi-4_8-2014q1_linux.tar.bz2In 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: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:sconsIf 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 environmentStep 1: Install eclipse cdtStep 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. Execution2.1 Download the raspbian mirroring to generate a running raspbian SD cardUnder Windows, find etcher.io and download etcher, it is a tool that can burn imgUnzip the downloaded mirroring file, and use the following command under linux:Code:unzip 2018-06-27-raspbian-stretch-lite.zipPrepare an empty SD card, plug in the computer and execute under linux environmentCode:sudo dd if=2018-06-27-raspbian-stretch-lite.img of=/dev/xxx bs=32M conv=fsyncNote: /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 lineThe 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:heap: 0x0005d784 - 0x0045d784\ | /- RT - Thread Operating System/ | \ 4.0.2 build Jan 9 20202006 - 2019 Copyright by rt-thread team[I/I2C] I2C bus  registered[I/I2C] I2C bus  registered[I/SDIO] SD card capacity 15558144 KB.found part, begin: 1048576, size: 63.0MBfound part, begin: 67108864, size: 14.793GBfile system initialization done!boot cpu:3msh />cpu = 0x00000003cpu 3 startup.start OK: CPU 3boot cpu:2cpu = 0x00000002cpu 2 startup.start OK: CPU 2boot cpu:1cpu = 0x00000001cpu 1 startup.start OK: CPU 1Hello RT-Thread!msh />3. Supporting StatusDriver Supporting Status RemarkUART Support UART0GPIO SupportIIC SupportSPI SupportCPU Timer SupportIf you have any questions you can reach out athttps://github.com/RT-Thread/rt-thread/tree/master/bsp/raspberry-pi/raspi3-32And for more information about RT-Thread, refer tohttps://github.com/RT-Thread

author: Peter9090
author_rank: Contributor
timestamp: January 22, 2020, 03:17:09 am
content: Hardware pin distribution, shown as follow:

author: Peter9090
author_rank: Contributor
timestamp: January 22, 2020, 03:18:15 am
content: The current version uses the GPIO 14 and GPIO 15 of raspi3 and as the junction output, as shown in the following figure:

author: Peter9090
author_rank: Contributor
timestamp: February 03, 2020, 06:08:33 am
content: 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