My code goes to Default_Handler routine...

13 Dec 2017

Hi to all, I'm facing with a strange problem; I have realized a code for mbed using MODSERIAL library, for communicate with a WiFi module mounted over NUCLEO F411RE board. I use the WiFi module for connect to a NTP server to synchronize my clock; the WiFi connection goes well but the problems are for the socket connect/disconnect operations. In debug mode the first connection and disconnection to the NTP server goes well, but if I try to reconnect, the WiFi connection doesn't get any problems, but the socket connection goes down and the code blocks in Default Handler routine (invoked by HardFault_Handler()). This code works perfectly without MODSERIAL library, but I decided to use this library to handle the asynchronous messages received from WiFi module. To find the problem, I initially excluded all other external interrupts, but the problem remains. So I tried to check the heap memory problems, so I put some breakpoints on _sbrk method in mbed_retarget.cpp file, but there is no problem also in this case. Please, could anyone have any solution for this problem ? Could anyone suggest me which ways explore to find a solution ? Regards

Davide Urbano