Re: STM324Discovery+LAN8720
Posted: Thu Jan 29, 2015 9:03 am
Interestingly, if
#define CH_DBG_SYSTEM_STATE_CHECK TRUE
SV # 4 happens during initialization tasks "lwip_thread", and if
#define CH_DBG_SYSTEM_STATE_CHECK FALSE
see the situation described above (a few pings).
CH_DBG_SYSTEM_STATE_CHECK and CH_DBG_ENABLE_ASSERTS allows you to abort program flow if an anomaly occurs in an api call.
Or any of your own routines where you've added chDbgAssert or chDbgCheck.
If disabled, most of the bad api calls just pass as if they are ok. But they were actually called from a faulty mode or with wrong arguments. Which might cause undefined behavior.
For example, calling chSysLock twice, from a callback, or from an ISR throws your exception.
There are differences between chSysLock and chSysLockI. Get to know them. http://chibios.sourceforge.net/html/concepts.html