RTEMS Real Time OS ported to the Pi


22 posts
by alanc98 » Sun Mar 31, 2013 12:14 am
Hi everyone,
I wanted to announce that I have the RTEMS Real time OS working on the Raspberry Pi.

RTEMS is a free open source Real Time Operating System that has a number of features including:
Integrated Newlib C library
File systems
Device driver model
POSIX APIs, including posix threads
A command line shell
C++ support,
Network stack and drivers

Now for the Raspberry Pi, I have just the very basics working: Just a UART console and timer tick for the OS. It would be great to get additional device support for the Pi in RTEMS. SD card support, GPIO, I2C, USB, Ethernet, all need to be added.
RTEMS is hoping to participate in the Google Summer of Code Project again this year, and improving the Pi BSP would be a great project to work on for a college student.

An RTEMS development environment can be a little bit tricky to get set up: it needs an RTEMS specific GCC cross compiler, the autoconf/automake tools, and the directory structure can be a little bit of work to get used to.
So to help get anyone get started, I created a guide on getting started with RTEMS on the Raspberry Pi here:
http://alanstechnotes.blogspot.com/2013 ... ry-pi.html

It walks you through getting the compiler setup, building RTEMS, and running a sample. Note, that it's all on Ubuntu 12.10, but it should work on any recent Linux, BSD, or OSX. Windows may be difficult for the RTEMS Git head, because it relies on the absolute latest autoconf/automake tools.

If you are familiar with RTEMS, the Pi BSP is in the RTEMS Git head, which will eventually become RTEMS 4.11 when it is released.
http://git.rtems.org/rtems

More information about rtems at:
http://www.rtems.org

I want to thank the people that contribute on this forum, I spent a lot of time studying the examples and running the code that was posted on here.

Alan
Posts: 11
Joined: Sat Jan 19, 2013 10:29 pm
by alanc98 » Wed May 08, 2013 1:06 am
If anyone is interested, I have fixed a bug in my RTEMS port and I created an example RTEMS application that anyone can use on the Pi.

My RTEMS application is here:
http://github.com/alanc98/rki

When you run it on the Pi, it brings up an RTEMS shell and formats a 64MB RAM disk. You can run a number of commands to get a feel for RTEMS, including a Dhrystone and Whetstone benchmark program.

I also updated my original instructions above.

Once I can start to add some peripheral support ( HDMI Console, SD Card, network, USB, etc ) RTEMS could become a truly useful OS for the Pi.

Alan
Posts: 11
Joined: Sat Jan 19, 2013 10:29 pm
by tastenmonster » Tue May 14, 2013 2:10 pm
Hi Alan,

I want to use your port on qemu rpi emulator by torlus. Have you ever tried to run on an emulator?

I am able to run basic "Hello world" binaries, but the intrrupt from the timers are missing.

Any hints?
Posts: 5
Joined: Tue May 14, 2013 1:44 pm
by alanc98 » Sat May 18, 2013 4:55 pm
tastenmonster wrote:Hi Alan,

I want to use your port on qemu rpi emulator by torlus. Have you ever tried to run on an emulator?

I am able to run basic "Hello world" binaries, but the intrrupt from the timers are missing.

Any hints?


Sorry, I have never tried the emulator. I'll have to give it a try.

Alan
Posts: 11
Joined: Sat Jan 19, 2013 10:29 pm
by JohnBeardmore » Sat May 18, 2013 7:34 pm
So is this essentially an RT linux, or a new OS written from scratch ?

Cheers, J/.
Author of oBeMS open source Building energy Management System.
Automatic Meter Reading (AMR), Building Management System (BMS),
Building Energy Management System (BEMS), Infrastructure Control System (ICS).
See: http://t4sustainability.co.uk/oBeMS/
User avatar
Posts: 149
Joined: Thu Nov 15, 2012 11:03 pm
Location: Derbyshire UK.
by tastenmonster » Mon May 20, 2013 8:32 am
alanc98 wrote:
tastenmonster wrote:Hi Alan,

I want to use your port on qemu rpi emulator by torlus. Have you ever tried to run on an emulator?

I am able to run basic "Hello world" binaries, but the intrrupt from the timers are missing.

Any hints?


Sorry, I have never tried the emulator. I'll have to give it a try.

Alan


Hi Alan,

I got it working with Torlus QEMU Patches http://www.raspberrypi.org/phpBB3/viewtopic.php?f=72&t=26561&start=50

Martin
Posts: 5
Joined: Tue May 14, 2013 1:44 pm
by alanc98 » Mon May 20, 2013 11:36 pm
tastenmonster wrote:
alanc98 wrote:
tastenmonster wrote:Hi Alan,

I want to use your port on qemu rpi emulator by torlus. Have you ever tried to run on an emulator?

