Failing to get ULP examples working on ESP32-S3

After failing misserably with this code:
platform-espressif32/examples/espidf-ulp-pulse/

I am now working with this code:
https://github.com/powelllens/ulptool-pio

And specifically with the ulp-counter example code (unchanged from the example).

And referring to the patient work here:
https://community.platformio.org/t/ulp-undefined-reference-to/31343/20

It builds for env:ESP32 but when I try to go up to ESP32-S3, no joy.

my platformio.ini:

[env:esp32-s3-devkitc-1]
platform = espressif32
board = esp32-s3-devkitc-1
framework = arduino
;framework = espidf
monitor_speed = 115200
upload_speed = 921600
build_flags = 
   -I./src/
   -I./src/ulp/

lib_ldf_mode = deep
lib_extra_dirs = ~/Documents/Arduino/libraries
lib_deps = 
	https://github.com/powelllens/ulptool-pio#pio/0.1.0
extra_scripts =
    pre:$PROJECT_LIBDEPS_DIR/$PIOENV/ulptool-pio/pre_extra_script_ulptool.py
    post:$PROJECT_LIBDEPS_DIR/$PIOENV/ulptool-pio/post_extra_script_ulptool.py

Errors at build time:

In file included from src/ulp_counter.cpp:8:
.pio/libdeps/esp32-s3-devkitc-1/ulptool-pio/src/include/ulptool/ulptool.h: In function 'esp_err_t ulptool_load_binary(uint32_t, const uint8_t*, size_t)':
.pio/libdeps/esp32-s3-devkitc-1/ulptool-pio/src/include/ulptool/ulptool.h:29:25: error: 'CONFIG_ULP_COPROC_RESERVE_MEM' was not declared in this scope
   if (load_addr_bytes > CONFIG_ULP_COPROC_RESERVE_MEM) {
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.pio/libdeps/esp32-s3-devkitc-1/ulptool-pio/src/include/ulptool/ulptool.h:29:25: note: suggested alternative: 'CONFIG_ESP32S3_ULP_COPROC_RESERVE_MEM'
   if (load_addr_bytes > CONFIG_ULP_COPROC_RESERVE_MEM) {
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                         CONFIG_ESP32S3_ULP_COPROC_RESERVE_MEM
.pio/libdeps/esp32-s3-devkitc-1/ulptool-pio/src/include/ulptool/ulptool.h:33:46: error: 'CONFIG_ULP_COPROC_RESERVE_MEM' was not declared in this scope
   if (load_addr_bytes + program_size_bytes > CONFIG_ULP_COPROC_RESERVE_MEM) {
                                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.pio/libdeps/esp32-s3-devkitc-1/ulptool-pio/src/include/ulptool/ulptool.h:33:46: note: suggested alternative: 'CONFIG_ESP32S3_ULP_COPROC_RESERVE_MEM'
   if (load_addr_bytes + program_size_bytes > CONFIG_ULP_COPROC_RESERVE_MEM) {
                                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                              CONFIG_ESP32S3_ULP_COPROC_RESERVE_MEM
*** [.pio\build\esp32-s3-devkitc-1\src\ulp_counter.cpp.o] Error 1

Anyone been able to get the ULP examples working with S3 and have any advice?

Hi @petedd ! I’m not sure it’s possible with the Arduino framework. The latest Arduino core v2.0.7 is based on IDF v4.4 and according to this topic the ULP in ESP32-S3 was not supported at that moment.

Thank you Valeros. That is very unfortunate. I can try the idf framework but then I guess I will have to figure out what dependencies I have on Arduino.h and prepare a different .h to work with code I already have (big project).