nuttx icon indicating copy to clipboard operation
nuttx copied to clipboard

[HELP] Making HTTPS calls using MBEDTLS

Open engdavidiogo opened this issue 1 year ago • 10 comments

Description

I need help understanding what is wrong with this implementation attempt.

I am trying to make HTTPS calls in my project using MBEDTLS, and for that, I am using the default Wi-Fi configuration for the ESP32C6.

$ ./tools/configure.sh esp32c6-devkitc:wifi

After that, I enable the following configurations in the menu:

CONFIG_CRYPTO_MBEDTLS CONFIG_MBEDTLS_APPS CONFIG_MBEDTLS_APP_BENCHMARK CONFIG_MBEDTLS_APP_SELFTEST

With this configuration, when trying to build, I get the following output:

image

Please let me know if I skipped any necessary steps for success.

Verification

  • [X] I have verified before submitting the report.

engdavidiogo avatar Oct 09 '24 21:10 engdavidiogo

Adding to what has already been said:

It seems like the issue is related to missing configurations in NuttX concerning the Espressif HAL for the ESP32C6.

As a validation, I enabled the MBEDTLS features using the following configuration for the STM32F746:

$ ./tools/configure.sh stm32f746g-disco:netnsh

image

I also applied the same configuration for the ESP32:

$ ./tools/configure.sh esp32-devkitc:wifi

image

@fdcavalcanti, @eren-terzioglu can you PTAL?

engdavidiogo avatar Oct 10 '24 15:10 engdavidiogo

Checknuttx/arch/risc-v/src/esp32c6/esp-hal-3rdparty/nuttx/esp32c6/include/sdkconfig.h. You will see some symbols are already defined there, maybe it will help you better understand what's going on.

fdcavalcanti avatar Oct 11 '24 18:10 fdcavalcanti

I was trying to deal with similar in the past in https://github.com/apache/nuttx/pull/11738 Seems like linking process is using CFLAGS with both app flags and flags from Wireless.mk

pkarashchenko avatar Oct 13 '24 23:10 pkarashchenko

You are right @pkarashchenko , I did same thing than you and now we are able to compile. @fdcavalcanti can you check whether a did right process here: https://github.com/espressif/esp-hal-3rdparty/pull/5, please?

FelipeMdeO avatar Oct 14 '24 14:10 FelipeMdeO

I'll take a look soon. Hold on a bit. Did this solve your problems, any other issues after you added those changes on esp-hal?

fdcavalcanti avatar Oct 14 '24 14:10 fdcavalcanti

@engdavidiogo is everything ok in your side ?

FelipeMdeO avatar Oct 14 '24 15:10 FelipeMdeO

Yes @FelipeMdeO , I can reproduce the build without any errors.

@fdcavalcanti I continue testing and have no apparent problems

engdavidiogo avatar Oct 14 '24 15:10 engdavidiogo

@fdcavalcanti We are able to update firmware using secure link, please lets update 3rdparty in nuttx master.

FelipeMdeO avatar Oct 16 '24 14:10 FelipeMdeO

Reference

We are testing the changes internally. As soon as our CI finishes, we can merge it. Thanks!

tmedicci avatar Oct 17 '24 17:10 tmedicci

Hi @engdavidiogo and @FelipeMdeO ,

We merged it on release/v5.1.c branch:https://github.com/espressif/esp-hal-3rdparty/commit/26d4d1b57d54b63384b4e466b9e644ff0fe702b5

Can you please test it setting ESP_HAL_3RDPARTY_VERSION=26d4d1b57d54b63384b4e466b9e644ff0fe702b5 before the make command to build NuttX? (we'd still need to update the hash for the HAL on NuttX)

tmedicci avatar Oct 18 '24 12:10 tmedicci

Hi @tmedicci thanks for the support with this!

Closing...

engdavidiogo avatar Oct 22 '24 17:10 engdavidiogo