Blockstream / Jade

Jade hardware wallet
MIT License
312 stars 46 forks source link

M5Stick C Plus 2 ERROR_INVALIDFW #151

Closed 1v9Cidjei closed 3 weeks ago

1v9Cidjei commented 3 weeks ago

Hello everyone! I'm facing a problem when trying to update my M5Stick C Plus 2. I had initially installed the @3rdIteration version, it worked perfectly, including Secure Boot. Yesterday I saw that the version had been released here in the official repository and I tried to update the firmware, but when I try to do it, the following message appears on the device and in the command line: ERROR_INVALIDFW. The signing keys are correct, I've already done tests that confirmed this. Yesterday I spent the whole day trying but without success. If anyone has any idea how to help me, I would be very grateful!

JamieDriver commented 3 weeks ago

We use 'secure boot' and 'flash encryption' with the production Blockstream Jade devices, without issue. The sdkconfig files we use are in the 'production/' directory.

I've not tried to use it on any sort of 'diy' hw so no idea how well it works, but can't immediately see why it shouldn't. At what stage does that error appear ? Before you've been asked to confirm the OTA on Jade, mid-way through, or right at the end ?

Did you initially build with any logging on ? If so, is here any useful logging to be gleaned ?? ( eg. ./update_jade_fw.py --log INFO --fwfile <fw file to upload> )

How did you prepare the fw file to upload ?

If you could use a command-line tool and include the shell input/output I'll try to take a look - I don't think ERROR_INVALIDFW is raised in many places - usually when it thinks the fw-image is not appropriate for the hw (ie. not signature-related afaik).

1v9Cidjei commented 3 weeks ago

The error appears a few seconds after I send the command 'python jade_ota.py --noagent'.

