[PATCH v2] doc/raspberrypi: Added instructions for raspberrypi

G S Niteesh gsnb.gn at gmail.com
Sun Jan 5 19:19:31 UTC 2020


Added instructions to run examples on raspberrypi.
---
 user/bsps/arm/raspberrypi.rst | 74 ++++++++++++++++++++++++++++++++++-
 1 file changed, 73 insertions(+), 1 deletion(-)

diff --git a/user/bsps/arm/raspberrypi.rst b/user/bsps/arm/raspberrypi.rst
index 4ef75bd..7eccca5 100644
--- a/user/bsps/arm/raspberrypi.rst
+++ b/user/bsps/arm/raspberrypi.rst
@@ -5,4 +5,76 @@
 raspberrypi
 ===========
 
-TODO.
+This BSP supports `Raspberry Pi 1` and `Raspberry Pi 2` currently.
+The support for `Raspberry Pi 3` is work under progress.
+The default bootloader on the raspberrypi which is used to boot raspbian
+or other OS can be also used to boot RTEMS. U-boot can also be used.
+
+Setup SD card
+----------------
+
+The Raspberry Pis have an unconventional booting mechanism. The GPU
+boots first, initializes itself, runs the bootloader and starts the CPU.
+The bootloader looks for a kernel image, by default the kernel images must
+have a name of the form `kernel*.img` but this can be changed by adding
+`kernel=<img_name>` to config.txt.
+
+You must provide the required files for the GPU to proceed. These files
+can be downloaded from this
+`link <https://github.com/raspberrypi/firmware/tree/master/boot>`_.
+You can remove the kernel*.img if you want, but don't touch the other files.
+
+Copy these files in to a SD card with FAT filesystem.
+
+Kernel image
+------------
+
+The following steps show how to run hello.exe on a Raspberry Pi 2.
+The same instructions can be applied to Raspberry Pi 1 also.
+Other executables can be processed in a similar way.
+
+To create the kernel image:
+
+.. code-block:: none
+
+     arm-rtems5-objcopy -Obinary hello.exe kernel.img
+
+Copy the kernel image to the SD card.
+
+Make sure you have these lines below in your config.txt.
+
+.. code-block:: none
+
+     enable-uart=1
+     kernel_address=0x200000
+     kernel=kernel.img
+
+Testing
+-------
+
+Qemu along with GDB can be used for debugging, but it only supports
+``Raspberry Pi 2`` and the emulation is also incomplete. So some of the
+features might not work as expected.
+
+Make sure you have latest version of qemu, because older ones don't support
+Raspberry Pi.
+
+.. code-block:: none
+
+     qemu-system-arm -M raspi2 -m 1G -kernel hello.exe -serial mon:stdio -nographic -S -s
+
+This starts qemu and creates a socket at port ``localhost:1234`` for GDB to
+connect.
+
+In a new terminal, run GDB using
+
+.. code-block:: none
+
+     arm-rtems5-gdb hello.exe
+     tar remote:1234
+     load
+
+This will connect GDB to qemu and load the application.
+
+**Note**: Add ``set scheduler-locking on`` in GDB if you have any issues
+running the examples.
\ No newline at end of file
-- 
2.17.1



More information about the devel mailing list