espressif / idf-extra-components

Additional components for ESP-IDF, maintained by Espressif
147 stars 89 forks source link

esp_encrypted_img: Arduino IDF component error: invalid conversion from 'esp_decrypt_handle_t' {aka 'void*'} to 'void**' (IEC-55) #246

Closed dzungpv closed 11 months ago

dzungpv commented 11 months ago

Answers checklist.

General issue report

I use esp_encrypted_img in a IDF project with arduino-esp32 component, code in C++. When I try the sample https://github.com/espressif/esp-idf/tree/master/examples/system/ota/pre_encrypted_ota with IDF 4.4.7 and arduino-esp32 as component, the error appear, I try to all the cast in C++ and also mark the function with extern "C" but it could not compile, show the error:

error: invalid conversion from 'esp_decrypt_handle_t' {aka 'void*'} to 'void**' [-fpermissive]
     ctx = esp_encrypted_img_decrypt_start(&cfg);

Cast with C++ : const_cast<esp_decrypt_cfg_t*>(&cfg) does not work too.

dzungpv commented 11 months ago

I solve myself, change ctx to C++ style and it work.