Ada for xtensa esp32 (LX6/LX7) [DRAFT!]

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:

git clone https://github.com/jcmvbkbc/xtensa-dynconfig
git -C xtensa-dynconfig clone https://github.com/espressif/xtensa-overlays config
make -C xtensa-dynconfig
export XTENSA_GNU_CONFIG=$PWD/xtensa-dynconfig/xtensa_esp32s3.so
  • I’ve made a patch to bb-runtimes to make it simpler somebody to start working on the run time. If you want to try:
git clone -b esp32 https://github.com/reznikmm/bb-runtimes/
cd bb-runtimes
./build_rts.py --output=$HOME/.local/share/alire/toolchains/gnat_xtensa_esp32_elf_14.2.1_f8471bd4/xtensa-esp32-elf/lib/gnat --build esp32 --rts-src-descriptor ./gnat_rts_sources/lib/gnat/rts-sources.json

# Optionaly rebuild rts with debug info:

gprbuild -P $HOME/.local/share/alire/toolchains/gnat_xtensa_esp32_elf_14.2.1_f8471bd4/xtensa-esp32-elf/lib/gnat/light-esp32/runtime_build.gpr -XBUILD=Debug
  • Now you can try to build hello world and get linker errors, because some/many files are missing:
gprbuild --target=xtensa-esp32-elf --RTS=light-esp32 -P examples/hello-light/hello.gpr

Links:

2 Likes