Steverino
Posts: 23
Joined: Sun Aug 19, 2012 2:44 pm

Re: ChibiOS/RT Port

Thu Oct 18, 2012 12:53 pm

The link issues are because, by default, the linker will use shared libraries and this isn't a good thing for bare metal programs. Static libgcc libraries aren't installed by default on the Pi and I wasn't able to locate a binary package for them. As an experiment, I copied the ARM libgcc.a library from the cross compiler on my Mac and that resolved most of the symbols. However, there's still a few string functions that are unresolved (only an issue if you are using the optional Chibi "shell").

I found a source package for an embedded libgcc, which I assume can be built as a static library. The package description warned that the library takes hours to build (on a relatively faster machine than a Pi).

tufty
Posts: 1456
Joined: Sun Sep 11, 2011 2:32 pm

Re: ChibiOS/RT Port

Thu Oct 18, 2012 1:46 pm

If you're looking for an embedded libc, (I'm assuming the issues you're having are with standard C library stuff rather than GCC primitives like division), newlib or uClibc are a lot lighter than GCC's implementation.

inder
Posts: 23
Joined: Wed Aug 22, 2012 7:44 pm

Re: ChibiOS/RT Port

Thu Oct 18, 2012 6:01 pm

@Steverino, I need a little help. Since I had yagarto already installed in my win7 box, I cloned your repo and then went into the appropriate directory and typed make in the command tool. The error I got was "c:\program no such file or directory" error 127. Since yagarto is in c;\program files\yagarto, I looked at the makefile to see where the reference is and couldn't find any. Took the easy way out and made a directory called C:\program (thought that having a space might also have been a problem) and copied the yagarto directory to it. Running make now generates error 126 "c:\program is a directory". I have no problems using yagarto in Baking Pi demos. Any suggestions?

Steverino
Posts: 23
Joined: Sun Aug 19, 2012 2:44 pm

Re: ChibiOS/RT Port

Thu Oct 18, 2012 6:54 pm

I don't do my cross compilation on Windows. However, I have a Windows 7 machine available so I installed Yagarto (default installation into C:\Program Files(x86)\, added to executable path) and cloned the ChibiOS-RPi repository.

Using cygwin, I cd'ed into demos/demos/ARM11-BCM2835-GCC and typed 'make'. Everything built fine. Is Yagarto in your executable path? The make file just references the Yagarto tools by name (not by path) so I'm not sure how the space in the path would cause a problem in this case. What shell are you using to do the build?

inder
Posts: 23
Joined: Wed Aug 22, 2012 7:44 pm

Re: ChibiOS/RT Port

Thu Oct 18, 2012 7:37 pm

Thanks for the quick reply. As mentioned before, when I do the Cambridge demos, the makefile seems to find my yagarto (the same default location as your's) and everything works. Of course, I don't use cygwin; I just run it from the command prompt. So I guess it's the DOS shell. The reason for the attempted workaround of creating c:\program etc. was prompted by the error message.

Steverino
Posts: 23
Joined: Sun Aug 19, 2012 2:44 pm

Re: ChibiOS/RT Port

Fri Oct 19, 2012 12:46 am

Which make program are you using?

inder
Posts: 23
Joined: Wed Aug 22, 2012 7:44 pm

Re: ChibiOS/RT Port

Fri Oct 19, 2012 1:32 am

I'm not sure; I assumed it was the default one in yagarto. In the Cambridge demos all I had to do was type make at the command prompt.

Steverino
Posts: 23
Joined: Sun Aug 19, 2012 2:44 pm

Re: ChibiOS/RT Port

Fri Oct 19, 2012 12:12 pm

I was able to reproduce the problem using Yagarto's make. It fails when the make file tries to do an 'echo'. Make tries to execute the echo with the sh shell, which is included in Yagarto's tools but it doesn't properly escape the spaces in the path.

When I moved the yagarto folder to c:\yagarto and updated the executable path, everything built successfully.

The Baking Pi make files are much simpler (apparently they invoke shell commands) so that's why they worked.

inder
Posts: 23
Joined: Wed Aug 22, 2012 7:44 pm

Re: ChibiOS/RT Port

Fri Oct 19, 2012 5:42 pm

Thanks. I need to read up on make. I'll move the yagarto to c: . Could you please elaborate on how you update the executable path

Steverino
Posts: 23
Joined: Sun Aug 19, 2012 2:44 pm

Re: ChibiOS/RT Port

Fri Oct 19, 2012 7:55 pm

Here's a page with instructions for how to change the path environment variable in Windows 7:
http://www.itechtalk.com/thread3595.html

There will already be an entry for the existing Yagarto installation so you can edit that entry, rather than adding a new one.

You might be able to uninstall Yagarto and reinstall it to a different location, but I'm not sure if it will clean up the path environment variable or not. I haven't tried it.

theandfire
Posts: 6
Joined: Thu Oct 18, 2012 8:14 am

Re: ChibiOS/RT Port

Mon Oct 22, 2012 8:09 am

Awesome contribution Steverino, I see this taking off on the Rpi.
I am looking at making a Midi controller by turning GPIO button-presses into serial data at 31250 baud.
Chibios seems like the perfect platform to do this. Are there any examples of how to use the serial pin, with arbitrary baud?
Cheers, Mitch.

gringow
Posts: 5
Joined: Wed Jun 26, 2013 9:09 pm

Re: ChibiOS/RT Port

Wed Jul 03, 2013 8:01 pm

Hi great initiative I was looking a long time for some RTOS for the Raspi. I downloaded the repository and built the demo (UART+blinking LED) but when I power my Raspi the LED blinks only once and it seems that there is no serial communication. I built the kernel on Windows with Yagarto and also on Ubuntu with this toolchain https://launchpad.net/gcc-arm-embedded. I used bootcode.bin and start.elf, couldn't find loader.bin anywhere as it seems that it is no longer requiered by any OS. Could the lack of loader.bin be causing this?

NMaas
Posts: 27
Joined: Sat May 12, 2012 2:51 pm

Re: ChibiOS/RT Port

Thu Jul 25, 2013 5:28 pm

I did also use the https://launchpad.net/gcc-arm-embedded Toolchain, build the Demo and got serial output as well as the blinking led, but I can't transmit any serial signal... Nothing works. Neither with an USB/TTL Converter, nor with an old serial console from a phone. I tried it on serial RaspPi and with Putty as well as TerraTerm Pro and minicom (in Ubuntu).

Could anyone lend me a hand on that problem?

Thanks!

NMaas
Posts: 27
Joined: Sat May 12, 2012 2:51 pm

Re: ChibiOS/RT Port

Sat Jul 27, 2013 3:44 pm

Ok, the problem is about the RPi Firmware. With version https://github.com/raspberrypi/firmware ... 1989d#boot
from 06.01.2013 it does work (Serial Line and everything!)

with the Version from 07.01.2013 https://github.com/raspberrypi/firmware ... 211fa/boot [ Enable ZRAM and RFKILL config options. …
Add mutex around bcm_mailbox_property function.
Fix config_hdmi_boost=4 when using hdmi_safe. ]

