Porting ChibiOS to ESP32

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.
InsanitySquared
Posts: 4
Joined: Sat Jun 06, 2020 5:11 am
Has thanked: 2 times

Porting ChibiOS to ESP32

Postby InsanitySquared » Sat Jun 06, 2020 5:16 am

Hello! I'm trying to port ChibiOS to the ESP32 MCU in order to run Ardupilot on it, and I am aware that there were prevoius attempts.

If I come accross any issues I will post them here.

Here is the fork: https://github.com/InsanitySquared/ChibiOS

Currenty, I'm a bit confused as to what is the PAL subsystem and what it does. Any help?
Thanks!

I know it is quite a major undertaking, but I'll try it anyways :D
Last edited by InsanitySquared on Sat Jun 06, 2020 5:36 am, edited 1 time in total.

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: Porting ChibiOS to ESP32

Postby Giovanni » Sat Jun 06, 2020 5:36 am

Hi,

InsanitySquared wrote:Currenty, I'm a bit confused as to what is the PAL subsystem and what it does. Any help?


PAL is a GPIO abstraction and the minor of your problems.

InsanitySquared wrote:I would also like some instructions on how to build the OS.


Creating a build environment (makefiles) is part of the port process. You may look at the ARM startup files which include makefiles, linker files and assembler startups, you need to start from there. Look into /os/common/startup/ARMCMx

After that you port the RTOS and that is the hardest part. Look into /os/common/ports/ARMCMx

HAL comes last and that can take months depending on which drivers you need/want. At very least you need clock initialization, PAL and Serial drivers.

Giovanni

InsanitySquared
Posts: 4
Joined: Sat Jun 06, 2020 5:11 am
Has thanked: 2 times

Re: Porting ChibiOS to ESP32

Postby InsanitySquared » Sat Jun 06, 2020 5:39 am

Right. Sounds great! Thanks for the prompt assistance! I will keep this topic updated.
I'll get back to PAL etc after setting up the basics.

steved
Posts: 823
Joined: Fri Nov 09, 2012 2:22 pm
Has thanked: 12 times
Been thanked: 135 times

Re: Porting ChibiOS to ESP32

Postby steved » Sat Jun 06, 2020 8:36 am

There has been a little prior discussion on this, and maybe some starter code; see this thread

InsanitySquared
Posts: 4
Joined: Sat Jun 06, 2020 5:11 am
Has thanked: 2 times

Re: Porting ChibiOS to ESP32

Postby InsanitySquared » Mon Jun 08, 2020 12:15 pm

Thanks. I was able to get to the ESP32's github page from that. Now all I have to do is reverse engineer the whole thing :shock: No biggie :D

I was able to setup a build environment using Cmake. Will go on from there.

InsanitySquared
Posts: 4
Joined: Sat Jun 06, 2020 5:11 am
Has thanked: 2 times

Re: Porting ChibiOS to ESP32

Postby InsanitySquared » Fri Jun 12, 2020 11:51 am

So, after quite a bit of scouring google and red herrings, I struck gold:
https://www.espressif.com/sites/default ... ual_en.pdf
^^The technical specs
https://vivonomicon.com/2019/03/30/gett ... ogramming/
^^and an amazing blog that's going to be REALLY helpful.

I wont be setting a blazingly fast trail or attempting to break any development speed records, but the project is going on, and updates will come here :D

As @Giovanni suggested I'll start with the RTOS (first RT then maybe later NIL). To do this, again like @Giovanni I'll get to work on timers. Thanks @Giovanni !!

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: Porting ChibiOS to ESP32

Postby Giovanni » Fri Jun 12, 2020 12:48 pm

Hi,

Glad to hear there is progress, just a note, if you port RT then also NIL should work, those use the same port module.

Giovanni

davidbuzz
Posts: 19
Joined: Tue Nov 13, 2018 7:06 am
Has thanked: 1 time
Been thanked: 1 time

Re: Porting ChibiOS to ESP32

Postby davidbuzz » Fri Apr 09, 2021 3:39 am

Since the Original poster was trying to port ArduPilot to esp32, i thought i'd point out that a few of us got it running via a less-than-optimal FreeRTOS intermediate layer.... the code is not great, but its good enough to fly a plane/copter/sub at this point.... a ChibiOS port would have been much better, but no-one with the low-level ChibiOS experience stepped forward to do that layer...
https://github.com/davidbuzz/ardupilot/ ... _HAL_ESP32

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: Porting ChibiOS to ESP32

Postby Giovanni » Fri Apr 09, 2021 5:08 pm

The original poster went silent so it is safe to assume there has been no progress. A port is not out of question but we have finite bandwidth and there are other things ongoing.

BTW, we recently ported RT to the dual core RP2040, the OS now is able to support SMP architectures, ESP32 would be a good fit.

Giovanni


Return to “Development and Feedback”

Who is online

Users browsing this forum: No registered users and 11 guests