PIC32 setting breakpoints at runtime issue
I'm experiencing a weird problem while adding a breakpoint at run time. This action unexpectedly generates a DHCP_EVENT_CONN_LOST event just a second before the breakpoint takes place.
I always paused or added a breakpoint at runtime, therefore, I suppose that PIC32 allows setting breakpoints at run time without interfering with running code. Is this true?
More details. I am debugging a PIC32MZ2048EFM064 connected to a LAN8740 that runs Harmony 3. It includes FreeRTOS, core 3.7.2, and net 3.6.1. Of course, the IDE is MPLAB-X 5.40 and the debugger is a Real ICE.
The unexpected behaviour occurs after the DHCP module receives a valid IP and does not depend on how long it is running.
For example, the PIC32 at startup receives a valid IP, the web pages start to work regularly, then, adding a breakpoint in any point the console reports a DHCP_EVENT_CONN_LOST and immediately after the software halts on the fresh set breakpoint.
Investigating the code, it seems that this event is raised by TCPIP_MAC_EV_CONN_LOST. Moreover, this flag comes from _TCPIP_ProcessTickEvent that periodically checks for links up/own. But in drv_ethmac.c I am not able to localize what causes _DRV_ETHMAC_LinkStateStartLink returning false just a moment before the breakpoint is added.
I appreciate any suggestions, maybe I am just missing some stupid thing here.