`Setting PYTHONNOUSERSITE, was not set Using Python in C:\Espressif\python_env\idf5.2_py3.11_env\Scripts\ Python 3.11.9 Using Git in C:\Espressif\tools\idf-git\2.44.0\cmd\ git version 2.44.0.windows.1 Checking Python compatibility Setting IDF_PATH: C:\Espressif\frameworks\esp-idf-v5.2.2

Adding ESP-IDF tools to PATH... C:\Espressif\tools\xtensa-esp-elf-gdb\14.2_20240403\xtensa-esp-elf-gdb\bin C:\Espressif\tools\riscv32-esp-elf-gdb\14.2_20240403\riscv32-esp-elf-gdb\bin C:\Espressif\tools\xtensa-esp-elf\esp-13.2.0_20230928\xtensa-esp-elf\bin C:\Espressif\tools\riscv32-esp-elf\esp-13.2.0_20230928\riscv32-esp-elf\bin C:\Espressif\tools\esp32ulp-elf\2.35_20220830\esp32ulp-elf\bin C:\Espressif\tools\cmake\3.24.0\bin C:\Espressif\tools\openocd-esp32\v0.12.0-esp32-20240318\openocd-esp32\bin C:\Espressif\tools\ninja\1.11.1\ C:\Espressif\tools\idf-exe\1.0.3\ C:\Espressif\tools\ccache\4.8\ccache-4.8-windows-x86_64 C:\Espressif\tools\dfu-util\0.11\dfu-util-0.11-win64 C:\Espressif\frameworks\esp-idf-v5.2.2\tools

Checking if Python packages are up to date... Constraint file: C:\Espressif\espidf.constraints.v5.2.txt Requirement files:

Done! You can now compile ESP-IDF projects. Go to the project directory and run:

idf.py build

C:\Espressif\frameworks\esp-idf-v5.2.2>cd jade

C:\Espressif\frameworks\esp-idf-v5.2.2\Jade>python ./tools/mkdefaults.py ./sdkconfig.defaults NDEBUG Executing action: reconfigure Running cmake in directory C:\Espressif\frameworks\esp-idf-v5.2.2\Jade\build Executing "cmake -G Ninja -DPYTHON_DEPS_CHECKED=1 -DPYTHON=C:\Espressif\python_env\idf5.2_py3.11_env\Scripts\python.exe -DESP_PLATFORM=1 -DSDKCONFIG_DEFAULTS=./sdkconfig.defaults.tmp -DCCACHE_ENABLE=1 C:\Espressif\frameworks\esp-idf-v5.2.2\Jade"... -- IDF_TARGET not set, using default target: esp32 -- Found Git: C:/Espressif/tools/idf-git/2.44.0/cmd/git.exe (found version "2.44.0.windows.1") -- ccache will be used for faster recompilation -- The C compiler identification is GNU 13.2.0 -- The CXX compiler identification is GNU 13.2.0 -- The ASM compiler identification is GNU -- Found assembler: C:/Espressif/tools/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/bin/xtensa-esp32-elf-gcc.exe -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: C:/Espressif/tools/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/bin/xtensa-esp32-elf-gcc.exe - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: C:/Espressif/tools/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/bin/xtensa-esp32-elf-g++.exe - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Building ESP-IDF components for target esp32 NOTICE: Current idf-component-manager default lock file version is 2.0.0, but found 1.0.0 in C:\Espressif\frameworks\esp-idf-v5.2.2\Jade\dependencies.lock.esp32. Recreating lock file with the current version. Manifest files have changed, solving dependencies. NOTICE: Skipping optional dependency: espressif/esp_tinyusb NOTICE: Skipping optional dependency: espressif/tinyusb NOTICE: Skipping optional dependency: espressif/usb_host_msc NOTICE: Skipping optional dependency: espressif/esp-dsp .................NOTICE: Skipping optional dependency: espressif/esp_tinyusb NOTICE: Skipping optional dependency: espressif/tinyusb NOTICE: Skipping optional dependency: espressif/usb_host_msc NOTICE: Skipping optional dependency: espressif/esp-dsp NOTICE: Updating lock file at C:\Espressif\frameworks\esp-idf-v5.2.2\Jade\dependencies.lock.esp32 Processing 9 dependencies: [1/9] espressif/button (3.2.0) [2/9] espressif/cbor (0.6.0~1) [3/9] espressif/cmake_utilities (0.5.3) [4/9] espressif/esp32-camera (2.0.9) [5/9] espressif/esp_lcd_touch (1.1.1) [6/9] espressif/esp_lcd_touch_ft5x06 (1.0.6) [7/9] espressif/libsodium (1.0.20~1) [8/9] espressif/nghttp (1.58.0) [9/9] idf (5.2.2) NOTICE: Skipping optional dependency: espressif/esp_tinyusb NOTICE: Skipping optional dependency: espressif/tinyusb NOTICE: Skipping optional dependency: espressif/usb_host_msc NOTICE: Skipping optional dependency: espressif/esp-dsp -- Project sdkconfig file C:/Espressif/frameworks/esp-idf-v5.2.2/Jade/sdkconfig Loading defaults file C:/Espressif/frameworks/esp-idf-v5.2.2/Jade/sdkconfig.defaults.tmp... -- Compiler supported targets: xtensa-esp-elf -- Looking for sys/types.h -- Looking for sys/types.h - found -- Looking for stdint.h -- Looking for stdint.h - found -- Looking for stddef.h -- Looking for stddef.h - found -- Check size of time_t -- Check size of time_t - done -- Efuse virtual mode is enabled. If Secure boot or Flash encryption is on it does not provide any security. FOR TESTING ONLY! -- Found Python3: C:/Espressif/python_env/idf5.2_py3.11_env/Scripts/python.exe (found version "3.11.9") found components: Interpreter -- Performing Test CMAKE_HAVE_LIBC_PTHREAD -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success -- Found Threads: TRUE -- Performing Test C_COMPILER_SUPPORTS_WFORMAT_SIGNEDNESS -- Performing Test C_COMPILER_SUPPORTS_WFORMAT_SIGNEDNESS - Success -- App "jade" version: 1.0.31 -- Adding linker script C:/Espressif/frameworks/esp-idf-v5.2.2/Jade/build/esp-idf/esp_system/ld/memory.ld -- Adding linker script C:/Espressif/frameworks/esp-idf-v5.2.2/Jade/build/esp-idf/esp_system/ld/sections.ld.in -- Adding linker script C:/Espressif/frameworks/esp-idf-v5.2.2/components/esp_rom/esp32/ld/esp32.rom.ld -- Adding linker script C:/Espressif/frameworks/esp-idf-v5.2.2/components/esp_rom/esp32/ld/esp32.rom.api.ld -- Adding linker script C:/Espressif/frameworks/esp-idf-v5.2.2/components/esp_rom/esp32/ld/esp32.rom.libgcc.ld -- Adding linker script C:/Espressif/frameworks/esp-idf-v5.2.2/components/esp_rom/esp32/ld/esp32.rom.newlib-data.ld -- Adding linker script C:/Espressif/frameworks/esp-idf-v5.2.2/components/esp_rom/esp32/ld/esp32.rom.syscalls.ld -- Adding linker script C:/Espressif/frameworks/esp-idf-v5.2.2/components/esp_rom/esp32/ld/esp32.rom.newlib-funcs.ld -- Adding linker script C:/Espressif/frameworks/esp-idf-v5.2.2/components/esp_rom/esp32/ld/esp32.rom.eco3.ld -- Adding linker script C:/Espressif/frameworks/esp-idf-v5.2.2/components/soc/esp32/ld/esp32.peripherals.ld -- BUTTON: 3.2.0 -- Components: app_trace app_update assets autogenlang bootloader bootloader_support bt cmock console cxx driver efuse esp-tls esp32-quirc esp32-rotary-encoder esp32_bc-ur esp32_bsdiff esp32_deflate esp_adc esp_app_format esp_bootloader_format esp_coex esp_common esp_eth esp_event esp_gdbstub esp_hid esp_http_client esp_http_server esp_https_ota esp_https_server esp_hw_support esp_lcd esp_local_ctrl esp_mm esp_netif esp_netif_stack esp_partition esp_phy esp_pm esp_psram esp_ringbuf esp_rom esp_system esp_timer esp_wifi espcoredump espressifbutton espressifcbor espressifcmake_utilities espressifesp32-camera espressifesp_lcd_touch espressif__esp_lcd_touch_ft5x06 espressiflibsodium espressifnghttp esptool_py fatfs freertos hal heap http_parser idf_test ieee802154 json libwally-core log lwip main mbedtls mqtt newlib nvs_flash nvs_sec_provider openthread partition_table perfmon protobuf-c protocomm pthread sdmmc soc spi_flash spiffs tcp_transport ulp unity usb vfs wear_levelling wifi_provisioning wpa_supplicant xtensa -- Component paths: C:/Espressif/frameworks/esp-idf-v5.2.2/components/app_trace C:/Espressif/frameworks/esp-idf-v5.2.2/components/app_update C:/Espressif/frameworks/esp-idf-v5.2.2/Jade/components/assets C:/Espressif/frameworks/esp-idf-v5.2.2/Jade/components/autogenlang C:/Espressif/frameworks/esp-idf-v5.2.2/components/bootloader C:/Espressif/frameworks/esp-idf-v5.2.2/components/bootloader_support C:/Espressif/frameworks/esp-idf-v5.2.2/components/bt C:/Espressif/frameworks/esp-idf-v5.2.2/components/cmock C:/Espressif/frameworks/esp-idf-v5.2.2/components/console C:/Espressif/frameworks/esp-idf-v5.2.2/components/cxx C:/Espressif/frameworks/esp-idf-v5.2.2/components/driver C:/Espressif/frameworks/esp-idf-v5.2.2/components/efuse C:/Espressif/frameworks/esp-idf-v5.2.2/components/esp-tls C:/Espressif/frameworks/esp-idf-v5.2.2/Jade/components/esp32-quirc C:/Espressif/frameworks/esp-idf-v5.2.2/Jade/components/esp32-rotary-encoder C:/Espressif/frameworks/esp-idf-v5.2.2/Jade/components/esp32_bc-ur C:/Espressif/frameworks/esp-idf-v5.2.2/Jade/components/esp32_bsdiff C:/Espressif/frameworks/esp-idf-v5.2.2/Jade/components/esp32_deflate C:/Espressif/frameworks/esp-idf-v5.2.2/components/esp_adc C:/Espressif/frameworks/esp-idf-v5.2.2/components/esp_app_format C:/Espressif/frameworks/esp-idf-v5.2.2/components/esp_bootloader_format C:/Espressif/frameworks/esp-idf-v5.2.2/components/esp_coex C:/Espressif/frameworks/esp-idf-v5.2.2/components/esp_common C:/Espressif/frameworks/esp-idf-v5.2.2/components/esp_eth C:/Espressif/frameworks/esp-idf-v5.2.2/components/esp_event C:/Espressif/frameworks/esp-idf-v5.2.2/components/esp_gdbstub C:/Espressif/frameworks/esp-idf-v5.2.2/components/esp_hid C:/Espressif/frameworks/esp-idf-v5.2.2/components/esp_http_client C:/Espressif/frameworks/esp-idf-v5.2.2/components/esp_http_server C:/Espressif/frameworks/esp-idf-v5.2.2/components/esp_https_ota C:/Espressif/frameworks/esp-idf-v5.2.2/components/esp_https_server C:/Espressif/frameworks/esp-idf-v5.2.2/components/esp_hw_support C:/Espressif/frameworks/esp-idf-v5.2.2/components/esp_lcd C:/Espressif/frameworks/esp-idf-v5.2.2/components/esp_local_ctrl C:/Espressif/frameworks/esp-idf-v5.2.2/components/esp_mm C:/Espressif/frameworks/esp-idf-v5.2.2/components/esp_netif C:/Espressif/frameworks/esp-idf-v5.2.2/components/esp_netif_stack C:/Espressif/frameworks/esp-idf-v5.2.2/components/esp_partition C:/Espressif/frameworks/esp-idf-v5.2.2/components/esp_phy C:/Espressif/frameworks/esp-idf-v5.2.2/components/esp_pm C:/Espressif/frameworks/esp-idf-v5.2.2/components/esp_psram C:/Espressif/frameworks/esp-idf-v5.2.2/components/esp_ringbuf C:/Espressif/frameworks/esp-idf-v5.2.2/components/esp_rom C:/Espressif/frameworks/esp-idf-v5.2.2/components/esp_system C:/Espressif/frameworks/esp-idf-v5.2.2/components/esp_timer C:/Espressif/frameworks/esp-idf-v5.2.2/components/esp_wifi C:/Espressif/frameworks/esp-idf-v5.2.2/components/espcoredump C:/Espressif/frameworks/esp-idf-v5.2.2/Jade/managed_components/espressifbutton C:/Espressif/frameworks/esp-idf-v5.2.2/Jade/managed_components/espressifcbor C:/Espressif/frameworks/esp-idf-v5.2.2/Jade/managed_components/espressifcmake_utilities C:/Espressif/frameworks/esp-idf-v5.2.2/Jade/managed_components/espressifesp32-camera C:/Espressif/frameworks/esp-idf-v5.2.2/Jade/managed_components/espressifesp_lcd_touch C:/Espressif/frameworks/esp-idf-v5.2.2/Jade/managed_components/espressifesp_lcd_touch_ft5x06 C:/Espressif/frameworks/esp-idf-v5.2.2/Jade/managed_components/espressiflibsodium C:/Espressif/frameworks/esp-idf-v5.2.2/Jade/managed_components/espressif__nghttp C:/Espressif/frameworks/esp-idf-v5.2.2/components/esptool_py C:/Espressif/frameworks/esp-idf-v5.2.2/components/fatfs C:/Espressif/frameworks/esp-idf-v5.2.2/components/freertos C:/Espressif/frameworks/esp-idf-v5.2.2/components/hal C:/Espressif/frameworks/esp-idf-v5.2.2/components/heap C:/Espressif/frameworks/esp-idf-v5.2.2/components/http_parser C:/Espressif/frameworks/esp-idf-v5.2.2/components/idf_test C:/Espressif/frameworks/esp-idf-v5.2.2/components/ieee802154 C:/Espressif/frameworks/esp-idf-v5.2.2/components/json C:/Espressif/frameworks/esp-idf-v5.2.2/Jade/components/libwally-core C:/Espressif/frameworks/esp-idf-v5.2.2/components/log C:/Espressif/frameworks/esp-idf-v5.2.2/components/lwip C:/Espressif/frameworks/esp-idf-v5.2.2/Jade/main C:/Espressif/frameworks/esp-idf-v5.2.2/components/mbedtls C:/Espressif/frameworks/esp-idf-v5.2.2/components/mqtt C:/Espressif/frameworks/esp-idf-v5.2.2/components/newlib C:/Espressif/frameworks/esp-idf-v5.2.2/components/nvs_flash C:/Espressif/frameworks/esp-idf-v5.2.2/components/nvs_sec_provider C:/Espressif/frameworks/esp-idf-v5.2.2/components/openthread C:/Espressif/frameworks/esp-idf-v5.2.2/components/partition_table C:/Espressif/frameworks/esp-idf-v5.2.2/components/perfmon C:/Espressif/frameworks/esp-idf-v5.2.2/components/protobuf-c C:/Espressif/frameworks/esp-idf-v5.2.2/components/protocomm C:/Espressif/frameworks/esp-idf-v5.2.2/components/pthread C:/Espressif/frameworks/esp-idf-v5.2.2/components/sdmmc C:/Espressif/frameworks/esp-idf-v5.2.2/components/soc C:/Espressif/frameworks/esp-idf-v5.2.2/components/spi_flash C:/Espressif/frameworks/esp-idf-v5.2.2/components/spiffs C:/Espressif/frameworks/esp-idf-v5.2.2/components/tcp_transport C:/Espressif/frameworks/esp-idf-v5.2.2/components/ulp C:/Espressif/frameworks/esp-idf-v5.2.2/components/unity C:/Espressif/frameworks/esp-idf-v5.2.2/components/usb C:/Espressif/frameworks/esp-idf-v5.2.2/components/vfs C:/Espressif/frameworks/esp-idf-v5.2.2/components/wear_levelling C:/Espressif/frameworks/esp-idf-v5.2.2/components/wifi_provisioning C:/Espressif/frameworks/esp-idf-v5.2.2/components/wpa_supplicant C:/Espressif/frameworks/esp-idf-v5.2.2/components/xtensa -- Configuring done -- Generating done -- Build files have been written to: C:/Espressif/frameworks/esp-idf-v5.2.2/Jade/build Executing action: save-defconfig Running ninja in directory C:\Espressif\frameworks\esp-idf-v5.2.2\Jade\build Executing "ninja save-defconfig"... [0/1] cmd.exe /C "cd /D C:\Espressif\frameworks\esp-idf-v5...f/frameworks/esp-idf-v5.2.2/Jade/sdkconfig.defaults.tmp... rameworks/esp-idf-v5.2.2/sdkconfig.rename --config C:/Espressif/frameworks/esp-idf-v5.2.2/Jade/sdkconfig --defaults C:/Espressif/frameworks/esp-idf-v5.2.2/Jade/sdkconfig.defaults.tmp --env-file C:/Espressif/frameworks/esp-idf-v5.2.2/Jade/build/config.env --dont-write-deprecated --output savedefconfig C:/Espressif/frameworks/esp-idf-v5.2.2/Jade/sdkconfig.defaults"

C:\Espressif\frameworks\esp-idf-v5.2.2\Jade>python ./tools/mkdefaults.py ./sdkconfig.defaults SECURE Executing action: reconfigure Running cmake in directory C:\Espressif\frameworks\esp-idf-v5.2.2\Jade\build Executing "cmake -G Ninja -DPYTHON_DEPS_CHECKED=1 -DPYTHON=C:\Espressif\python_env\idf5.2_py3.11_env\Scripts\python.exe -DESP_PLATFORM=1 -DSDKCONFIG_DEFAULTS=./sdkconfig.defaults.tmp -DCCACHE_ENABLE=1 C:\Espressif\frameworks\esp-idf-v5.2.2\Jade"... -- ccache will be used for faster recompilation -- Building ESP-IDF components for target esp32 NOTICE: Skipping optional dependency: espressif/esp_tinyusb NOTICE: Skipping optional dependency: espressif/tinyusb NOTICE: Skipping optional dependency: espressif/usb_host_msc NOTICE: Skipping optional dependency: espressif/esp-dsp NOTICE: Skipping optional dependency: espressif/esp_tinyusb NOTICE: Skipping optional dependency: espressif/tinyusb NOTICE: Skipping optional dependency: espressif/usb_host_msc NOTICE: Skipping optional dependency: espressif/esp-dsp NOTICE: Skipping optional dependency: espressif/esp_tinyusb NOTICE: Skipping optional dependency: espressif/tinyusb NOTICE: Skipping optional dependency: espressif/usb_host_msc NOTICE: Skipping optional dependency: espressif/esp-dsp Processing 9 dependencies: [1/9] espressif/button (3.2.0) [2/9] espressif/cbor (0.6.0~1) [3/9] espressif/cmake_utilities (0.5.3) [4/9] espressif/esp32-camera (2.0.9) [5/9] espressif/esp_lcd_touch (1.1.1) [6/9] espressif/esp_lcd_touch_ft5x06 (1.0.6) [7/9] espressif/libsodium (1.0.20~1) [8/9] espressif/nghttp (1.58.0) [9/9] idf (5.2.2) NOTICE: Skipping optional dependency: espressif/esp_tinyusb NOTICE: Skipping optional dependency: espressif/tinyusb NOTICE: Skipping optional dependency: espressif/usb_host_msc NOTICE: Skipping optional dependency: espressif/esp-dsp -- Project sdkconfig file C:/Espressif/frameworks/esp-idf-v5.2.2/Jade/sdkconfig Loading defaults file C:/Espressif/frameworks/esp-idf-v5.2.2/Jade/sdkconfig.defaults.tmp... -- Compiler supported targets: xtensa-esp-elf -- App "jade" version: 1.0.31-dirty -- Adding linker script C:/Espressif/frameworks/esp-idf-v5.2.2/Jade/build/esp-idf/esp_system/ld/memory.ld -- Adding linker script C:/Espressif/frameworks/esp-idf-v5.2.2/Jade/build/esp-idf/esp_system/ld/sections.ld.in -- Adding linker script C:/Espressif/frameworks/esp-idf-v5.2.2/components/esp_rom/esp32/ld/esp32.rom.ld -- Adding linker script C:/Espressif/frameworks/esp-idf-v5.2.2/components/esp_rom/esp32/ld/esp32.rom.api.ld -- Adding linker script C:/Espressif/frameworks/esp-idf-v5.2.2/components/esp_rom/esp32/ld/esp32.rom.libgcc.ld -- Adding linker script C:/Espressif/frameworks/esp-idf-v5.2.2/components/esp_rom/esp32/ld/esp32.rom.newlib-data.ld -- Adding linker script C:/Espressif/frameworks/esp-idf-v5.2.2/components/esp_rom/esp32/ld/esp32.rom.syscalls.ld -- Adding linker script C:/Espressif/frameworks/esp-idf-v5.2.2/components/esp_rom/esp32/ld/esp32.rom.newlib-funcs.ld -- Adding linker script C:/Espressif/frameworks/esp-idf-v5.2.2/components/esp_rom/esp32/ld/esp32.rom.eco3.ld -- Adding linker script C:/Espressif/frameworks/esp-idf-v5.2.2/components/soc/esp32/ld/esp32.peripherals.ld -- BUTTON: 3.2.0 -- Components: app_trace app_update assets autogenlang bootloader bootloader_support bt cmock console cxx driver efuse esp-tls esp32-quirc esp32-rotary-encoder esp32_bc-ur esp32_bsdiff esp32_deflate esp_adc esp_app_format esp_bootloader_format esp_coex esp_common esp_eth esp_event esp_gdbstub esp_hid esp_http_client esp_http_server esp_https_ota esp_https_server esp_hw_support esp_lcd esp_local_ctrl esp_mm esp_netif esp_netif_stack esp_partition esp_phy esp_pm esp_psram esp_ringbuf esp_rom esp_system esp_timer esp_wifi espcoredump espressifbutton espressifcbor espressifcmake_utilities espressifesp32-camera espressifesp_lcd_touch espressif__esp_lcd_touch_ft5x06 espressiflibsodium espressifnghttp esptool_py fatfs freertos hal heap http_parser idf_test ieee802154 json libwally-core log lwip main mbedtls mqtt newlib nvs_flash nvs_sec_provider openthread partition_table perfmon protobuf-c protocomm pthread sdmmc soc spi_flash spiffs tcp_transport ulp unity usb vfs wear_levelling wifi_provisioning wpa_supplicant xtensa -- Component paths: C:/Espressif/frameworks/esp-idf-v5.2.2/components/app_trace C:/Espressif/frameworks/esp-idf-v5.2.2/components/app_update C:/Espressif/frameworks/esp-idf-v5.2.2/Jade/components/assets C:/Espressif/frameworks/esp-idf-v5.2.2/Jade/components/autogenlang C:/Espressif/frameworks/esp-idf-v5.2.2/components/bootloader C:/Espressif/frameworks/esp-idf-v5.2.2/components/bootloader_support C:/Espressif/frameworks/esp-idf-v5.2.2/components/bt C:/Espressif/frameworks/esp-idf-v5.2.2/components/cmock C:/Espressif/frameworks/esp-idf-v5.2.2/components/console C:/Espressif/frameworks/esp-idf-v5.2.2/components/cxx C:/Espressif/frameworks/esp-idf-v5.2.2/components/driver C:/Espressif/frameworks/esp-idf-v5.2.2/components/efuse C:/Espressif/frameworks/esp-idf-v5.2.2/components/esp-tls C:/Espressif/frameworks/esp-idf-v5.2.2/Jade/components/esp32-quirc C:/Espressif/frameworks/esp-idf-v5.2.2/Jade/components/esp32-rotary-encoder C:/Espressif/frameworks/esp-idf-v5.2.2/Jade/components/esp32_bc-ur C:/Espressif/frameworks/esp-idf-v5.2.2/Jade/components/esp32_bsdiff C:/Espressif/frameworks/esp-idf-v5.2.2/Jade/components/esp32_deflate C:/Espressif/frameworks/esp-idf-v5.2.2/components/esp_adc C:/Espressif/frameworks/esp-idf-v5.2.2/components/esp_app_format C:/Espressif/frameworks/esp-idf-v5.2.2/components/esp_bootloader_format C:/Espressif/frameworks/esp-idf-v5.2.2/components/esp_coex C:/Espressif/frameworks/esp-idf-v5.2.2/components/esp_common C:/Espressif/frameworks/esp-idf-v5.2.2/components/esp_eth C:/Espressif/frameworks/esp-idf-v5.2.2/components/esp_event C:/Espressif/frameworks/esp-idf-v5.2.2/components/esp_gdbstub C:/Espressif/frameworks/esp-idf-v5.2.2/components/esp_hid C:/Espressif/frameworks/esp-idf-v5.2.2/components/esp_http_client C:/Espressif/frameworks/esp-idf-v5.2.2/components/esp_http_server C:/Espressif/frameworks/esp-idf-v5.2.2/components/esp_https_ota C:/Espressif/frameworks/esp-idf-v5.2.2/components/esp_https_server C:/Espressif/frameworks/esp-idf-v5.2.2/components/esp_hw_support C:/Espressif/frameworks/esp-idf-v5.2.2/components/esp_lcd C:/Espressif/frameworks/esp-idf-v5.2.2/components/esp_local_ctrl C:/Espressif/frameworks/esp-idf-v5.2.2/components/esp_mm C:/Espressif/frameworks/esp-idf-v5.2.2/components/esp_netif C:/Espressif/frameworks/esp-idf-v5.2.2/components/esp_netif_stack C:/Espressif/frameworks/esp-idf-v5.2.2/components/esp_partition C:/Espressif/frameworks/esp-idf-v5.2.2/components/esp_phy C:/Espressif/frameworks/esp-idf-v5.2.2/components/esp_pm C:/Espressif/frameworks/esp-idf-v5.2.2/components/esp_psram C:/Espressif/frameworks/esp-idf-v5.2.2/components/esp_ringbuf C:/Espressif/frameworks/esp-idf-v5.2.2/components/esp_rom C:/Espressif/frameworks/esp-idf-v5.2.2/components/esp_system C:/Espressif/frameworks/esp-idf-v5.2.2/components/esp_timer C:/Espressif/frameworks/esp-idf-v5.2.2/components/esp_wifi C:/Espressif/frameworks/esp-idf-v5.2.2/components/espcoredump C:/Espressif/frameworks/esp-idf-v5.2.2/Jade/managed_components/espressifbutton C:/Espressif/frameworks/esp-idf-v5.2.2/Jade/managed_components/espressifcbor C:/Espressif/frameworks/esp-idf-v5.2.2/Jade/managed_components/espressifcmake_utilities C:/Espressif/frameworks/esp-idf-v5.2.2/Jade/managed_components/espressifesp32-camera C:/Espressif/frameworks/esp-idf-v5.2.2/Jade/managed_components/espressifesp_lcd_touch C:/Espressif/frameworks/esp-idf-v5.2.2/Jade/managed_components/espressifesp_lcd_touch_ft5x06 C:/Espressif/frameworks/esp-idf-v5.2.2/Jade/managed_components/espressiflibsodium C:/Espressif/frameworks/esp-idf-v5.2.2/Jade/managed_components/espressif__nghttp C:/Espressif/frameworks/esp-idf-v5.2.2/components/esptool_py C:/Espressif/frameworks/esp-idf-v5.2.2/components/fatfs C:/Espressif/frameworks/esp-idf-v5.2.2/components/freertos C:/Espressif/frameworks/esp-idf-v5.2.2/components/hal C:/Espressif/frameworks/esp-idf-v5.2.2/components/heap C:/Espressif/frameworks/esp-idf-v5.2.2/components/http_parser C:/Espressif/frameworks/esp-idf-v5.2.2/components/idf_test C:/Espressif/frameworks/esp-idf-v5.2.2/components/ieee802154 C:/Espressif/frameworks/esp-idf-v5.2.2/components/json C:/Espressif/frameworks/esp-idf-v5.2.2/Jade/components/libwally-core C:/Espressif/frameworks/esp-idf-v5.2.2/components/log C:/Espressif/frameworks/esp-idf-v5.2.2/components/lwip C:/Espressif/frameworks/esp-idf-v5.2.2/Jade/main C:/Espressif/frameworks/esp-idf-v5.2.2/components/mbedtls C:/Espressif/frameworks/esp-idf-v5.2.2/components/mqtt C:/Espressif/frameworks/esp-idf-v5.2.2/components/newlib C:/Espressif/frameworks/esp-idf-v5.2.2/components/nvs_flash C:/Espressif/frameworks/esp-idf-v5.2.2/components/nvs_sec_provider C:/Espressif/frameworks/esp-idf-v5.2.2/components/openthread C:/Espressif/frameworks/esp-idf-v5.2.2/components/partition_table C:/Espressif/frameworks/esp-idf-v5.2.2/components/perfmon C:/Espressif/frameworks/esp-idf-v5.2.2/components/protobuf-c C:/Espressif/frameworks/esp-idf-v5.2.2/components/protocomm C:/Espressif/frameworks/esp-idf-v5.2.2/components/pthread C:/Espressif/frameworks/esp-idf-v5.2.2/components/sdmmc C:/Espressif/frameworks/esp-idf-v5.2.2/components/soc C:/Espressif/frameworks/esp-idf-v5.2.2/components/spi_flash C:/Espressif/frameworks/esp-idf-v5.2.2/components/spiffs C:/Espressif/frameworks/esp-idf-v5.2.2/components/tcp_transport C:/Espressif/frameworks/esp-idf-v5.2.2/components/ulp C:/Espressif/frameworks/esp-idf-v5.2.2/components/unity C:/Espressif/frameworks/esp-idf-v5.2.2/components/usb C:/Espressif/frameworks/esp-idf-v5.2.2/components/vfs C:/Espressif/frameworks/esp-idf-v5.2.2/components/wear_levelling C:/Espressif/frameworks/esp-idf-v5.2.2/components/wifi_provisioning C:/Espressif/frameworks/esp-idf-v5.2.2/components/wpa_supplicant C:/Espressif/frameworks/esp-idf-v5.2.2/components/xtensa -- Configuring done -- Generating done -- Build files have been written to: C:/Espressif/frameworks/esp-idf-v5.2.2/Jade/build Executing action: save-defconfig Running ninja in directory C:\Espressif\frameworks\esp-idf-v5.2.2\Jade\build Executing "ninja save-defconfig"... [0/1] cmd.exe /C "cd /D C:\Espressif\frameworks\esp-idf-v5...f/frameworks/esp-idf-v5.2.2/Jade/sdkconfig.defaults.tmp... rameworks/esp-idf-v5.2.2/sdkconfig.rename --config C:/Espressif/frameworks/esp-idf-v5.2.2/Jade/sdkconfig --defaults C:/Espressif/frameworks/esp-idf-v5.2.2/Jade/sdkconfig.defaults.tmp --env-file C:/Espressif/frameworks/esp-idf-v5.2.2/Jade/build/config.env --dont-write-deprecated --output savedefconfig C:/Espressif/frameworks/esp-idf-v5.2.2/Jade/sdkconfig.defaults"

C:\Espressif\frameworks\esp-idf-v5.2.2\Jade>idf.py build Executing action: all (aliases: build) Running ninja in directory C:\Espressif\frameworks\esp-idf-v5.2.2\Jade\build Executing "ninja all"... [5/1397] Generating asset_data.inc Reading file: C:/Espressif/frameworks/esp-idf-v5.2.2/Jade/components/assets/asset_data.json Read 595 assets Written 595 assets [9/1397] Generating asset_data_testnet.inc Reading file: C:/Espressif/frameworks/esp-idf-v5.2.2/Jade/components/assets/asset_data_testnet.json Read 90 assets Written 90 assets [24/1397] Generating ../../partition_table/partition-table.bin Partition table binary generated. Contents:


ESP-IDF Partition Table

Name, Type, SubType, Offset, Size, Flags

nvs,data,nvs,0xa000,16K, otadata,data,ota,0xe000,8K,encrypted ota_0,app,ota_0,0x10000,1984K, ota_1,app,ota_1,0x200000,1984K, nvs_key,data,nvs_keys,0x3f0000,4K,encrypted


[984/1397] Building C object esp-idf/libwally-core/CMakeFi...bwally-core.dir/upstream/src/ccan/ccan/base64/base64.c.obj C:/Espressif/frameworks/esp-idf-v5.2.2/Jade/components/libwally-core/upstream/src/ccan/ccan/base64/base64.c:150:71: warning: argument 2 of type 'char[3]' with mismatched bound [-Warray-parameter=] 150 | ssize_t base64_decode_tail_using_maps(const base64_maps_t maps, char dest[3], | ~^~~ In file included from C:/Espressif/frameworks/esp-idf-v5.2.2/Jade/components/libwally-core/upstream/src/ccan/ccan/base64/base64.c:2: C:/Espressif/frameworks/esp-idf-v5.2.2/Jade/components/libwally-core/upstream/src/ccan/ccan/base64/base64.h:121:72: note: previously declared as 'char ' 121 | ssize_t base64_decode_tail_using_maps(const base64_maps_t maps, char dest, | ~~^~~~ [1177/1397] Building C object esp-idf/espressifesp32-cam.../idf_espressifesp32-camera.dir/driver/esp_camera.c.obj C:/Espressif/frameworks/esp-idf-v5.2.2/Jade/managed_components/espressifesp32-camera/driver/esp_camera.c: In function 'camera_probe': C:/Espressif/frameworks/esp-idf-v5.2.2/Jade/managed_components/espressifesp32-camera/driver/esp_camera.c:225:26: warning: comparison of unsigned expression in '< 0' is always false [-Wtype-limits] 225 | for (size_t i = 0; i < sizeof(g_sensors) / sizeof(sensor_func_t); i++) { | ^ [1259/1397] Performing configure step for 'bootloader' -- Found Git: C:/Espressif/tools/idf-git/2.44.0/cmd/git.exe (found version "2.44.0.windows.1") -- The C compiler identification is GNU 13.2.0 -- The CXX compiler identification is GNU 13.2.0 -- The ASM compiler identification is GNU -- Found assembler: C:/Espressif/tools/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/bin/xtensa-esp32-elf-gcc.exe -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: C:/Espressif/tools/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/bin/xtensa-esp32-elf-gcc.exe - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: C:/Espressif/tools/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/bin/xtensa-esp32-elf-g++.exe - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Building ESP-IDF components for target esp32 -- Project sdkconfig file C:/Espressif/frameworks/esp-idf-v5.2.2/Jade/sdkconfig -- Compiler supported targets: xtensa-esp-elf -- Looking for sys/types.h -- Looking for sys/types.h - found -- Looking for stdint.h -- Looking for stdint.h - found -- Looking for stddef.h -- Looking for stddef.h - found -- Check size of time_t -- Check size of time_t - done -- Adding linker script C:/Espressif/frameworks/esp-idf-v5.2.2/components/soc/esp32/ld/esp32.peripherals.ld -- Bootloader project name: "bootloader" version: 1 -- Adding linker script C:/Espressif/frameworks/esp-idf-v5.2.2/components/esp_rom/esp32/ld/esp32.rom.ld -- Adding linker script C:/Espressif/frameworks/esp-idf-v5.2.2/components/esp_rom/esp32/ld/esp32.rom.api.ld -- Adding linker script C:/Espressif/frameworks/esp-idf-v5.2.2/components/esp_rom/esp32/ld/esp32.rom.libgcc.ld -- Adding linker script C:/Espressif/frameworks/esp-idf-v5.2.2/components/esp_rom/esp32/ld/esp32.rom.newlib-funcs.ld -- Adding linker script C:/Espressif/frameworks/esp-idf-v5.2.2/components/esp_rom/esp32/ld/esp32.rom.eco3.ld -- Adding linker script C:/Espressif/frameworks/esp-idf-v5.2.2/components/bootloader/subproject/main/ld/esp32/bootloader.ld -- Adding linker script C:/Espressif/frameworks/esp-idf-v5.2.2/components/bootloader/subproject/main/ld/esp32/bootloader.rom.ld -- Components: bootloader bootloader_support efuse esp_app_format esp_bootloader_format esp_common esp_hw_support esp_rom esp_system esptool_py freertos hal log main micro-ecc newlib partition_table soc spi_flash xtensa -- Component paths: C:/Espressif/frameworks/esp-idf-v5.2.2/components/bootloader C:/Espressif/frameworks/esp-idf-v5.2.2/components/bootloader_support C:/Espressif/frameworks/esp-idf-v5.2.2/components/efuse C:/Espressif/frameworks/esp-idf-v5.2.2/components/esp_app_format C:/Espressif/frameworks/esp-idf-v5.2.2/components/esp_bootloader_format C:/Espressif/frameworks/esp-idf-v5.2.2/components/esp_common C:/Espressif/frameworks/esp-idf-v5.2.2/components/esp_hw_support C:/Espressif/frameworks/esp-idf-v5.2.2/components/esp_rom C:/Espressif/frameworks/esp-idf-v5.2.2/components/esp_system C:/Espressif/frameworks/esp-idf-v5.2.2/components/esptool_py C:/Espressif/frameworks/esp-idf-v5.2.2/components/freertos C:/Espressif/frameworks/esp-idf-v5.2.2/components/hal C:/Espressif/frameworks/esp-idf-v5.2.2/components/log C:/Espressif/frameworks/esp-idf-v5.2.2/components/bootloader/subproject/main C:/Espressif/frameworks/esp-idf-v5.2.2/components/bootloader/subproject/components/micro-ecc C:/Espressif/frameworks/esp-idf-v5.2.2/components/newlib C:/Espressif/frameworks/esp-idf-v5.2.2/components/partition_table C:/Espressif/frameworks/esp-idf-v5.2.2/components/soc C:/Espressif/frameworks/esp-idf-v5.2.2/components/spi_flash C:/Espressif/frameworks/esp-idf-v5.2.2/components/xtensa -- Configuring done -- Generating done -- Build files have been written to: C:/Espressif/frameworks/esp-idf-v5.2.2/Jade/build/bootloader [1270/1397] Building C object esp-idf/main/CMakeFiles/__idf_main.dir/camera.c.obj C:/Espressif/frameworks/esp-idf-v5.2.2/Jade/main/camera.c:97:13: warning: 'copy_camera_image_270' defined but not used -Wunused-function] 97 | static void copy_camera_image_270( | ^~~~~ C:/Espressif/frameworks/esp-idf-v5.2.2/Jade/main/camera.c:85:13: warning: 'copy_camera_image_90' defined but not used [-Wunused-function] 85 | static void copy_camera_image_90( | ^~~~~~~~ [1287/1397] Building C object esp-idf/main/CMakeFiles/idf_main.dir/qrscan.c.obj C:/Espressif/frameworks/esp-idf-v5.2.2/Jade/main/qrscan.c:68:13: warning: 'qr_recognize' defined but not used [-Wunused-function] 68 | static bool qr_recognize( | ^~~~ [109/112] Linking C executable bootloader.elf

Bootloader built. Secure boot enabled, so bootloader not flashed automatically. Secure boot enabled, so bootloader not flashed automatically. C:/Espressif/python_env/idf5.2_py3.11_env/Scripts/python.exe C:/Espressif/frameworks/esp-idf-v5.2.2/components/esptool_py/esptool/esptool.py --chip esp32 --port=(PORT) --baud=(BAUD) --before=default_reset --after=no_reset write_flash --flash_mode dio --flash_freq 40m --flash_size keep 0x1000 C:/Espressif/frameworks/esp-idf-v5.2.2/Jade/build/bootloader/bootloader.bin

[110/112] Generating binary image from built executable esptool.py v4.7.0 Creating esp32 image... Merged 2 ELF sections Successfully created esp32 image. Generated C:/Espressif/frameworks/esp-idf-v5.2.2/Jade/build/bootloader/bootloader.bin [111/112] cmd.exe /C "cd /D C:\Espressif\frameworks\esp-id...works/esp-idf-v5.2.2/Jade/build/bootloader/bootloader.bin" Bootloader binary size 0x6840 bytes. 0x17c0 bytes (19%) free. [112/112] Generated the signed Bootloader espsecure.py v4.7.0 Padding data contents by 1984 bytes so signature sector aligns at sector boundary 1 signing key(s) found. Signed 28672 bytes of data from C:/Espressif/frameworks/esp-idf-v5.2.2/Jade/build/bootloader/bootloader-unsigned.bin. Signature sector now has 1 signature blocks. Generated signed binary image C:/Espressif/frameworks/esp-idf-v5.2.2/Jade/build/bootloader/bootloader.bin from C:/Espressif/frameworks/esp-idf-v5.2.2/Jade/build/bootloader/bootloader-unsigned.bin [1395/1397] Generating binary image from built executable esptool.py v4.7.0 Creating esp32 image... Merged 2 ELF sections Successfully created esp32 image. Generated C:/Espressif/frameworks/esp-idf-v5.2.2/Jade/build/jade-unsigned.bin [1396/1397] Generating signed binary image espsecure.py v4.7.0 1 signing key(s) found. Signed 1179648 bytes of data from C:/Espressif/frameworks/esp-idf-v5.2.2/Jade/build/jade-unsigned.bin. Signature sector now has 1 signature blocks. Generated signed binary image C:/Espressif/frameworks/esp-idf-v5.2.2/Jade/build/jade.bin from C:/Espressif/frameworks/esp-idf-v5.2.2/Jade/build/jade-unsigned.bin [1397/1397] cmd.exe /C "cd /D C:\Espressif\frameworks\esp-...:/Espressif/frameworks/esp-idf-v5.2.2/Jade/build/jade.bin" jade.bin binary size 0x121000 bytes. Smallest app partition is 0x1f0000 bytes. 0xcf000 bytes (42%) free.

Project build complete. To flash, run: idf.py flash or idf.py -p PORT flash or python -m esptool --chip esp32 -b 460800 --before default_reset --after no_reset write_flash --flash_mode dio --flash_size keep --flash_freq 40m 0x9000 build\partition_table\partition-table.bin 0xe000 build\ota_data_initial.bin 0x10000 build\jade.bin or from the "C:\Espressif\frameworks\esp-idf-v5.2.2\Jade\build" directory python -m esptool --chip esp32 -b 460800 --before default_reset --after no_reset write_flash "@flash_args"

C:\Espressif\frameworks\esp-idf-v5.2.2\Jade>python jade_ota.py --noagent No module named 'bleak' BLE scanning/connectivity will not be available Reading file build/jade.bin Read 1183744 bytes Compressing 1183744 bytes Compressed to 791311 bytes Deduced compressed firmware filepath: build/1.0.31-dirty_ble_1183744_fw.bin Filename suggests full firmware : 1.0.31-dirty_ble_1183744_fw.bin Got fw file of length 791311 with expected uncompressed final fw length 1183744 Final fw hash: ccec42dac86b33a17bd9b2b7d4617945bd5c9c153fe9a5aec8eba3e24f135df3 Jade OTA over serial Sending: {'method': 'get_version_info', 'id': '441811'} as cbor of size 35 Received msg: {'id': '441811', 'result': {'JADE_VERSION': '1.0.30-cryptoguide', 'JADE_OTA_MAX_CHUNK': 4096, 'JADE_CONFIG': 'BLE', 'BOARD_TYPE': 'UNKNOWN', 'JADE_FEATURES': 'SB', 'IDF_VERSION': 'v5.2.2-dirty', 'CHIP_FEATURES': 'b3000000', 'EFUSEMAC': '0C8B95B4A5E4', 'BATTERY_STATUS': 5, 'JADE_STATE': 'UNINIT', 'JADE_NETWORKS': 'ALL', 'JADE_HAS_PIN': False}} Running OTA on: {'JADE_VERSION': '1.0.30-cryptoguide', 'JADE_OTA_MAX_CHUNK': 4096, 'JADE_CONFIG': 'BLE', 'BOARD_TYPE': 'UNKNOWN', 'JADE_FEATURES': 'SB', 'IDF_VERSION': 'v5.2.2-dirty', 'CHIP_FEATURES': 'b3000000', 'EFUSEMAC': '0C8B95B4A5E4', 'BATTERY_STATUS': 5, 'JADE_STATE': 'UNINIT', 'JADE_NETWORKS': 'ALL', 'JADE_HAS_PIN': False} Sending: {'method': 'ota', 'id': '857169', 'params': {'fwsize': 1183744, 'cmpsize': 791311, 'cmphash': 'b1e0b3916728bd20b77ceb88d4a6ee97b57531ad6fa2bdc8fec2d496edc77948', 'fwhash': 'ccec42dac86b33a17bd9b2b7d4617945bd5c9c153fe9a5aec8eba3e24f135df3'}} as cbor of size 138 Received msg: {'id': '857169', 'result': True} Sending ota_data message 234116 as cbor of size 4133 Received msg: {'id': '234116', 'result': True} 1027.91 b/s - progress 0.52% - 765.84 seconds left Written 4096b in 3.98s Sending ota_data message 179592 as cbor of size 4133 Received msg: {'id': '179592', 'result': True} 10093.20 b/s - progress 1.04% - 419.72 seconds left Written 8192b in 4.39s Sending ota_data message 694625 as cbor of size 4133 Received msg: {'id': '694625', 'error': {'code': -32603, 'message': 'Error uploading OTA data', 'data': '4552524f525f494e56414c49444657'}} Exception causing JadeAPI context exit. <class 'jadepy.jade_error.JadeError'> JadeError: -32603 - Error uploading OTA data (Data: b'ERROR_INVALIDFW') File "C:\Espressif\frameworks\esp-idf-v5.2.2\Jade\jade_ota.py", line 481, in has_radio, bleid = ota(jade, fwcmp, fwlen, fwhash, patchlen, args.pushmnemonic) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Espressif\frameworks\esp-idf-v5.2.2\Jade\jade_ota.py", line 295, in ota result = jade.ota_update(fwcompressed, fwlength, chunksize, fwhash, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Espressif\frameworks\esp-idf-v5.2.2\Jade\jadepy\jade.py", line 530, in ota_update result = self._jadeRpc('ota_data', chunk) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Espressif\frameworks\esp-idf-v5.2.2\Jade\jadepy\jade.py", line 352, in _jadeRpc result = self._get_result_or_raise_error(reply) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Espressif\frameworks\esp-idf-v5.2.2\Jade\jadepy\jade.py", line 305, in _get_result_or_raise_error raise JadeError(e.get('code'), e.get('message'), e.get('data')) Draining interface... Traceback (most recent call last): File "C:\Espressif\frameworks\esp-idf-v5.2.2\Jade\jade_ota.py", line 481, in has_radio, bleid = ota(jade, fwcmp, fwlen, fwhash, patchlen, args.pushmnemonic) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Espressif\frameworks\esp-idf-v5.2.2\Jade\jade_ota.py", line 295, in ota result = jade.ota_update(fwcompressed, fwlength, chunksize, fwhash, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Espressif\frameworks\esp-idf-v5.2.2\Jade\jadepy\jade.py", line 530, in ota_update result = self._jadeRpc('ota_data', chunk) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Espressif\frameworks\esp-idf-v5.2.2\Jade\jadepy\jade.py", line 352, in _jadeRpc result = self._get_result_or_raise_error(reply) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Espressif\frameworks\esp-idf-v5.2.2\Jade\jadepy\jade.py", line 305, in _get_result_or_raise_error raise JadeError(e.get('code'), e.get('message'), e.get('data')) jadepy.jade_error.JadeError: JadeError: -32603 - Error uploading OTA data (Data: b'ERROR_INVALIDFW')

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Espressif\frameworks\esp-idf-v5.2.2\Jade\jade_ota.py", line 480, in with JadeAPI.create_serial(device=args.serialport) as jade: File "C:\Espressif\frameworks\esp-idf-v5.2.2\Jade\jadepy\jade.py", line 183, in exit self.disconnect(exctype is not None) File "C:\Espressif\frameworks\esp-idf-v5.2.2\Jade\jadepy\jade.py", line 274, in disconnect self.jade.disconnect(drain) File "C:\Espressif\frameworks\esp-idf-v5.2.2\Jade\jadepy\jade.py", line 1961, in disconnect self.drain() File "C:\Espressif\frameworks\esp-idf-v5.2.2\Jade\jadepy\jade.py", line 1975, in drain byte = self.impl.read(1) ^^^^^^^^^^^^^^^^^ File "C:\Espressif\frameworks\esp-idf-v5.2.2\Jade\jadepy\jade_serial.py", line 86, in read return self.ser.read(n) ^^^^^^^^^^^^^^^^ File "C:\Espressif\python_env\idf5.2_py3.11_env\Lib\site-packages\serial\serialwin32.py", line 295, in read raise SerialException("GetOverlappedResult failed ({!r})".format(ctypes.WinError())) serial.serialutil.SerialException: GetOverlappedResult failed (PermissionError(13, 'Acesso negado.', None, 5))

C:\Espressif\frameworks\esp-idf-v5.2.2\Jade> cplus2 `

