I am using an STM32F407 processor. The code I have monitors an ethernet PHY, and if the link goes down and then back up again, such as if someone removes and then reattaches an ethernet cable, it calls the function init_TcpNet(). Intermittently, the unit will crash a short time later - not inside init_TcpNet, but at some random point later in the code. The call stack says that it was in SVC_Handler, which in turn was calling rt_mut_release.
I notice that none of the example code projects ever call init_TcpNet more than once, and they all do it when the program starts. However, if (for example) there is no cable plugged in initially, it seems you need to call it later when the cable is actually plugged in.
Is there a problem with calling init_TcpNet more than once? Or, is there some other way to initialize the stack when the PHY detects a change in the network?