I am able to run basic "Hello world" binaries, but the intrrupt from the timers are missing.

Any hints?


Sorry, I have never tried the emulator. I'll have to give it a try.

Alan


Hi Alan,

I got it working with Torlus QEMU Patches http://www.raspberrypi.org/phpBB3/viewtopic.php?f=72&t=26561&start=50

Martin


Great! I will have to give this a try.
I hope to work on SD card access next.
Alan
Posts: 11
Joined: Sat Jan 19, 2013 10:29 pm
by alanc98 » Mon May 20, 2013 11:52 pm
JohnBeardmore wrote:So is this essentially an RT linux, or a new OS written from scratch ?

Cheers, J/.


RTEMS is an open source real time operating system similar to vxWorks or eCos. It is not related to Linux ( I'm pretty sure it was created before Linux, maybe 20 years ago? )

RTEMS does not (yet) support memory protection by MMU or a process model, but it does have a fairly complete POSIX threads API, file system support, network stack, C library, etc.

More info here:
http://www.rtems.org

I currently use RTEMS on this:
http://mms.gsfc.nasa.gov

Alan
Posts: 11
Joined: Sat Jan 19, 2013 10:29 pm
by timr » Thu May 23, 2013 10:31 am
EPICS - Experimental Physics and Industrial Control System http://www.aps.anl.gov/epics/ is an interesting set of tools which is supported on RTEMS. (As well as VxWorks, linux, and windows)
EPICS is used in lots of interesting places, and has a wide range of drivers and tools, from interfaces to stepper motor drivers, data acquisition hardware and cameras, through to data display and database tools. Yes, it runs on RPi (linux)

tim
Posts: 22
Joined: Wed May 30, 2012 10:11 am
by raspdroid » Wed Apr 20, 2016 8:05 pm
alanc98 wrote:If anyone is interested, I have fixed a bug in my RTEMS port and I created an example RTEMS application that anyone can use on the Pi.

My RTEMS application is here:
http://github.com/alanc98/rki

When you run it on the Pi, it brings up an RTEMS shell and formats a 64MB RAM disk. You can run a number of commands to get a feel for RTEMS, including a Dhrystone and Whetstone benchmark program.

I also updated my original instructions above.

Once I can start to add some peripheral support ( HDMI Console, SD Card, network, USB, etc ) RTEMS could become a truly useful OS for the Pi.

Alan


Hello,

Thanks very much for the tutorials. Are very helpful.

I try to build RKI in Ubuntu 15.10 64bits but I get this error:

error: 'RTEMS_CLOCK_GET_TICKS_PER_SECOND' undeclared (first use in this function)
(void) rtems_clock_get( RTEMS_CLOCK_GET_TICKS_PER_SECOND, &ticks_per_second ); return ticks_per_second;



[Makefile]
Code: Select all
##
## RTEMS RKI makefile
##

##
## paths for the RTEMS tools and RTEMS BSP
##   my paths are the same since I install the tools and
##   bsp in the same directory
##
RTEMS_TOOL_BASE ?= /home/raspdroid/RTEMS-WORKSPACE/development/rtems/build-rtems-rpi/tools
RTEMS_BSP_BASE ?= /home/raspdroid/RTEMS-WORKSPACE/development/rtems/build-rtems-rpi

##
## Architecture Definitions
##

##
## Select your BSP here
##  I switch between the Pi1 and Pi2
##
#BSP         ?= raspberrypi
BSP            ?= raspberrypi2

ARCH           ?= arm-rtems4.12
PREFIX         = $(RTEMS_TOOL_BASE)
RTEMS_PREFIX   = $(RTEMS_BSP_BASE)
RTEMS_ARCH_LIB = $(RTEMS_PREFIX)/$(ARCH)/$(BSP)/lib
BUILD_DIR ?= legacy-build/$(ARCH)-$(BSP)



make
Code: Select all
arm-rtems4.12-gcc  -Wa,-a=legacy-build/arm-rtems4.12-raspberrypi2/init.lis -march=armv7-a -mthumb -mfpu=neon -mfloat-abi=hard -mtune=cortex-a7 -D__ARM__   --pipe -B/home/raspdroid/RTEMS-WORKSPACE/development/rtems/build-rtems-rpi/arm-rtems4.12/raspberrypi2/lib -specs bsp_specs -qrtems -Wall -I. -Iinclude/  -I. -g -O2  -c -o legacy-build/arm-rtems4.12-raspberrypi2/init.o init.c
arm-rtems4.12-gcc  -Wa,-a=legacy-build/arm-rtems4.12-raspberrypi2/rtems_net.lis -march=armv7-a -mthumb -mfpu=neon -mfloat-abi=hard -mtune=cortex-a7 -D__ARM__   --pipe -B/home/raspdroid/RTEMS-WORKSPACE/development/rtems/build-rtems-rpi/arm-rtems4.12/raspberrypi2/lib -specs bsp_specs -qrtems -Wall -I. -Iinclude/  -I. -g -O2  -c -o legacy-build/arm-rtems4.12-raspberrypi2/rtems_net.o rtems_net.c
arm-rtems4.12-gcc  -Wa,-a=legacy-build/arm-rtems4.12-raspberrypi2/rtems_net_svc.lis -march=armv7-a -mthumb -mfpu=neon -mfloat-abi=hard -mtune=cortex-a7 -D__ARM__   --pipe -B/home/raspdroid/RTEMS-WORKSPACE/development/rtems/build-rtems-rpi/arm-rtems4.12/raspberrypi2/lib -specs bsp_specs -qrtems -Wall -I. -Iinclude/  -I. -g -O2  -c -o legacy-build/arm-rtems4.12-raspberrypi2/rtems_net_svc.o rtems_net_svc.c
arm-rtems4.12-gcc  -Wa,-a=legacy-build/arm-rtems4.12-raspberrypi2/local_shell_cmds.lis -march=armv7-a -mthumb -mfpu=neon -mfloat-abi=hard -mtune=cortex-a7 -D__ARM__   --pipe -B/home/raspdroid/RTEMS-WORKSPACE/development/rtems/build-rtems-rpi/arm-rtems4.12/raspberrypi2/lib -specs bsp_specs -qrtems -Wall -I. -Iinclude/  -I. -g -O2  -c -o legacy-build/arm-rtems4.12-raspberrypi2/local_shell_cmds.o local_shell_cmds.c
arm-rtems4.12-gcc  -Wa,-a=legacy-build/arm-rtems4.12-raspberrypi2/filesys.lis -march=armv7-a -mthumb -mfpu=neon -mfloat-abi=hard -mtune=cortex-a7 -D__ARM__   --pipe -B/home/raspdroid/RTEMS-WORKSPACE/development/rtems/build-rtems-rpi/arm-rtems4.12/raspberrypi2/lib -specs bsp_specs -qrtems -Wall -I. -Iinclude/  -I. -g -O2  -c -o legacy-build/arm-rtems4.12-raspberrypi2/filesys.o filesys.c
arm-rtems4.12-gcc  -Wa,-a=legacy-build/arm-rtems4.12-raspberrypi2/ramdisk.lis -march=armv7-a -mthumb -mfpu=neon -mfloat-abi=hard -mtune=cortex-a7 -D__ARM__   --pipe -B/home/raspdroid/RTEMS-WORKSPACE/development/rtems/build-rtems-rpi/arm-rtems4.12/raspberrypi2/lib -specs bsp_specs -qrtems -Wall -I. -Iinclude/  -I. -g -O2  -c -o legacy-build/arm-rtems4.12-raspberrypi2/ramdisk.o ramdisk.c
arm-rtems4.12-gcc  -Wa,-a=legacy-build/arm-rtems4.12-raspberrypi2/nvramdisk.lis -march=armv7-a -mthumb -mfpu=neon -mfloat-abi=hard -mtune=cortex-a7 -D__ARM__   --pipe -B/home/raspdroid/RTEMS-WORKSPACE/development/rtems/build-rtems-rpi/arm-rtems4.12/raspberrypi2/lib -specs bsp_specs -qrtems -Wall -I. -Iinclude/  -I. -g -O2  -c -o legacy-build/arm-rtems4.12-raspberrypi2/nvramdisk.o nvramdisk.c
arm-rtems4.12-gcc  -Wa,-a=legacy-build/arm-rtems4.12-raspberrypi2/task_cmd.lis -march=armv7-a -mthumb -mfpu=neon -mfloat-abi=hard -mtune=cortex-a7 -D__ARM__   --pipe -B/home/raspdroid/RTEMS-WORKSPACE/development/rtems/build-rtems-rpi/arm-rtems4.12/raspberrypi2/lib -specs bsp_specs -qrtems -Wall -I. -Iinclude/  -I. -g -O2  -c -o legacy-build/arm-rtems4.12-raspberrypi2/task_cmd.o task_cmd.c
task_cmd.c: In function 'get_ticks_per_second':
task_cmd.c:23:10: warning: implicit declaration of function 'rtems_clock_get' [-Wimplicit-function-declaration]
   (void) rtems_clock_get( RTEMS_CLOCK_GET_TICKS_PER_SECOND, &ticks_per_second );  return ticks_per_second;
          ^~~~~~~~~~~~~~~
task_cmd.c:23:27: error: 'RTEMS_CLOCK_GET_TICKS_PER_SECOND' undeclared (first use in this function)
   (void) rtems_clock_get( RTEMS_CLOCK_GET_TICKS_PER_SECOND, &ticks_per_second );  return ticks_per_second;
                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
task_cmd.c:23:27: note: each undeclared identifier is reported only once for each function it appears in
task_cmd.c: In function 'Test_task':
task_cmd.c:39:26: warning: format '%X' expects argument of type 'unsigned int', but argument 2 has type 'rtems_id {aka long unsigned int}' [-Wformat=]
   printf( "*** TASK 0x%08X FINISHED ***\n",tid);
                          ^
task_cmd.c:32:21: warning: variable 'status' set but not used [-Wunused-but-set-variable]
   rtems_status_code status;
                     ^~~~~~
task_cmd.c: In function 'task_command':
task_cmd.c:45:21: warning: variable 'status' set but not used [-Wunused-but-set-variable]
   rtems_status_code status;
                     ^~~~~~
Makefile:163: recipe for target 'task_cmd.o' failed
make: *** [task_cmd.o] Error 1


Best regards
Posts: 1086
Joined: Thu Nov 06, 2014 9:15 am
Location: Gran Canaria :: Spain
by alanc98 » Sun Apr 24, 2016 2:59 am
Hi,
The RTEMS project is now working on the 4.12 version, so my instructions and code need some updating.

I created a tag in my RKI repository "4.11" that will work with the RTEMS 4.11 tools and 4.11 branch of the RTEMS kernel source.

Next I'm working on updating the RKI image to work with 4.12. It should be fixed soon.

More good news: We will be working on the RTEMS Raspberry Pi port this summer with the Google Summer of Code project. We hope to improve I2C, SPI, and add support for SD card USB and the network.

Alan
Posts: 11
Joined: Sat Jan 19, 2013 10:29 pm
by alanc98 » Sun Apr 24, 2016 3:33 am
I pushed a change to my RKI repository that allows it to build for both RTEMS 4.11 and RTEMS 4.12

The "waf" based makefile works on 4.11, but not for 4.12 yet.
For now you can use the regular "Makefile"

Alan
Posts: 11
Joined: Sat Jan 19, 2013 10:29 pm
by raspdroid » Sun Apr 24, 2016 10:27 pm
Thanks very much Alan!,

I'll try it.

It's RTEMS compatible with Kinetis V Series (NXP/Freescale KV4x) ?


Best regards,

Javier
Posts: 1086
Joined: Thu Nov 06, 2014 9:15 am
Location: Gran Canaria :: Spain
by raspdroid » Mon Apr 25, 2016 11:07 pm
Hi!,

I have set an RTEMS development environment for the Raspberry Pi in Ubuntu 15.10 64bits

Built the RTEMS ARM cross compiler ,
Code: Select all
RTEMS Source Builder - Check, 4.12 (8bcc58b249fb modified)
Environment is ok


and built and installed the toolchain.
Code: Select all
~/RTEMS-WORKSPACE/development/rtems/rtems-source-builder/rtems$ ../source-builder/sb-set-builder --log=build-log.txt --prefix=/home/raspdroid/RTEMS-WORKSPACE/development/rtems/compiler/4.12 4.12/rtems-arm



and established the environment variables, nano .bashrc
Code: Select all
## Variables de entorno RTEMS ##
RTEMS_HOME=/home/raspdroid/RTEMS-WORKSPACE
RTEMS_TOOLCHAIN_BASE=$RTEMS_HOME/development/rtems/compiler/4.12
RTEMS_BSP_BASE=$RTEMS_HOME/RTEMS-WORKSPACE/development/rtems/bsps/4.12

export PATH=$PATH:$RTEMS_HOME:$RTEMS_TOOLCHAIN_BASE/bin:$RTEMS_BSP_BASE


source /home/raspdroid/.bashrc (it is not necessary to logout or reboot)


echo $RTEMS_ (double tab)
Code: Select all
$RTEMS_BSP_BASE   $RTEMS_HOME       $RTEMS_TOOLCHAIN_BASE 



arm-rtems4.12-gcc -v
Using built-in specs.
COLLECT_GCC=arm-rtems4.12-gcc
COLLECT_LTO_WRAPPER=/home/raspdroid/RTEMS-WORKSPACE/development/rtems/compiler/4.12/libexec/gcc/arm-rtems4.12/6.0.1/lto-wrapper
Target: arm-rtems4.12
Configured with: ../gcc-6.0.1-RC-20160415/configure --prefix=/home/raspdroid/RTEMS-WORKSPACE/development/rtems/compiler/4.12 --bindir=/home/raspdroid/RTEMS-WORKSPACE/development/rtems/compiler/4.12/bin --exec_prefix=/home/raspdroid/RTEMS-WORKSPACE/development/rtems/compiler/4.12 --includedir=/home/raspdroid/RTEMS-WORKSPACE/development/rtems/compiler/4.12/include --libdir=/home/raspdroid/RTEMS-WORKSPACE/development/rtems/compiler/4.12/lib --libexecdir=/home/raspdroid/RTEMS-WORKSPACE/development/rtems/compiler/4.12/libexec --mandir=/home/raspdroid/RTEMS-WORKSPACE/development/rtems/compiler/4.12/share/man --infodir=/home/raspdroid/RTEMS-WORKSPACE/development/rtems/compiler/4.12/share/info --datadir=/home/raspdroid/RTEMS-WORKSPACE/development/rtems/compiler/4.12/share --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=arm-rtems4.12 --disable-libstdcxx-pch --with-gnu-as --with-gnu-ld --verbose --with-newlib --with-system-zlib --disable-nls --without-included-gettext --disable-win32-registry --enable-version-specific-runtime-libs --disable-lto --enable-newlib-io-c99-formats --enable-newlib-iconv --enable-newlib-iconv-encodings=big5,cp775,cp850,cp852,cp855,cp866,euc_jp,euc_kr,euc_tw,iso_8859_1,iso_8859_10,iso_8859_11,iso_8859_13,iso_8859_14,iso_8859_15,iso_8859_2,iso_8859_3,iso_8859_4,iso_8859_5,iso_8859_6,iso_8859_7,iso_8859_8,iso_8859_9,iso_ir_111,koi8_r,koi8_ru,koi8_u,koi8_uni,ucs_2,ucs_2_internal,ucs_2be,ucs_2le,ucs_4,ucs_4_internal,ucs_4be,ucs_4le,us_ascii,utf_16,utf_16be,utf_16le,utf_8,win_1250,win_1251,win_1252,win_1253,win_1254,win_1255,win_1256,win_1257,win_1258 --enable-threads --disable-plugin --enable-libgomp --enable-languages=c,c++
Thread model: rtems
gcc version 6.0.1 20160415 (RTEMS 4.12, RSB 8bcc58b249fbf1f6e7bbd4151d9cf9b04c94b87e-modified, Newlib 2.4.0) (GCC)


Also I have compiled and installed RTEMS for Raspberry Pi,

This is the configuration
../rtems-git/configure --target=arm-rtems4.12 --enable-rtemsbsp=raspberrypi2 --enable-test=samples --enable-networking --enable-posix --prefix=$RTEMS_HOME/development/rtems/bsps/4.12



Then I built a sample, Ticker sample:
arm-rtems4.12-objcopy -Obinary $RTEMS_HOME/development/rtems/build-rtems-rpi/arm-rtems4.12/c/raspberrypi/testsuites/samples/ticker/ticker.exe kernel.img


I copy the result image in SDcard with Raspbian Jessie Lite 4.4.8 (original kernel.img is renamed to kernel.img.bck). This version of Raspbian has two kernel images, kernel.img and kernel7.img. To do the same procedure for kernel7.img or another procedure? :?: I think that I have to use the kernel7.img because I have a Rpi2.

I have not a USB to TTL serial cable but I have a XBee Explorer with usb, I think it can serve , I'm going to try https://www.sparkfun.com/products/11812
Posts: 1086
Joined: Thu Nov 06, 2014 9:15 am
Location: Gran Canaria :: Spain
by raspdroid » Tue Apr 26, 2016 12:26 am
About Rki, now compile, thanks!

##
## RTEMS RKI makefile
##

##
## paths for the RTEMS tools and RTEMS BSP
## my paths are the same since I install the tools and
## bsp in the same directory
##
RTEMS_TOOL_BASE ?= /home/raspdroid/RTEMS-WORKSPACE/development/rtems
RTEMS_BSP_BASE ?= /home/raspdroid/RTEMS-WORKSPACE/development/rtems/bsps/4.12




arm-rtems4.12-gcc -march=armv7-a -mthumb -mfpu=neon -mfloat-abi=hard -mtune=cortex-a7 --pipe -B/home/raspdroid/RTEMS-WORKSPACE/development/rtems/bsps/4.12/arm-rtems4.12/raspberrypi2/lib -specs bsp_specs -qrtems -Wall -o legacy-build/arm-rtems4.12-raspberrypi2/rki.elf legacy-build/arm-rtems4.12-raspberrypi2/init.o legacy-build/arm-rtems4.12-raspberrypi2/rtems_net.o legacy-build/arm-rtems4.12-raspberrypi2/rtems_net_svc.o legacy-build/arm-rtems4.12-raspberrypi2/local_shell_cmds.o legacy-build/arm-rtems4.12-raspberrypi2/filesys.o legacy-build/arm-rtems4.12-raspberrypi2/ramdisk.o legacy-build/arm-rtems4.12-raspberrypi2/nvramdisk.o legacy-build/arm-rtems4.12-raspberrypi2/task_cmd.o legacy-build/arm-rtems4.12-raspberrypi2/hello_cmd.o legacy-build/arm-rtems4.12-raspberrypi2/dhrystone_cmd.o legacy-build/arm-rtems4.12-raspberrypi2/whetstone_cmd.o legacy-build/arm-rtems4.12-raspberrypi2/benchmarks.o legacy-build/arm-rtems4.12-raspberrypi2/tarfile.o -lm
arm-rtems4.12-objcopy -O binary --strip-all legacy-build/arm-rtems4.12-raspberrypi2/rki.elf legacy-build/arm-rtems4.12-raspberrypi2/rki.bin
arm-rtems4.12-size legacy-build/arm-rtems4.12-raspberrypi2/rki.elf
text data bss dec hex filename
479060 20980 133673712 134173752 7ff5438 legacy-build/arm-rtems4.12-raspberrypi2/rki.elf
Posts: 1086
Joined: Thu Nov 06, 2014 9:15 am
Location: Gran Canaria :: Spain
by raspdroid » Tue Apr 26, 2016 10:10 am
Hi!,

Sorry, but I tried with minicoms, screen and ser2net with Ticker demo but not works to me.

telnet localhost 4000
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.

ser2net port 4000 device /dev/ttyUSB0 [115200 N81] (Debian GNU/Linux)


BCM 14 (TXD) to pin DIN (xbee usb explorer)
BCM 15 (RXD) to pin DOUT (xbee usb explorer)

Then I plugged usb wire of xbee usb explorer in ubuntu host , start telnet, "telnet localhost 4000" and I plugged the power supply wire to Raspberry Pi 2 but nothings happens.

Can you help me, please.

Regards


PD: raspberrypi is compiled with arm1176 and raspberrypi2 with armv7 but not works.
../rtems-git/configure --target=arm-rtems4.12 --enable-rtemsbsp=raspberrypi --enable-tests=samples --enable-networking --enable-posix --prefix=/home/raspdroid/RTEMS-WORKSPACE/development/rtems/bsps/4.12

../rtems-git/configure --target=arm-rtems4.12 --enable-rtemsbsp=raspberrypi2 --enable-tests=samples --enable-networking --enable-posix --prefix=/home/raspdroid/RTEMS-WORKSPACE/development/rtems/bsps/4.12

arm-rtems4.12-objcopy -Obinary arm-rtems4.12/c/raspberrypi/testsuites/samples/ticker/ticker.exe kernel.img
arm-rtems4.12-objcopy -Obinary arm-rtems4.12/c/raspberrypi2/testsuites/samples/ticker/ticker.exe kernel7.img
Posts: 1086
Joined: Thu Nov 06, 2014 9:15 am
Location: Gran Canaria :: Spain
by raspdroid » Tue Apr 26, 2016 6:55 pm
Hello!,

This example works to me, with shared GND between Raspberry Pi 2 and Usb Xbee Explorer.
https://github.com/dwelch67/raspberrypi ... ter/uart03

with minicom
Welcome to minicom 2.7

OPCIONES: I18n
Compilado en Jan 1 2014, 17:13:19.
Port /dev/ttyUSB0, 19:43:19

Presione CTRL-A Z para obtener ayuda sobre teclas especiales

12345678 (this with Raspbian Jessie Lite image, deleted kernel.img and replace kernel7.img for the uart03.bin)
12345678 (this with 4gb sd with FAT32 format and bootcode.bin, start.elf and kernel7.img)



with ser2net
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.

ser2net port 4000 device /dev/ttyUSB0 [115200 N81] (Debian GNU/Linux)

12345678


Wires diagram:
BCM 14 (TXD) to pin DOUT (xbee usb explorer, FTDI231x)
BCM 15 (RXD) to pin DIN (xbee usb explorer, FTDI231x)
Rpi pin 6 (GND) to pin GND (xbee usb explorer, FTDI231x)
Posts: 1086
Joined: Thu Nov 06, 2014 9:15 am
Location: Gran Canaria :: Spain
by raspdroid » Wed May 04, 2016 11:33 am
alanc98 wrote:The "waf" based makefile works on 4.11, but not for 4.12 yet.


Thank you for the latest updates. Now I am using Fedora 23 64bit and I've tried with waf and seems to work.

[raspdroid@myhost rki]$ waf configure --rtems=/home/raspdroid/development/rtems/bsps/4.12 --rtems-tools=/home/raspdroid/development/rtems/compiler/4.12 --rtems-version=4.12 --rtems-bsps=arm/raspberrypi2
Setting top to : /home/raspdroid/development/rki
Setting out to : /home/raspdroid/development/rki/build
RTEMS Version : 4.12
Architectures : arm-rtems4.12
Board Support Package : arm-rtems4.12-raspberrypi2
Checking for program 'arm-rtems4.12-gcc' : /home/raspdroid/development/rtems/compiler/4.12/bin/arm-rtems4.12-gcc
Checking for program 'arm-rtems4.12-g++' : /home/raspdroid/development/rtems/compiler/4.12/bin/arm-rtems4.12-g++
Checking for program 'arm-rtems4.12-gcc' : /home/raspdroid/development/rtems/compiler/4.12/bin/arm-rtems4.12-gcc
Checking for program 'arm-rtems4.12-ld' : /home/raspdroid/development/rtems/compiler/4.12/bin/arm-rtems4.12-ld
Checking for program 'arm-rtems4.12-ar' : /home/raspdroid/development/rtems/compiler/4.12/bin/arm-rtems4.12-ar
Checking for program 'arm-rtems4.12-nm' : /home/raspdroid/development/rtems/compiler/4.12/bin/arm-rtems4.12-nm
Checking for program 'arm-rtems4.12-objdump' : /home/raspdroid/development/rtems/compiler/4.12/bin/arm-rtems4.12-objdump
Checking for program 'arm-rtems4.12-objcopy' : /home/raspdroid/development/rtems/compiler/4.12/bin/arm-rtems4.12-objcopy
Checking for program 'arm-rtems4.12-readelf' : /home/raspdroid/development/rtems/compiler/4.12/bin/arm-rtems4.12-readelf
Checking for program 'arm-rtems4.12-strip' : /home/raspdroid/development/rtems/compiler/4.12/bin/arm-rtems4.12-strip
Checking for program 'rtems-ld' : /home/raspdroid/development/rtems/compiler/4.12/bin/rtems-ld
Checking for program 'rtems-tld' : /home/raspdroid/development/rtems/compiler/4.12/bin/rtems-tld
Checking for program 'rtems-bin2c' : /home/raspdroid/development/rtems/bsps/4.12/bin/rtems-bin2c
Checking for program 'tar' : /usr/bin/tar
Checking for program 'gcc, cc' : /home/raspdroid/development/rtems/compiler/4.12/bin/arm-rtems4.12-gcc
Checking for program 'ar' : /home/raspdroid/development/rtems/compiler/4.12/bin/arm-rtems4.12-ar
Checking for program 'g++, c++' : /home/raspdroid/development/rtems/compiler/4.12/bin/arm-rtems4.12-g++
Checking for program 'gas, gcc' : /home/raspdroid/development/rtems/compiler/4.12/bin/arm-rtems4.12-gcc
Compiler version (arm-rtems4.12-gcc) : 6.0.1 20160415 (RTEMS 4.12, RSB 8bcc58b249fbf1f6e7bbd4151d9cf9b04c94b87e, Newlib 2.4.0)
Checking for RTEMS CPU options header : ok
Checking for RTEMS_DEBUG : no
Checking for RTEMS_MULTIPROCESSING : no
Checking for RTEMS_NEWLIB : yes
Checking for RTEMS_POSIX_API : yes
Checking for RTEMS_SMP : no
Checking for RTEMS_NETWORKING : yes
Checking for RTEMS header : ok
'configure' finished successfully (6.056s)



[raspdroid@myhost rki]$ waf
Waf: Entering directory `/home/raspdroid/development/rki/build/arm-rtems4.12-raspberrypi2'
[ 1/16] Creating build/arm-rtems4.12-raspberrypi2/tarfile.o
[ 2/16] Compiling init.c
[ 3/16] Compiling rtems_net.c
[ 4/16] Compiling rtems_net_svc.c
[ 6/16] Compiling local_shell_cmds.c
[ 7/16] Compiling filesys.c
[ 8/16] Compiling ramdisk.c
[ 9/16] Compiling nvramdisk.c
[10/16] Compiling task_cmd.c
[11/16] Compiling hello_cmd.c
[12/16] Compiling dhrystone_cmd.c
[13/16] Compiling whetstone_cmd.c
[14/16] Compiling benchmarks.c
[15/16] Linking build/arm-rtems4.12-raspberrypi2/rki.elf
[16/16] Compiling build/arm-rtems4.12-raspberrypi2/rki.elf
Waf: Leaving directory `/home/raspdroid/development/rki/build/arm-rtems4.12-raspberrypi2'
'build-arm-rtems4.12-raspberrypi2' finished successfully (3.557s)
Posts: 1086
Joined: Thu Nov 06, 2014 9:15 am
Location: Gran Canaria :: Spain
by raspdroid » Thu May 05, 2016 12:50 am
Sorry but I don't can get the shell prompt.

$ cd build/arm-rtems4.12-raspberrypi2

$ arm-rtems4.12-objcopy rki.elf -O binary kernel7.img


and I copy the kernel7.img file to SDcard , run minicom and boot the raspberry pi2 but nothing happens.

Minicom config:

A: /dev/ttyUSB0
C:
D:
E: 115200 8N1
F: No
G: No


This example work well to me with that configuration https://github.com/dwelch67/raspberrypi ... ter/uart03

I use a Sparkfun Xbee Explorer USB to serial connection and power supply (I have bought a FT2232H miniMod but not reach until friday or monday.).

Breakout Rpi2
pin Dout pin 8 TX
pin Din pin 10 RX
gnd pin 3 gnd
5v pin 1



Please, You can tell me that I'm doing wrong.


Best regards
Posts: 1086
Joined: Thu Nov 06, 2014 9:15 am
Location: Gran Canaria :: Spain
by dwelch67 » Thu May 05, 2016 11:24 pm
if my uart03 example (or uart02) works, then you have your ftdi board hooked up right (xbee explorer).

there are two uarts in the raspi if I remember right and either can use those pins, if I remember right...

so if uart03 works but RTEMS does not, then it sounds like a software thing...
Posts: 625
Joined: Sat May 26, 2012 5:32 pm
by raspdroid » Fri May 06, 2016 8:04 am
Thanks for you reply,

$ sudo dnf remove ser2net -y


sudo minicom and now works :?

Welcome to minicom 2.7

OPCIONES: I18n
Compilado en Jun 17 2015, 20:54:53.
Port /dev/ttyUSB0, 08:32:46

Presione CTRL-A Z para obtener ayuda sobre teclas especiales



*** BEGIN OF TEST CLOCK TICK ***
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:04 12/31/1988


*** BEGIN OF TEST CLOCK TICK ***
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


*** BEGIN OF TEST CLOCK TICK ***
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:04 12/31/1988
TA1 - rtems_clock_get_tod - 09:00:09 12/31/1988
TA2 - rtems_clock_get_tod - 09:00:10 12/31/1988
TA1 - rtems_clock_get_tod - 09:00:14 12/31/1988
TA3 - rtems_clock_get_tod - 09:00:15 12/31/1988
TA1 - rtems_clock_get_tod - 09:00:19 12/31/1988
TA2 - rtems_clock_get_tod - 09:00:20 12/31/1988
TA1 - rtems_clock_get_tod - 09:00:24 12/31/1988
TA1 - rtems_clock_get_tod - 09:00:29 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
TA1 - rtems_clock_get_tod - 09:00:34 12/31/1988
*** END OF TEST CLOCK TICK ***


*** BEGIN OF TEST CLOCK TICK ***
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:04 12/31/1988
TA1 - rtems_clock_get_tod - 09:00:09 12/31/1988
TA2 - rtems_clock_get_tod - 09:00:10 12/31/1988
TA1 - rtems_clock_get_tod - 09:00:14 12/31/1988
TA3 - rtems_clock_get_tod - 09:00:15 12/31/1988
TA1 - rtems_clock_get_tod - 09:00:19 12/31/1988
TA2 - rtems_clock_get_tod - 09:00:20 12/31/1988
TA1 - rtems_clock_get_tod - 09:00:24 12/31/1988
TA1 - rtems_clock_get_tod - 09:00:29 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
TA1 - rtems_clock_get_tod - 09:00:34 12/31/1988
*** END OF TEST CLOCK TICK ***



If anyone is interested I have it translated into Spanish here. And updated path examples.

My FT2232H arrived this morning at the airport if I have luck I have today.

Best regards.
Posts: 1086
Joined: Thu Nov 06, 2014 9:15 am
Location: Gran Canaria :: Spain
by raspdroid » Fri May 06, 2016 8:39 am
Now RKI works! :)

RTEMS Kernel Image Booting


*** RTEMS Info ***
COPYRIGHT (c) 1989-2008.
On-Line Applications Research Corporation (OAR).
rtems-4.11.99.0 (ARM/ARMv4/raspberrypi2)


BSP Ticks Per Second = 100
*** End RTEMS info ***

Populating Root file system from TAR file.
Setting up filesystems.
Initializing Local Commands.
Running /shell-init.

1: mkdir ram
2: mkrfs /dev/ramdisk
3: mount -t rfs /dev/ramdisk /ram
mounted /dev/ramdisk -> /ram
4: hello
Hello RTEMS!
Create your own command here!
Starting shell....


RTEMS Shell on /dev/console. Use 'help' to list commands.
[/] #
Posts: 1086
Joined: Thu Nov 06, 2014 9:15 am
Location: Gran Canaria :: Spain