ESP32

ChibiOS public support forum for topics related to the Espressif ESP32 family of micro-controllers.
avrhack
Posts: 140
Joined: Tue Dec 24, 2013 1:42 pm
Has thanked: 17 times
Been thanked: 3 times

Re: ESP32

Postby avrhack » Tue Nov 13, 2018 4:15 pm

I'd be interested in ChibiOS on the esp8266 as well as the esp32 - maybe we could do both at the same time? Or do the differences make that impractical ie we really need to treat them as two totally separate ports?

meminyanik
Posts: 1
Joined: Mon Feb 26, 2018 7:07 am

Re: ESP32

Postby meminyanik » Tue Nov 13, 2018 9:07 pm

I am not experienced in very low level coding of RTOS. But I have been working on ESP32 running freeRTOS for long time. I would be happy to help for this porting process.

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: ESP32

Postby Giovanni » Tue Nov 13, 2018 9:47 pm

So lets start from the start :)

We need:
1) Core documentation, for the "port layer".
2) Compiler, is GCC available? something else? is it available also for Linux?

Giovanni

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

Re: ESP32

Postby davidbuzz » Wed Nov 14, 2018 1:43 am

59page datasheet is here, including memory map, clocks, ram, pin descriptions, block diagram, and links to other good resources etc)
http://espressif.com/sites/default/file ... eet_en.pdf

More details here:
https://www.espressif.com/en/products/h ... 2/overview

C and c++ compiler definitely available, as this chip already runs FreeRTOS etc and has a port of the Arduino Libraries that is fully featured.

I recommend we start by targeting a well known dev board with an esp32 on it, such as the esp-vroom-32 'devkit v1' .

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

Re: ESP32

Postby davidbuzz » Wed Nov 14, 2018 3:24 am

details of gcc available:
xtensa-esp32-elf-* for linux here: https://dl.espressif.com/doc/esp-idf/la ... setup.html
( windows is also available at a similar place).

xtensa-esp32-elf/bin$ ./xtensa-esp32-elf-gcc --version
xtensa-esp32-elf-gcc (crosstool-NG crosstool-ng-1.22.0-73-ge28a011) 5.2.0

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

Re: ESP32

Postby davidbuzz » Wed Nov 14, 2018 5:10 am

I'd just like to also point out that as I understand it, the "hard" part of a port to a new chip is the context switching ( because the chibios wiki says so ).... and this particular goal ( getting it running on esp32) can benefit heavily from the fact that freeRTOS already runs on the chip, and is already open source, and already does context switching successfully, and is MIT licensed, and thus "GPL compatible" from a license perspective, and so it's proposal that the freertos code be referenced and used freely as much as convenient to achieve this goal, and the resulting code can still be GPLv3 licensed.

references:
https://www.esp32.com/viewtopic.php?t=4296
https://www.freertos.org/a00114.html
https://www.gnu.org/licenses/license-li ... leLicenses

please let me know if anyone disagrees, as IANAL.

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: ESP32

Postby Giovanni » Wed Nov 14, 2018 6:09 am

ChibiOS does context switching differently, not sure if we can use that as reference. In ChibiOS context switch is synchronous and performed within a critical section, only function-preserved registers are switched (port_intctx structure). The other registers are placed into a port_extctx structure which is only saved by ISRs.

What is needed for a port are:
1) Manual of the core architecture (registers, instruction set, exceptions management, stacks etc).
2) ABI of the compiler (registers used for parameters, return values, function-trashed registers, etc).

What needs to be defined are:
- Format of the port_intctx and port_extctx structures.
- How critical sections are implemented (it could be disabling IRQs in its simplest way).
- Conventions for ISRs.
- Assembler thread startup code.
- Assembler context switch code.
- Vectors table.
- Startup files.

See the PowerPC port for a "simple" example.

Giovanni

Marco
Posts: 128
Joined: Tue Apr 16, 2013 8:22 pm
Has thanked: 4 times
Been thanked: 11 times

Re: ESP32

Postby Marco » Wed Nov 14, 2018 7:28 am

Hi,

This was also on my todo/wish list :) if I have some free time i’d also like to contribute! Nice to see there are more people interested.
I did the Tiva port long time ago. That one was based on the already existing Cortex-M4 port, so it was mostly writing HAL. Context switching will be most tricky I think.

Marco

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: ESP32

Postby Giovanni » Wed Nov 14, 2018 11:15 am

I just created the forum (icon missing), moving this topic there.

Anybody volunteering as moderator? not much to do anyway, usually I cut problems "at the root".

Giovanni

avrhack
Posts: 140
Joined: Tue Dec 24, 2013 1:42 pm
Has thanked: 17 times
Been thanked: 3 times

Re: ESP32

Postby avrhack » Wed Nov 14, 2018 2:34 pm

Giovanni wrote:I just created the forum (icon missing), moving this topic there.

Anybody volunteering as moderator? not much to do anyway, usually I cut problems "at the root".

Giovanni


I’m not working at the moment so I have the time potentially. What’s involved in moderation?


Return to “ESP32 Support”

Who is online

Users browsing this forum: No registered users and 4 guests