I got a PC freertos simulation that looks OK, but after running for a few hours, it freezes.
I set breakpoints in all tasks, and no BP is hit, the only running loop is the prvSimulatedPeripheralTimer (), infinite for(; loop.
Any ideas that will help debugging this will be appreciated.
Thanks.
Johanan
Using winsoc for UDP. Actually the simulation is used as development for the STM32F4 target. The same code is used (using compiler #ifdef whenever necessary) for the PC simulation and target. All I/O hardware done by functions calls. In the simulation, it sends and receives UDP packets to an Arduino that activates all I/O, while the target uses the same function calls for real I/O.
If the problem is with the UDP socket, then I don’t mind too much, as this is just a simulation. How can I verify this?
My current strategy is to comment out functions, until the one that creates the problem will be found. Whoever this takes a very long time…
If you download the FreeRTOS+TCP source code
(http://www.freertos.org/tcp) you will see how we get around this.
Some of the demos use FreeRTOS+TCP sockets to communicate with WinSock
sockets. To do that reliably all use of the WinSock API is done inside
standard Windows threads (as opposed to Windows threads that are under
the control of the FreeRTOS scheduler). The standard Windows threads
then use a stream buffer (thread safe circular buffer with no system
calls) to pass data to and from the FreeRTOS tasks. The key is not to
have Windows system calls in FreeRTOS tasks themselves.
Just by running that UDP task from windows thread with _beginthread ( ) , and communicating to FreeRTOS via a buffer fixed all these issues.
Thanks again.