I have built a cross-compiler for xtensa-esp32-elf. Several members of the telegram channel expressed interest in supporting Ada on this platform. I spent some time and built a toolchain using Alire’s scripts. Fabian then accepted my changes and this compiler is now available in the community index. Porting bareboard runtimes is still to come. If you are interested, join the telegram channel or leave your comments on the forum here.
If you want install the toolchain, run alr toolchain --select gnat_xtensa_esp32_elf
Beside toolchain you need a xtensa-dynconfig plugin:
Please excuse my ignorance (I’m trying to learn )…
What does not having an available runtime mean and does it apply to all ESP32 boards?
Does it mean you can’t use any Ada library code and you need to do programming on pure bare metal?
What is required to port an Ada runtime for ESP32? Just wondering if it’s something I could take on, for didactic reasons, or if it’s totally over my head for now
It mean that our toolchain for ESP32 is incomplete. We have only compiler, but not runtime (for any board). So with the compiler one could starting porting Ada runtime and build it: get libgnat.a and a bunch of *.ali file from runtime source files. Yje having compiler and runtime anyone could build and link an Ada application.
Without runtime you can’t compile any user’s compilation unit (package/subprogram), because it depends on Standard package that is part of runtime. During compilation the compiler reads System package to find target properties. In turn, runtime comes in several types. light runtime is most thin and most easy to port. It provides only basic support, you won’t be able to use tasks, protected object, but you can build an application. light-tasking runtime has support of tasks/protected object with some restrictions (See Ravenscar profile). To get full Ada you need full Ada runtime, that is very big and probably requires real OS underneath.
Porting runtime could be an interesting and you could find out mush about how it works. From my point of view it is not hard, at least for light runtime. You will need to find out
compiler flags for your particular chip
flash layout to create a linker script
number and names of interrupts to write interrupt vector (in assembly)
create a starter assembly chunk to initialize stack, clean bss memory section