Serial Line broke... So seems like there would need to be made some adjustments to ChibiOS-RPi to get it working with the latest RPi Firmware...

I will stay with the 06.01.2013 for the time beeing.

albanmeffre
Posts: 2
Joined: Wed Mar 26, 2014 10:25 am

Re: ChibiOS/RT Port

Wed Mar 26, 2014 9:10 pm

hello
i got it working

Main (SD1 started)

ChibiOS/RT Shell
ch> info
Kernel: 2.5.1unstable
Compiler: GCC 4.7.2
Architecture: ARM11
Core Variant: ARM1176JZF-S
Port Info: Pure ARM mode
Platform: BCM2835
Build time: Mar 26 2014 - 00:22:02

raspi B firmware revision 346 from 2014 march 25
demo built with yagarto tools 20121018 and yagarto 20121222
OS : zindozs XP 32bits

i have some troubles using and EMTEC 2GB SDCARD
serial was not working on 3 reboot out of 4
i used an old 128Mb microSD card too
this one seems to work slightly better
i'm not sure if wether or not it depends on the quality of the SDcard

i tested it on two different release B boards : BS1321 and BS1320
follow the link below for the description of the different boards
http://elinux.org/RaspberryPi_Boards

best regards
Alban

albanmeffre
Posts: 2
Joined: Wed Mar 26, 2014 10:25 am

Re: ChibiOS/RT Port

Tue Apr 01, 2014 10:23 pm

Hello

i would like to use chibios programs with u-boot
how do i relocate the code in order to run it at, say ,0x200000 instead of 0x8000 ?

best regards
Alban

vpcola
Posts: 1
Joined: Sat Jun 07, 2014 11:59 am

Re: ChibiOS/RT Port

Sat Jun 07, 2014 12:04 pm

I have to make a few changes to Steve's ChibiOS/RT port to enable i2c on newer raspberry pi (rev. 2) boards.

The changes include creating I2C1 driver instead of I2C0 and enabling alt function for GPIO2 and GPIO3. Details are described here: http://lightsurge2.blogspot.sg/2014/06/ ... rev-2.html

rvanspaa
Posts: 7
Joined: Sun May 07, 2017 12:49 am

Re: ChibiOS/RT Port

Sun May 07, 2017 12:59 am

Hi Steverino,

If you are still out there, I'm wondering if you ever upgraded to a newer version of ChibiOS, and if so, have you published it somewhere?

johnthesoftware
Posts: 10
Joined: Mon Feb 02, 2015 9:14 am

Re: ChibiOS/RT Port

Sun May 12, 2019 7:23 am

This has been very quiet for a very long time.

I got the whole lot going including the recommended binary upload (neat). I also went for the Eclipse option, it works fine though it's not yet clear what this brings to the party. My next thought was to implement the JTAG stuff, though the revision 2 board I'm using apparently requires some soldering for one of the pins; I figured I'd hold off and may be use a later board.

I then looked at the latest Chibios version and found that it's quite different. Before I try to shoehorn your earlier work into the latest version I thought I'd ask if you or anyone else had carried this work forward.

Thanks

John

johnthesoftware
Posts: 10
Joined: Mon Feb 02, 2015 9:14 am

Re: ChibiOS/RT Port

Sun May 12, 2019 7:26 am

Don't know how I missed the previous post. I guest the answer's no.

fruitoftheloom
Posts: 19496
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: ChibiOS/RT Port

Sun May 12, 2019 7:56 am

johnthesoftware wrote:
Sun May 12, 2019 7:26 am
Don't know how I missed the previous post. I guest the answer's no.

The Original Poster Steverino

Joined:Sun Aug 19, 2012 3:44 pm
Last active:Wed Oct 15, 2014 1:17 am


Necromancer
adieu

My other Computer is an Asus CS10 ChromeBit running Chrome Operating System.
HP Envy 4500 Wireless Printer supported by HPLIP software in Raspbian Stretch.

Return to “Bare metal, Assembly language”