JamieDriver commented 3 weeks ago

So your device has 'secure boot' enabled, but the fw you are trying to upload is one without secure-boot compiled in, so it's (correctly) rejecting it.

At some point you must have built fw with secure-boot (and maybe flash-encryption?) enabled, and flashed that to your M5StickC.

From now on it will not allow you to re-flash - it will only accept fw by the 'ota' process. The fw you try to upload must be the same config (wrt secure-boot/flash-encryption) as you had initially, and if secure-boot signed ofc.

JamieDriver commented 3 weeks ago

You appear to create the build config using: python ./tools/mkdefaults.py ./sdkconfig.defaults NDEBUG

I'm not sure what was in ./sdkconfig.defaults or why you are recreating it based on itself - seems odd. (The tool should have saved your original sdkconfig.defaults as 'sdkconfig.defaults.orig')

Also, this will not itself make a 'secure boot' config. Did you initially make the secure-boot config with that tool ? eg: with python ./tools/mkdefaults.py ./configs/sdkconfig_display_m5stickcplus2.defaults NDEBUG SECURE maybe ?

If so, you need to use that same 'SECURE' parameter to make a 'secure-boot' compatible binary.

The fw is probably being rejected because your running fw is 'secure' but the one you are trying to upload is not. It can't deal with that. Once you make it 'secure' it will only accept 'secure' fw uploads.

