[RFC] Raspberry PI

This forum is dedicated to feedback, discussions about ongoing or future developments, ideas and suggestions regarding the ChibiOS projects are welcome. This forum is NOT for support.
User avatar
Giovanni
Site Admin
Posts: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: [RFC] Raspberry PI

Postby Giovanni » Tue May 23, 2017 8:43 am

Hi,

So far it is not an official port and it is based on an very old version of ChibiOS. It is not that there is no interest but official ports require people willing to maintain them, so far we have no maintainers for the rpi port and my bandwidth is very limited of late.

Including it would require:
1) Volunteers.
2) Porting it to the latest ChibiOS.
3) Commitment for maintenance, without this ports die after a while.

Giovanni

rvanspaa
Posts: 11
Joined: Mon Apr 24, 2017 7:51 am

Re: [RFC] Raspberry PI

Postby rvanspaa » Sat Jul 08, 2017 6:07 am

Hi,

I have upgraded to ChibiOS 17.6.
For anyone interested in trying this:-

• Download and install ChibiOS 17.6.
• Download http://rvanspaa.freehostia.com/ChibiOS17.6_Changes.zip
• ChibiOS17.6_Changes.zip should be extracted to the directory containing the ChibiOS 17.6 directory as the former contains a ChibiOS 17.6 directory itself, and they need to merge. Make sure to overwrite exiting files when extracting ChibiOS17.6_Changes.zip.
• Netbeans with C/C++ add-on may be used to create C/C++ project from existing sources, by pointing to ChibiOS_17.6.0\demos\ARM11-BCM2835-GCC\Makefile, however other cross compilers may also be used. The version of GCC I used is GCC 5.2.1 20151202 (release) [ARM/embedded-5-branch revision 231848], which is quite good, though still appears to have an occasional problem with “atoi”, which is why a very basic version of atoi is included in main.c, called “myatoi”. This always works. If you find a more uptodate version of the tool-chain, then this may no longer be needed. The baremetal GCC can be downloaded from https://developer.arm.com/open-source/g ... ain/gnu-rm. (IIRC).
If you just want to see it run, then a binary image has been included in ChibiOS_17.6.0\demos\ARM11-BCM2835-GCC\ch.bin. ch.bin will however normally be created in the ARM11-BCM2835-GCC\build sub-directory.
• Once the ARM11-BCM2835-GCC project has been compiled it creates a binary:- ARM11-BCM2835-GCC\build\ch.bin.
• I use David Welch’s bootloader5 to transfer this binary to the RPi, (sometimes after many retries), with ExtraPutty & Xmodem, however ch.bin can also be renamed to kernel.img and placed directly in the boot directory of the SD card used to boot the RPi. (Make a complete backup of this directory before changing it, so that you have a clean restore point if needed.)
• There is an EXTENDED_SHELL variable in Makefile, which can be either TRUE or FALSE.
• This version of ChibiOS for RPi makes use of the internal caches in the BCM2835, which makes a huge difference in speed of operation (about a factor 10 over the case where no caches are used). For the configuration of the caches, see the function crt1.c: __late_init, thanks primarily to rst & Ultibo from the RPi baremetal forum.

I have attached the results of a test run.

I realize this is far from perfect, but improvements will be made over time. Suggestions in that regard are most welcome.

Regards,

rvanspaa
Attachments
ChibiOS_17.6_test_result.zip
(1.48 KiB) Downloaded 183 times

mostafa_hosseinzadeh
Posts: 1
Joined: Tue Dec 05, 2017 9:05 am

Re: [RFC] Raspberry PI

Postby mostafa_hosseinzadeh » Tue Dec 05, 2017 9:25 am

rvanspaa wrote:Hi,

I have upgraded to ChibiOS 17.6.
For anyone interested in trying this:-

