Hi,
I'm working on an example where I am using Bluetooth Client and LWS functionalities in parallel.
Strange enough, the mbedtls return -0x10 on the handshake if the Bluetooth is activated but works fine if the Bluetooth was deactivated!
Screenshot here showing the error and the free memory space on the internal and external RAM :
https://ibb.co/mbznro
I checked the error code of the mbedtls but couldn't find what type of error corresponds to -0x10 ..
https://tls.mbed.org/api/ssl_8h.html#a7 ... 66c8602177
Using IDF 3
https://github.com/espressif/esp-idf/tr ... cf1181458f
Any help ?
I appreciate the help ))
mbedtls handshake return -0x10
Re: mbedtls handshake return -0x10
Hi formus,
mbedTLS error -0x10 is MBEDTLS_ERR_MPI_ALLOC_FAILED ("memory allocation failed"). Probably there is enough free heap memory only when Bluetooth is disabled.
Depending on which Bluetooth modes you are using (BLE or Bluetooth Classic), you can release some of the Bluetooth controller memory at runtime. See here:
https://docs.espressif.com/projects/esp ... _bt_mode_t
(The documentation link is to the master branch but this function is available in V3.0 and works the same.)
If releasing BT controller memory isn't enough, you may need to look at other ways to reduce overall memory usage in your app.
mbedTLS error -0x10 is MBEDTLS_ERR_MPI_ALLOC_FAILED ("memory allocation failed"). Probably there is enough free heap memory only when Bluetooth is disabled.
Depending on which Bluetooth modes you are using (BLE or Bluetooth Classic), you can release some of the Bluetooth controller memory at runtime. See here:
https://docs.espressif.com/projects/esp ... _bt_mode_t
(The documentation link is to the master branch but this function is available in V3.0 and works the same.)
If releasing BT controller memory isn't enough, you may need to look at other ways to reduce overall memory usage in your app.
Re: mbedtls handshake return -0x10
Hello ESP_Angus,ESP_Angus wrote: ↑Mon Jul 09, 2018 12:53 amHi formus,
mbedTLS error -0x10 is MBEDTLS_ERR_MPI_ALLOC_FAILED ("memory allocation failed"). Probably there is enough free heap memory only when Bluetooth is disabled.
Depending on which Bluetooth modes you are using (BLE or Bluetooth Classic), you can release some of the Bluetooth controller memory at runtime. See here:
https://docs.espressif.com/projects/esp ... _bt_mode_t
(The documentation link is to the master branch but this function is available in V3.0 and works the same.)
If releasing BT controller memory isn't enough, you may need to look at other ways to reduce overall memory usage in your app.
We are exactly facing same issue while using BLE mode as per our application requirement and in parallel we are using secure connection for Firmware Update.
So, We will check below setting and will let you know if it would be helpful for us or not.
Note - We are using ESP32 IDF 3.2 version as of now for our already developed product.If the app calls esp_bt_controller_enable(ESP_BT_MODE_BLE) to use BLE only then it is safe to call esp_bt_controller_mem_release(ESP_BT_MODE_CLASSIC_BT) at initialization time to free unused BT Classic memory.
Regards,
Ritesh Prajapati
Ritesh Prajapati
Re: mbedtls handshake return -0x10
Hello ESP_Angus and Team,
We have done some more debugging into it and found that if we disable Bluetooth Controller then we able to update firmware into secure way without any issue.
Then we have also checked both internal and external memory and found that internal memory goes beyond limit like 5KBytes due to which mbedTLS component is not able to read certificates as per requirements.
So, There is workaround to disable BLE component and controller when Secure Firmware Update is ongoing.
We have done some more debugging into it and found that if we disable Bluetooth Controller then we able to update firmware into secure way without any issue.
Then we have also checked both internal and external memory and found that internal memory goes beyond limit like 5KBytes due to which mbedTLS component is not able to read certificates as per requirements.
So, There is workaround to disable BLE component and controller when Secure Firmware Update is ongoing.
Regards,
Ritesh Prajapati
Ritesh Prajapati
Who is online
Users browsing this forum: No registered users and 95 guests