1v9Cidjei commented 3 weeks ago

yes, I also used 'SECURE' in another command.

1v9Cidjei commented 3 weeks ago

I just tested by cleaning everything and redoing it using python ./tools/mkdefaults.py ./configs/sdkconfig_display_m5stickcplus2.defaults NDEBUG SECURE and the result was the same...

1v9Cidjei commented 3 weeks ago

Em algum momento você deve ter criado o fw com inicialização segura (e talvez criptografia flash?) habilitada e instalado no seu M5StickC.

Yes, I activated it when I first installed it using the @3rdIteration repository. I also have a TT-GO T Display, I even use the same process, including signing with private keys, but in this case I was successful in updating.

I think it must be a difference between the repositories. As this is all kind of new to me, I didn't know if I would have problems in the future if the official repository version was released.

JamieDriver commented 3 weeks ago

Ahh yes, the one you have loaded on there currently says: 'BOARD_TYPE': 'UNKNOWN'

This was an issue with the original PR'd branch - but this was fixed before that branch was merged, so it now would say M5STICKCPLUS2.

This is almost certainly the root of your problem.

You should be able to workaround this locally by commenting these two lines: https://github.com/Blockstream/Jade/blob/f72e76ed6461a65e0010eba5b1323c7706024f53/main/process/ota_defines.h#L32-L33

Good luck!

1v9Cidjei commented 3 weeks ago

Ah, sim, o que você carregou aí atualmente diz: 'BOARD_TYPE': 'UNKNOWN'

Este era um problema com a ramificação PR'd original - mas foi corrigido antes que a ramificação fosse mesclada, então agora diria M5STICKCPLUS2.

Essa é quase certamente a raiz do seu problema.

Você deve conseguir contornar isso localmente comentando estas duas linhas:

https://github.com/Blockstream/Jade/blob/f72e76ed6461a65e0010eba5b1323c7706024f53/main/process/ota_defines.h#L32-L33

Boa sorte!

Should these changes be made to the local branch that I have of the M5Stick C Plus 2? and replace the current fw with one with these new implementations, so that the original repository recognizes the board? If so, when I complicate the code and try to send it via OTA the error remains the same, only now it also appears when I try to send a fw compiled with the branch files.

1v9Cidjei commented 3 weeks ago

I apologize for not being so technical, I'm just an enthusiast trying to learn a little.

1v9Cidjei commented 3 weeks ago

I think I understand, are you telling me to simply remove these two lines of code from this file? If so, I managed to do it, and it worked, but in this case every time I need to update I will have to do this? Isn't there a way to change the "BOARD_TYPE" that is already on the device? I don't know if I made myself clear...