• Download and install ChibiOS 17.6.
• Download http://rvanspaa.freehostia.com/ChibiOS17.6_Changes.zip
• ChibiOS17.6_Changes.zip should be extracted to the directory containing the ChibiOS 17.6 directory as the former contains a ChibiOS 17.6 directory itself, and they need to merge. Make sure to overwrite exiting files when extracting ChibiOS17.6_Changes.zip.
• Netbeans with C/C++ add-on may be used to create C/C++ project from existing sources, by pointing to ChibiOS_17.6.0\demos\ARM11-BCM2835-GCC\Makefile, however other cross compilers may also be used. The version of GCC I used is GCC 5.2.1 20151202 (release) [ARM/embedded-5-branch revision 231848], which is quite good, though still appears to have an occasional problem with “atoi”, which is why a very basic version of atoi is included in main.c, called “myatoi”. This always works. If you find a more uptodate version of the tool-chain, then this may no longer be needed. The baremetal GCC can be downloaded from https://developer.arm.com/open-source/g ... ain/gnu-rm. (IIRC).
If you just want to see it run, then a binary image has been included in ChibiOS_17.6.0\demos\ARM11-BCM2835-GCC\ch.bin. ch.bin will however normally be created in the ARM11-BCM2835-GCC\build sub-directory.
• Once the ARM11-BCM2835-GCC project has been compiled it creates a binary:- ARM11-BCM2835-GCC\build\ch.bin.
• I use David Welch’s bootloader5 to transfer this binary to the RPi, (sometimes after many retries), with ExtraPutty & Xmodem, however ch.bin can also be renamed to kernel.img and placed directly in the boot directory of the SD card used to boot the RPi. (Make a complete backup of this directory before changing it, so that you have a clean restore point if needed.)
• There is an EXTENDED_SHELL variable in Makefile, which can be either TRUE or FALSE.
• This version of ChibiOS for RPi makes use of the internal caches in the BCM2835, which makes a huge difference in speed of operation (about a factor 10 over the case where no caches are used). For the configuration of the caches, see the function crt1.c: __late_init, thanks primarily to rst & Ultibo from the RPi baremetal forum.

I have attached the results of a test run.

I realize this is far from perfect, but improvements will be made over time. Suggestions in that regard are most welcome.

Regards,

rvanspaa



Hi,


I want to run chibios on raspberry pi 3 but its not work, i copy kernel.img and bootcode.bin , start.elf but when i power on raspberry pi just display a rainbow image.
how can i run chibios on raspberry pi?

User avatar
Giovanni
Site Admin
Posts: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: [RFC] Raspberry PI

Postby Giovanni » Tue Dec 05, 2017 9:30 am

Hi,

You should contact the author of the Raspberry port: https://www.stevebate.net/chibios-rpi/G ... arted.html

Giovanni

rvanspaa
Posts: 11
Joined: Mon Apr 24, 2017 7:51 am

Re: [RFC] Raspberry PI

Postby rvanspaa » Wed Dec 06, 2017 10:36 pm

mostafa_hosseinzadeh wrote:
rvanspaa wrote:Hi,

• Download http://rvanspaa.freehostia.com/ChibiOS17.6_Changes.zip

Hi,


I want to run chibios on raspberry pi 3 but its not work, i copy kernel.img and bootcode.bin , start.elf but when i power on raspberry pi just display a rainbow image.
how can i run chibios on raspberry pi?


Hi,

The version at http://rvanspaa.freehostia.com/ is V17.6, but is only for the RPi (B+), not for RPi V3. For a 64 bit machine with multiple cores, and different base address(es), you would need to make a few changes.
The different memory layout is the most important thing.
I would guess that if the cores are ignored, it would run on just a single core, but I haven't tried this. You would also need to ensure you have a 64 bit compiler. I think the code that is written in assembler would also run on a 64 bit machine, but am not sure, so you would need to see for yourself.
BTW I have done nothing about HDMI. The code is essentially for a "headless" box. Use the serial connection.


Return to “Development and Feedback”

Who is online

Users browsing this forum: No registered users and 15 guests