Running your first RTEMS program on the Raspberry Pi
So now you have RTEMS compiled and installed, what about getting an RTEMS program to actually run on the Pi ?
In case you missed anything:
Introduction to RTEMS on the Raspberry Pi Setting up an RTEMS development environment for the Raspberry Pi Compiling and Installing RTEMS for the Raspberry Pi
Did you notice the enable-tests=samples option in the configure script? It compiled some examples for you. Lets get one ready to run on the Pi:
$ arm-rtems4.11-objcopy -Obinary \ $HOME/development/rtems/bsps/4.11/arm-rtems4.11/raspberrypi/lib/rtems-4.11/tests/ticker.exe kernel.img |
Now you can copy the kernel.img file on your SD card and see if it works! Remember to back up kernel.img on your SD card before you copy this.
Currently, the RTEMS port for the Raspberry Pi uses the UART port for it’s console. You will need to get a USB UART cable like the following:
http://www.adafruit.com/products/954
If you are using Ubuntu you can use the “minicom” program to connect to the serial port. If you are using Windows, you can use a program such as: uCon
However you connect to the serial port, set the serial port to 115k baud and 8N1.
When you boot the Pi with the SD card containing your kernel.img file, you should see output like this:
*** CLOCK TICK TEST *** TA1 - rtems_clock_get_tod - 09:00:00 12/31/1988 TA2 - rtems_clock_get_tod - 09:00:00 12/31/1988 TA3 - rtems_clock_get_tod - 09:00:00 12/31/1988 TA1 - rtems_clock_get_tod - 09:00:05 12/31/1988 TA1 - rtems_clock_get_tod - 09:00:10 12/31/1988 TA2 - rtems_clock_get_tod - 09:00:10 12/31/1988 TA1 - rtems_clock_get_tod - 09:00:15 12/31/1988 TA3 - rtems_clock_get_tod - 09:00:15 12/31/1988 TA1 - rtems_clock_get_tod - 09:00:20 12/31/1988 TA2 - rtems_clock_get_tod - 09:00:20 12/31/1988 TA1 - rtems_clock_get_tod - 09:00:25 12/31/1988 TA1 - rtems_clock_get_tod - 09:00:30 12/31/1988 TA3 - rtems_clock_get_tod - 09:00:30 12/31/1988 TA2 - rtems_clock_get_tod - 09:00:30 12/31/1988 *** END OF CLOCK TICK TEST *** |
The program should take 35 seconds to run.