2024-04-15 02:13 AM - edited 2024-04-15 02:59 AM
Problem: The project MQTT client + HTTPD + FreeRTOS = HardFault! (STM32F767ZI - nucleo)
If only the MQTT client + FreeRTOS are used, everything works fine.
If only the HTTPD + FreeRTOS are used, everything works fine.
The MQTT client + FreeRTOS work fine, but as soon as we initialize HTTPD, the project hangs after 10-180 minutes.
Moreover, HTTPD web server is in minimal configuration.
In FreeRTOSConfig.h variables were increased:
#define configTOTAL_HEAP_SIZE ((size_t)150000) (MQTT client + FreeRTOS or HTTPD + FreeRTOS works fine individually, even with HEAP = 30,000! However, when combined, it results in a HardFault error!)
In lwipopts.h, the following was increased:
#define MEM_SIZE 1024*30
#define MEMP_NUM_SYS_TIMEOUT (LWIP_NUM_SYS_TIMEOUT_INTERNAL + 1)
#define TCP_MSS 1460
#define MEMP_NUM_TCP_SEG 17
#define MQTT_OUTPUT_RINGBUF_SIZE 1024
#define MQTT_REQ_MAX_IN_FLIGHT 10
2024-04-15 02:36 AM
Some links here on debugging Hard Faults:
https://community.arm.com/support-forums/f/embedded-forum/3257/debugging-a-cortex-m0-hard-fault