Nesper the library for Nim on ESP32's now includes some build tasks that help compile and build Nim for ESP-IDF projects (the Espressif software for ESP32's). This greatly simplifies setting up new embedded projects for ESP32's. I'm hoping to use this pattern more broadly for other FreeRTOS and MCU targets. Any feedback or tips would be appreciated.
The updated instructions can be found on the project page on GitHub: https://github.com/elcritch/nesper
Essentially it boils down to installing the nesper library using Nimble and then adding a few lines to the nimble file:
requires "nesper >= 0.6.0"
# includes nimble tasks for building Nim esp-idf projects
include nesper/build_utils/tasks
This results in several new tasks:
$ nimble tasks
esp_list_templates List templates available for setup
esp_setup Setup a new esp-idf / nesper project structure
esp_install_headers Install nim headers
esp_clean Clean nimcache
esp_compile Compile Nim project for esp-idf program
esp_build Build esp-idf project
It's likely not the most efficient implementation, but it's working fairly well without needing to dive deep into the guts of CMake. :-)
Thanks! Unfortunately no, the ESP8266 uses an entirely different code base from the one for ESP32's. On the upside, the new FreeRTOS based ESP-IDF looks to be their main platform for all future chips and possibly the ESP8266 at some point.
Though some of the newer ESP32 chips are pretty cheap so it might be easier to switch chips. The new ESP32-S2's seem to be meant somewhat as a replacement for the ESP8266's (though I've never used the esp8266's).