6 years, 6 months ago.

EthernetInterface lock during debug

Hi, everyone!

I have a project where I use the EthernetInterface library. Everything is fine compiling from the online compiler. I've exported for GNU ARM Eclipse, and I can compile, flash the micro and everything is fine, again. BUT, if I run the debug mode from Eclipse (via GDB), the firmware locks during EthernetInterface.init(). If I reset the micro after the lock (so the SAME firmware start, but not via GDB), it works correctly.

Via step-by-step debug I've noticed this path: - EthernetInterface.init() - init_netif() - tcpip_init() - lwip_init() - sys_timeouts_init() - sys_timeout(...): HardFault happens in one of these calls

Since the actual position of the fault is not really replicable, I assume it is more like a timing issue in some lwip watchdog check somewhere. Anyway, as said, it happens only when GDB is running. And happens without any breakpoint set, too.

Any idea about how to solve this? The project is becoming quite big, and debugging capabilities will be quite useful...

Many thanks! MIX

Update on the topic. Looks like debugging with SWD protocol instead of plain JTAG (check "Use SWD protocol" in Debugger configuration) solves the issue. Any idea why this happens?

posted by Massimo Cristofolini 15 May 2018
Be the first to answer this question.