JamieDriver commented 3 weeks ago

Perfectly clear :-)

When uploading a fw Jade ensures the new fw 'BOARD_TYPE' is the same as the existing 'BOARD_TYPE'. So yes, if we accept that your current fw thinks the board is 'UNKNOWN', you would always have to remove those two lines, every time you wanted to build a new update...

If your update worked, then we can be pretty sure this misatch was indeed the problem.

Isn't there a way to change the "BOARD_TYPE" that is already on the device?

Yes, but it's a little more complicated ... ;-) So ...

  1. let's also locally remove the check on 'same board type' ... so now (temporarily) comment/remove these lines: https://github.com/Blockstream/Jade/blob/f72e76ed6461a65e0010eba5b1323c7706024f53/main/process/ota_util.c#L243-L246 Build that and load onto your M5StickCJade. Now you have a fw that says it is 'UNKNOWN' but also has no check stopping us changing it ...

Then revert the changes to ota_defines.h (so we go back to calling it 'M5STICKCPLUS2'), and revert the changes just made to ota_util.c (ie. bringing the BOARD_TYPE check back). ie. probably back to a clean 1.0.31 (or master, whichever you are using).
Then build and upload that. You should now be at a clean build, with your board reported as 'M5STICKCPLUS2', and should have no problems going forward ! (and the 'BOARD_TYPE' check is back in place, which is really what we want going forward [to ensure we don't upload a build for the wrong hw and potentially 'brick' the device!]) :crossed_fingers:

1v9Cidjei commented 3 weeks ago

Perfeitamente claro :-)

Ao carregar um fw, Jade garante que o novo fw 'BOARD_TYPE' seja o mesmo que o 'BOARD_TYPE' existente. Então sim, se aceitarmos que seu fw atual acha que a placa é 'UNKNOWN', você sempre teria que remover essas duas linhas, toda vez que quisesse construir uma nova atualização...

Se sua atualização funcionou, então podemos ter certeza de que esse erro foi realmente o problema.

Não há uma maneira de alterar o "BOARD_TYPE" que já está no dispositivo?

Sim, mas é um pouco mais complicado... ;-) Então...

  1. vamos também remover localmente a verificação de 'mesmo tipo de placa'... então agora (temporariamente) comente/remova estas linhas: https://github.com/Blockstream/Jade/blob/f72e76ed6461a65e0010eba5b1323c7706024f53/main/process/ota_util.c#L243-L246

    Construa isso e carregue no seu M5StickCJade. Agora você tem um fw que diz que é 'UNKNOWN', mas também não tem nenhuma verificação nos impedindo de alterá-lo...

Em seguida, reverta as alterações para ota_defines.h(então voltamos a chamá-lo de 'M5STICKCPLUS2') e reverta as alterações feitas recentemente para ota_util.c(ou seja, trazendo a BOARD_TYPEverificação de volta). Ou seja, provavelmente de volta para um limpo 1.0.31(ou master, o que você estiver usando). Em seguida, construa e carregue isso. Agora você deve estar em uma construção limpa, com sua placa relatada como 'M5STICKCPLUS2', e não deve ter problemas para seguir em frente! (e a verificação 'BOARD_TYPE' está de volta, que é realmente o que queremos daqui para frente [para garantir que não carreguemos uma construção para o hardware errado e potencialmente 'brick' o dispositivo!]) 🤞

Dude! Everything went perfectly! You really helped me a lot. Without your tips I practically wouldn't have managed it. Now I have a clean version that doesn't have any problems updating. Thank you very much!!!!

JamieDriver commented 3 weeks ago

My pleasure!