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

Cant debug cause it works, sic! pls hlp!

Posted by ulmus on June 6, 2012
Hi!
I have strange problem with my project. It is quite complicated: i am using 2*uart, dma, i2c, 2*spi, usb and lots of hardware, tasks, queues, semaphores...
and now have problem that when i am running app then it hangs in some place, but when i want to debug then it runs as a charm!!!
Please, do you have any suggestion?

P.S. i am running MPLAB 8.83 and PIC32MX360F512L and FreeRTOS 7.1.1

RE: Cant debug cause it works, sic! pls hlp!

Posted by ulmus on June 6, 2012
I tried to change stack sizes of every task, one by one, and i did! :) one of tasks has run out of task space... but... why i couldnt debug it? :( when i debug then i can see that stack has enough space and app works :( strange :(

RE: Cant debug cause it works, sic! pls hlp!

Posted by ulmus on June 6, 2012
I noticed that if i set priority of that task to lowest then app runs with smaller stack size, but when i set priority to higher then i have to increase stack size of that task.

RE: Cant debug cause it works, sic! pls hlp!

Posted by Dave on June 6, 2012
“it hangs in some place,”


Can you narrow that down?

Does everything stop, or just a few tasks or interrupts?

Can you leave stack overflow hooks in your release code (when the debugger is not connected) and turn on an LED, or send a UART message if it gets hit?

RE: Cant debug cause it works, sic! pls hlp!

Posted by ulmus on June 6, 2012
I tried many ways to solve that issue, but nothing... when i debug then all is working, with high and low priority, with minimal stack size. When i run in 'release' mode then it hangs, i mean all system hang, i cant get any info but, as you mention, led:) no any uart, spi or something... maybe some uart with dma would work (bypassing software), but i do not want to:)
Now i set proper priority with enough big stack and it works.
I am only wondering, why increasing priority i have to increase stack size of that task... i thought that if task has higher priority it should get less and less stack size (if there are lots of blocking... things...)

RE: Cant debug cause it works, sic! pls hlp!

Posted by woops_ on June 6, 2012
Is the compiler optimization changed when running with without debugger?

RE: Cant debug cause it works, sic! pls hlp!

Posted by ulmus on June 6, 2012
hmmm... maybe it is a problem... but i've checked now and i have set optimisation to 's', it means to very speedy:) to both: release and debug... i mean, i didnt change optimisation level between compilation types (debug, release).

RE: Cant debug cause it works, sic! pls hlp!

Posted by https://www.google.com/accounts on June 12, 2012
I have the same problem with a PIC32MX250F128D. Runs fine in the debugger, but not in release mode. My system waits forever on a queue that has a 10 mS timeout. It never comes back from the call. I submitted a new request yesterday but haven't heard anything back yet. I'm curious to know which aspect of FreeRTOS would be sensitive to a release build vs a debug build. It seems that you have already tried adjusting the task stack sizes to no avail. I've stripped out almost all of my code to just toggle an LED in the loop that contains just an xQueueReceive call with the 10 mS timeout. Just a note, the S optimization option is mainly for size, not speed. It only uses certain speed optimizations if the size is not affected.

RE: Cant debug cause it works, sic! pls hlp!

Posted by Dave on June 12, 2012
“ I submitted a new request yesterday but haven't heard anything back yet”


To who? Is this the reply you didn't receive? (post 3) https://sourceforge.net/projects/freertos/forums/forum/382005/topic/5341856


[ 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