Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Real time embedded FreeRTOS mailing list 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT Training




Loading

System halt after running for a long time

Posted by joe_her on November 3, 2015

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


System halt after running for a long time

Posted by rtel on November 3, 2015

Is this using the FreeRTOS Windows port, which is often referred to as the Windows simulator, or is it a simulation you have created yourself?


System halt after running for a long time

Posted by joe_her on November 3, 2015

Using FreeRTOS windows port. Thanks


System halt after running for a long time

Posted by rtel on November 3, 2015

Are you using any Windows system calls, such as printf, or WinSocks? Those are known to cause issues, although there are workarounds.

Also, we have noticed strange behaviour when calling rand(), so will provide our own version if it is necessary.

Regards.


System halt after running for a long time

Posted by joe_her on November 3, 2015

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...


System halt after running for a long time

Posted by rtel on November 3, 2015

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.


System halt after running for a long time

Posted by joe_her on November 3, 2015

Yep, commenting out the UDP removed the problem, now I'll do the workaround. Thanks agian, many hours saved....


System halt after running for a long time

Posted by joe_her on November 11, 2015

Just by running that UDP task from windows thread with _beginthread ( ) , and communicating to FreeRTOS via a buffer fixed all these issues. Thanks again.


[ Back to the top ]    [ About FreeRTOS ]    [ Sitemap ]    [ ]




Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.


Free TCP/IP and file system demos for the RTOS


Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists