Rebuild the platform espressif32 with DTLS for Arduino framework

Configuration options for mbedtls are put in the file esp_config.h. You can either directly enable the mbedtls macros or their surrounding config macros.

So the first thing to try would be to add build_flags = -D CONFIG_MBEDTLS_SSL_PROTO_DTLS to the platformio.ini and see if you can compile a firmware which uses DTLS functions. E.g., activating that CONFIG_ macro should make the function mbedtls_ssl_conf_dtls_anti_replay() available so a simple code like

#include <mbedtls/ssl.h>

void app_main() {
   mbedtls_ssl_conf_dtls_anti_replay(NULL, MBEDTLS_SSL_ANTI_REPLAY_ENABLED);
}

should be able to sanity-test it; there should be no undefined reference errors if this works.

Be carefull to delete any CONFIG_MBEDTLS_SSL_PROTO_DTLS references from your sdkconfig.h file if you do this, as this seems to duplicated there otherwise (arduino-esp32/sdkconfig at 5f1dff7dad965581b98ae4dc3fdfe21e3b552072 · espressif/arduino-esp32 · GitHub)

1 Like