Showing results for 
Search instead for 
Did you mean: 

mbedTLS Error -21 in recv() After Running for a Few Hours on STM32H7ZIT6


Hello Community,

I am encountering an error after my STM32H7ZIT6 device runs for a few hours. The device is intended to send and receive data from AWS. The error logs show repeated instances of mbedtls_ssl_read_record() returned -27648 (-0x6c00), ultimately resulting in net_recv failed - -109

Error Logs:

./Middlewares/ST/STM32_Connect_Library/services/net_mbedtls.c:484 mbedtls_net_recv() : error -21 in recv() - requestedLen=5
0x2403b150 => ../Middlewares/Third_Party/mbedTLS/library/ssl_tls.c:3957: mbedtls_ssl_fetch_input() returned -27648 (-0x6c00)
0x2403b150 => ../Middlewares/Third_Party/mbedTLS/library/ssl_tls.c:3820: mbedtls_ssl_read_record_layer() returned -27648 (-0x6c00)
0x2403b150 => ../Middlewares/Third_Party/mbedTLS/library/ssl_tls.c:7006: mbedtls_ssl_read_record() returned -27648 (-0x6c00)

ERROR: ../Middlewares/ST/STM32_Connect_Library/services/net_mbedtls.c:383 failed
! mbedtls_ssl_read returned -0x6c00

ERROR: iot_tls_read L#208 net_recv failed - -109

AWS Firmware Version: 1.4.0 (07-June-2019 04:09:58 PM), X-CUBE-AWS

I would appreciate any suggestions on potential causes and solutions for this issue. If there are any known issues or patches related to this error, please let me know.

Thank you