likeablob / ulptool-pio

A thin wrapper of ulptool for PlatformIO
6 stars 6 forks source link

Compilation problems KeyError : 'toolchain-xtensa32' #2

Open chyparo opened 2 years ago

chyparo commented 2 years ago

I have problem to compile any working code from the past and even an example. The compiler terminates with this error:

> Executing task in folder ulp-counter: platformio run --target upload <

Processing esp32dev (board: esp32dev; platform: espressif32; framework: arduino)
--------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32dev.html
PLATFORM: Espressif 32 (4.2.0) > Espressif ESP32 Dev Module
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (cmsis-dap) External (cmsis-dap, esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES: 
 - framework-arduinoespressif32 @ 3.20002.220503 (2.0.2) 
 - tool-esptoolpy @ 1.30300.0 (3.3.0) 
 - tool-mkfatfs @ 2.0.1 
 - tool-mklittlefs @ 1.203.210628 (2.3) 
 - tool-mkspiffs @ 2.230.0 (2.30) 
 - toolchain-esp32ulp @ 1.22851.191205 (2.28.51) 
 - toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch3
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 32 compatible libraries
Scanning dependencies...
Dependency Graph
|-- ulptool-pio @ 0.1.0+sha.7c5dd85
Building in release mode
Compiling .pio/build/esp32dev/src/ulp_counter.cpp.o
Generating partitions .pio/build/esp32dev/partitions.bin
Archiving .pio/build/esp32dev/libFrameworkArduinoVariant.a
Indexing .pio/build/esp32dev/libFrameworkArduinoVariant.a
Compiling .pio/build/esp32dev/FrameworkArduino/Esp.cpp.o
Compiling .pio/build/esp32dev/FrameworkArduino/FirmwareMSC.cpp.o
Compiling .pio/build/esp32dev/FrameworkArduino/FunctionalInterrupt.cpp.o
Compiling .pio/build/esp32dev/FrameworkArduino/HWCDC.cpp.o
Compiling .pio/build/esp32dev/FrameworkArduino/HardwareSerial.cpp.o
Compiling .pio/build/esp32dev/FrameworkArduino/IPAddress.cpp.o
Compiling .pio/build/esp32dev/FrameworkArduino/IPv6Address.cpp.o
Compiling .pio/build/esp32dev/FrameworkArduino/MD5Builder.cpp.o
Compiling .pio/build/esp32dev/FrameworkArduino/Print.cpp.o
Compiling .pio/build/esp32dev/FrameworkArduino/Stream.cpp.o
Compiling .pio/build/esp32dev/FrameworkArduino/StreamString.cpp.o
Compiling .pio/build/esp32dev/FrameworkArduino/USB.cpp.o
Compiling .pio/build/esp32dev/FrameworkArduino/USBCDC.cpp.o
Compiling .pio/build/esp32dev/FrameworkArduino/USBMSC.cpp.o
Compiling .pio/build/esp32dev/FrameworkArduino/WMath.cpp.o
Compiling .pio/build/esp32dev/FrameworkArduino/WString.cpp.o
Compiling .pio/build/esp32dev/FrameworkArduino/base64.cpp.o
Compiling .pio/build/esp32dev/FrameworkArduino/cbuf.cpp.o
Compiling .pio/build/esp32dev/FrameworkArduino/esp32-hal-adc.c.o
Compiling .pio/build/esp32dev/FrameworkArduino/esp32-hal-bt.c.o
Compiling .pio/build/esp32dev/FrameworkArduino/esp32-hal-cpu.c.o
Compiling .pio/build/esp32dev/FrameworkArduino/esp32-hal-dac.c.o
Compiling .pio/build/esp32dev/FrameworkArduino/esp32-hal-gpio.c.o
Compiling .pio/build/esp32dev/FrameworkArduino/esp32-hal-i2c-slave.c.o
Compiling .pio/build/esp32dev/FrameworkArduino/esp32-hal-i2c.c.o
Compiling .pio/build/esp32dev/FrameworkArduino/esp32-hal-ledc.c.o
Compiling .pio/build/esp32dev/FrameworkArduino/esp32-hal-matrix.c.o
Compiling .pio/build/esp32dev/FrameworkArduino/esp32-hal-misc.c.o
Compiling .pio/build/esp32dev/FrameworkArduino/esp32-hal-psram.c.o
Compiling .pio/build/esp32dev/FrameworkArduino/esp32-hal-rmt.c.o
Compiling .pio/build/esp32dev/FrameworkArduino/esp32-hal-sigmadelta.c.o
Compiling .pio/build/esp32dev/FrameworkArduino/esp32-hal-spi.c.o
Compiling .pio/build/esp32dev/FrameworkArduino/esp32-hal-time.c.o
Compiling .pio/build/esp32dev/FrameworkArduino/esp32-hal-timer.c.o
Compiling .pio/build/esp32dev/FrameworkArduino/esp32-hal-tinyusb.c.o
Compiling .pio/build/esp32dev/FrameworkArduino/esp32-hal-touch.c.o
Compiling .pio/build/esp32dev/FrameworkArduino/esp32-hal-uart.c.o
Compiling .pio/build/esp32dev/FrameworkArduino/firmware_msc_fat.c.o
Compiling .pio/build/esp32dev/FrameworkArduino/libb64/cdecode.c.o
Compiling .pio/build/esp32dev/FrameworkArduino/libb64/cencode.c.o
Compiling .pio/build/esp32dev/FrameworkArduino/main.cpp.o
Compiling .pio/build/esp32dev/FrameworkArduino/stdlib_noniso.c.o
Compiling .pio/build/esp32dev/FrameworkArduino/wiring_pulse.c.o
Compiling .pio/build/esp32dev/FrameworkArduino/wiring_shift.c.o
Archiving .pio/build/esp32dev/libFrameworkArduino.a
Indexing .pio/build/esp32dev/libFrameworkArduino.a
cb([".pio/build/esp32dev/firmware.elf"], [".pio/build/esp32dev/src/ulp_counter.cpp.o"])
Running ulptool
*** [.pio/build/esp32dev/firmware.elf] KeyError : 'toolchain-xtensa32'
Traceback (most recent call last):
  File "/home/pavel/.platformio/packages/tool-scons/scons-local-4.3.0/SCons/Action.py", line 1279, in execute
    result = self.execfunction(target=target, source=rsources, env=env)
  File "/home/pavel/Dokumenty/PlatformIO/Projects/ulp-counter/.pio/libdeps/esp32dev/ulptool-pio/post_extra_script_ulptool.py", line 59, in cb
    run_ulptool()
  File "/home/pavel/Dokumenty/PlatformIO/Projects/ulp-counter/.pio/libdeps/esp32dev/ulptool-pio/post_extra_script_ulptool.py", line 24, in run_ulptool
    toolchain_xtensa_dir = platform.get_package_dir("toolchain-xtensa32")
  File "/home/pavel/.platformio/penv/lib/python3.8/site-packages/platformio/platform/_packages.py", line 32, in get_package_dir
    pkg = self.get_package(name)
  File "/home/pavel/.platformio/penv/lib/python3.8/site-packages/platformio/platform/_packages.py", line 29, in get_package
    return self.pm.get_package(spec or self.get_package_spec(name))
  File "/home/pavel/.platformio/penv/lib/python3.8/site-packages/platformio/platform/_packages.py", line 21, in get_package_spec
    owner=self.packages[name].get("owner"),
KeyError: 'toolchain-xtensa32'

================================ [FAILED] Took 3.63 seconds ================================ Proces terminálu platformio 'run', '--target', 'upload' byl ukončen s ukončovacím kódem: 1.

daeynasvistas commented 2 years ago

Same

maxgerhardt commented 2 years ago

The toolchain was renamed, it for an ESP32 (not S2, C2 or C3 etc.) the line

https://github.com/likeablob/ulptool-pio/blob/6d4c5c51c13ca5a371edf96cfaf1fa2f2194ba88/post_extra_script_ulptool.py#L24

should be

    toolchain_xtensa_dir = platform.get_package_dir("toolchain-xtensa32-esp32")

instead

maxgerhardt commented 2 years ago

A safe alternative is setting platform = espressif32@3.5.0 in the platformio.ini of the project to revert back to the known working platform with the previously named toolchain.

daeynasvistas commented 2 years ago

seems to pass error .. but new one now:

image

problably need to change PATH to reduce char

The command line is too long.

daeynasvistas commented 2 years ago

Using

A safe alternative is setting platform = espressif32@3.5.0 in the platformio.ini of the project to revert back to the known working platform with the previously named toolchain.

Then replacing all the _error_string = cmd[0] + '\r' + err errorstring = cmd[0] + '\r' + err.decode('utf-8')

using, for "The command line is too long" error

[platformio]
packages_dir = C:\\pio

i have new problem.. it may be python vers. related .. but unable to fix it

image

Processing esp32dev (platform: espressif32@3.5.0; board: esp32dev; framework: arduino) -------------------------------------------------------------------------------------------------------------------Verbose mode can be enabled via-v, --verbose` option

CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32dev.html
PLATFORM: Espressif 32 (3.5.0) > Espressif ESP32 Dev Module
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (esp-prog) External (esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES:
 - framework-arduinoespressif32 @ 3.10006.210326 (1.0.6)
 - tool-esptoolpy @ 1.30100.210531 (3.1.0)
 - toolchain-esp32ulp @ 1.22851.191205 (2.28.51)
 - toolchain-xtensa32 @ 2.50200.97 (5.2.0)
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 45 compatible libraries
Scanning dependencies...
Dependency Graph
|-- ulptool-pio @ 0.1.0+sha.6d4c5c5
Building in release mode
cb([".pio\build\esp32dev\firmware.elf"], [".pio\build\esp32dev\src\ulp_counter.cpp.o"])
Running ulptool
C:\Users\administrator\.platformio\penv\Scripts\python.exe C:\ULP_pulse\.pio\libdeps\esp32dev\ulptool-pio/src/esp32ulp_build_recipe.py -IC:\ULP_pulse\ulp -IC:\ULP_pulse\.pio\libdeps\esp32dev\ulptool-pio\src\include\ulptool -IC:\ULP_pulse\.pio\libdeps\esp32dev\ulptool-pio\src\ulpcc\include -IC:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\config -IC:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\app_trace -IC:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\app_update -IC:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\asio -IC:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\bootloader_support -IC:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\bt -IC:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\coap -IC:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\console -IC:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\driver -IC:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\efuse -IC:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\esp-tls -IC:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\esp32 -IC:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\esp_adc_cal -IC:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\esp_event -IC:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\esp_http_client -IC:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\esp_http_server -IC:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\esp_https_ota -IC:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\esp_https_server -IC:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\esp_ringbuf -IC:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\esp_websocket_client -IC:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\espcoredump -IC:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\ethernet -IC:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\expat -IC:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\fatfs -IC:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\freemodbus -IC:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\freertos -IC:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\heap -IC:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\idf_test -IC:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\jsmn -IC:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\json -IC:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\libsodium -IC:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\log -IC:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\lwip -IC:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\mbedtls -IC:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\mdns -IC:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\micro-ecc -IC:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\mqtt -IC:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\newlib -IC:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\nghttp -IC:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\nvs_flash -IC:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\openssl -IC:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\protobuf-c -IC:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\protocomm -IC:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\pthread -IC:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\sdmmc -IC:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\smartconfig_ack -IC:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\soc -IC:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\spi_flash -IC:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\spiffs -IC:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\tcp_transport -IC:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\tcpip_adapter -IC:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\ulp -IC:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\unity -IC:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\vfs -IC:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\wear_levelling -IC:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\wifi_provisioning -IC:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\wpa_supplicant -IC:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\xtensa-debug-module -IC:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\esp-face -IC:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\esp32-camera -IC:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\esp-face -IC:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\fb_gfx -IC:\pio\framework-arduinoespressif32@3.10006.210326\cores\esp32 -IC:\pio\framework-arduinoespressif32@3.10006.210326\variants\esp32 -b C:\ULP_pulse -p C:\pio\framework-arduinoespressif32@3.10006.210326 -u C:\pio\toolchain-esp32ulp/bin -x 
C:\pio\toolchain-xtensa32/bin -t C:\ULP_pulse\.pio\libdeps\esp32dev\ulptool-pio/src/ --DARDUINO_ESP32_DEV --DARDUINO=10805 --DARDUINO_ARCH_ESP32 --DARDUINO_VARIANT=\"esp32\" --DARDUINO_BOARD=\"Espressif\ ESP32\ Dev\ Module\"      
C:\pio\toolchain-xtensa32/bin\xtensa-esp32-elf-gcc -DESP_PLATFORM -MMD -MP -DWITH_POSIX -DMBEDTLS_CONFIG_FILE=mbedtls\esp_config.h -DHAVE_CONFIG_H -MT ulp_main.common.ld -E -P -xc -o ulp_main.common.ld -I C:\ULP_pulse\ulp -I C:\ULP_pulse\.pio\libdeps\esp32dev\ulptool-pio\src\include\ulptool -I C:\ULP_pulse\.pio\libdeps\esp32dev\ulptool-pio\src\ulpcc\include -I C:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\config -I C:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\app_trace -I C:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\app_update -I C:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\asio -I C:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\bootloader_support -I C:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\bt -I C:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\coap -I C:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\console -I C:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\driver -I C:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\efuse -I C:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\esp-tls -I C:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\esp32 -I C:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\esp_adc_cal -I C:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\esp_event -I C:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\esp_http_client -I C:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\esp_http_server -I C:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\esp_https_ota -I C:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\esp_https_server -I C:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\esp_ringbuf -I C:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\esp_websocket_client -I C:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\espcoredump -I C:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\ethernet -I C:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\expat -I C:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\fatfs -I C:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\freemodbus -I C:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\freertos -I C:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\heap -I C:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\idf_test -I C:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\jsmn -I C:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\json -I C:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\libsodium -I C:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\log -I C:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\lwip -I C:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\mbedtls -I C:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\mdns -I C:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\micro-ecc -I C:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\mqtt -I C:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\newlib -I C:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\nghttp -I C:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\nvs_flash -I C:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\openssl -I C:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\protobuf-c -I C:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\protocomm -I C:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\pthread -I C:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\sdmmc -I C:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\smartconfig_ack -I C:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\soc -I C:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\spi_flash -I C:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\spiffs -I C:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\tcp_transport -I C:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\tcpip_adapter -I C:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\ulp -I C:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\unity -I C:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\vfs -I C:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\wear_levelling -I C:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\wifi_provisioning -I C:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\wpa_supplicant -I C:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\xtensa-debug-module -I C:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\esp-face -I C:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\esp32-camera -I C:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\esp-face -I C:\pio\framework-arduinoespressif32@3.10006.210326\tools\sdk\include\fb_gfx -I C:\pio\framework-arduinoespressif32@3.10006.210326\cores\esp32 -I C:\pio\framework-arduinoespressif32@3.10006.210326\variants\esp32 -DARDUINO_ESP32_DEV -DARDUINO=10805 -DARDUINO_ARCH_ESP32 -DARDUINO_VARIANT="esp32" -DARDUINO_BOARD="Espressif\ -I C:\ULP_pulse\ulp -D__ASSEMBLER__ C:\ULP_pulse\.pio\libdeps\esp32dev\ulptool-pio/src/ld\esp32.ulp.ld
<command-line>:0:15: warning: missing terminating " character

*** Error 1
*** [.pio\build\esp32dev\firmware.elf] Exception : An error returned by ulptool.
Traceback (most recent call last):
  File "C:\pio\tool-scons\scons-local-4.3.0\SCons\Action.py", line 1279, in execute
    result = self.execfunction(target=target, source=rsources, env=env)
  File "C:\ULP_pulse\.pio\libdeps\esp32dev\ulptool-pio\post_extra_script_ulptool.py", line 59, in cb
    run_ulptool()
  File "C:\ULP_pulse\.pio\libdeps\esp32dev\ulptool-pio\post_extra_script_ulptool.py", line 54, in run_ulptool      
    raise Exception("An error returned by ulptool.")
Exception: An error returned by ulptool.
=========================================== [FAILED] Took 3.84 seconds ===========================================
The terminal process "C:\Users\administrator\.platformio\penv\Scripts\platformio.exe 'run'" terminated with exit code: 1.

Terminal will be reused by tasks, press any key to close it.`
powelllens commented 2 years ago

where did you modify the Python script? I didn't find a place that contains the line of code error_string = cmd[0] + '\r' + err error_string = cmd[0] + '\r' + err.decode('utf-8') shown above. For the rest i'm motivated to work on an updated version.

daeynasvistas commented 2 years ago

where did you modify the Python script? I didn't find a place that contains the line of code error_string = cmd[0] + '\r' + err error_string = cmd[0] + '\r' + err.decode('utf-8') shown above. For the rest i'm motivated to work on an updated version.

https://github.com/likeablob/ulptool-pio/blob/feat-pio-integration/src/esp32ulp_build_recipe.py

powelllens commented 2 years ago

I tried to fix most of the issues on Windows, you can find the fork here: https://github.com/powelllens/ulptool-pio

Unfortunately i was unable to get the ulp_Readme running. Seems to be one of the most common issues: undefined reference to 'ulp_count'

I noticed many broken links and references: https://github.com/powelllens/ulptool-pio/blob/e6f504824dc01488ab3f960b2c379e425f62783b/src/esp32ulp_build_recipe.py#L340 https://github.com/powelllens/ulptool-pio/blob/e6f504824dc01488ab3f960b2c379e425f62783b/src/esp32ulp_build_recipe.py#L373

These links to files and locations have been changed since the last running version. Currently I'm not sure if all links are correctly redirected 'tools', 'sdk', 'esp32', 'include', 'soc', 'esp32', 'include', 'soc') old-> #\tools\sdk\include\soc 'tools', 'sdk', 'esp32', 'include', 'soc', 'include', 'soc') old -> #\tools\sdk\include\soc\soc

While comparing the @3.5.0 and newest version i noticed many more files missing and bad links which might end up in the broken build. The ASM Build process seems to run fine, but the rest (linking to the project) is broken and I do not see any change to correct this by myself. I would need detailed information about the purpose of the files and the new position.

As an example: since v2.0.0 the files esp32.ld and esp32_out.ld are gone but still linked in the Recipe Build.

daeynasvistas commented 2 years ago

finally! .. thanks @powelllens

reinstall all, in new machine.. windows, Vscode platformio.. all then compilation show me SUCCESS

image

ssriblo commented 2 years ago

Hello, examples passed well when switch to platform = espressif32@3.5.0 My setup is Linux But I need current platform = espressif32 version, and faces this issue: FileNotFoundError: [Errno 2] No such file or directory: '~/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/config/sdkconfig.h' Looking at script .pio/libdeps/esp32dev/ulptool-pio/src/esp32ulp_build_recipe.py and can not understand, it's passed sdkconfig.h file open at line #175 and failed at the very similar line #269

I am grateful in advance for any help

UPDATE: Dirty Hack: create folder ~/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/config and copy sdkconfig.h file from ~/.platformio/packages/framework-arduinoespressif32/tools/sdk/esp32/qio_qspi/include

xtrinch commented 1 year ago

@ssriblo It builds with platform = espressif32@~5.2.0 wihout the dirty hack if you put sdk_hash = md5(os.path.join(PATHS['core'] , 'tools', 'sdk', 'esp32', 'dio_qspi', 'include', 'sdkconfig.h')) into https://github.com/likeablob/ulptool-pio/blob/6d4c5c51c13ca5a371edf96cfaf1fa2f2194ba88/src/esp32ulp_build_recipe.py#L269 and https://github.com/likeablob/ulptool-pio/blob/6d4c5c51c13ca5a371edf96cfaf1fa2f2194ba88/src/esp32ulp_build_recipe.py#L175

and ofcourse toolchain_xtensa_dir = platform.get_package_dir("toolchain-xtensa-esp32") into https://github.com/likeablob/ulptool-pio/blob/6d4c5c51c13ca5a371edf96cfaf1fa2f2194ba88/post_extra_script_ulptool.py#L24

xtrinch commented 1 year ago

Okay so I created a PR with the changes I needed to make to make it compile: https://github.com/likeablob/ulptool-pio/pull/3

likeablob commented 1 year ago

Hi guys, sry for the late reply. I'm gonna merge PR #3 from @xtrinch .

For the sdkconfig.h related issue, I guess the framework generates separate .hs depending on board_build.flash_mode = qio | qout | dio | dout (doc).

$ find  ~/.platformio/packages/framework-arduinoespressif32@3.20004.0/tools/sdk/esp32/ -iname sdkconfig.h
~/.platformio/packages/framework-arduinoespressif32@3.20004.0/tools/sdk/esp32/qio_qspi/include/sdkconfig.h
~/.platformio/packages/framework-arduinoespressif32@3.20004.0/tools/sdk/esp32/dio_qspi/include/sdkconfig.h
~/.platformio/packages/framework-arduinoespressif32@3.20004.0/tools/sdk/esp32/dout_qspi/include/sdkconfig.h
~/.platformio/packages/framework-arduinoespressif32@3.20004.0/tools/sdk/esp32/qout_qspi/include/sdkconfig.h

If so, passing the flash_mode value to esp32ulp_build_recipe.py or just calculating and concatenating all the file hashes would be preferable.

daeynasvistas commented 1 year ago

toolchain_xtensa_dir = platform.get_package_dir("toolchain-xtensa-esp32")

i get "the command line is too long" when using your workaround

image

maxgerhardt commented 1 year ago

Try with example from #4.

daeynasvistas commented 1 year ago

Try with example from #4.

Thanks.

ok, so i have mix problem now. It seems that the compilation are OK now.

[env]
platform = espressif32@5.3.0

and

lib_deps =
  https://github.com/maxgerhardt/ulptool-pio.git

i didnt see the python script execution in terminal? is this normal?

EDIT: its working!! just need to adapt my code from 3.5 to the 5.3