FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [October 2005 Threads] ATMEGA32 resetsPosted by Nobody/Anonymous on October 7, 2005 Hello,
My AVR ATMEGA32 resets automatic after a fixed amount of task cycles. I have 3 tasks running 2 of them control leds and one for I2C communication. It is always after a fixed amount (120) of I2C communication cycles that MCU starts over again. Can it be a stack overflow or is TOTAL_HEAP_SIZE == 500 too small??
Regards Adrian.
RE: ATMEGA32 resetsPosted by Nobody/Anonymous on October 7, 2005 Is there a kind of Watchdog build into FreeRTOS??
RE: ATMEGA32 resetsPosted by Nobody/Anonymous on October 8, 2005 I found out that if I turn all variables in my functions to static variables it keeps running (longer?).
Is there anyway to monitor the actual heap/stack size??.
The example program increments a reset counter in EEPROM at the start of the main() function, how do I read the current value?
RE: ATMEGA32 resetsPosted by Richard on October 8, 2005 No, but there is on the MegaAVR. Have you switched it off?
RE: ATMEGA32 resetsPosted by Nobody/Anonymous on October 8, 2005 I hava switched off the watchdog with the function wdt_disable();
RE: ATMEGA32 resetsPosted by Richard on October 8, 2005 The stacks are filled with 0xa5, so you can stop on the debugger, inspect the stack, and see where the high water mark is.
When you have the trace facility enabled there is a function prvListTaskWithinSingleList() within tasks.c that in turn calls usTaskCheckFreeStackSpace(). However it is difficult to use these functions if you have very limited RAM. Also these functions leave interrupts disabled for an extended period so they are ok for debugging, but not recommended for normal use.
Before making the variables static it was taking a particular length of time for your application to crash - suggesting a possible cause being the stack getting used up.
Now by making the variables static you are removing most of the stack usage - and the program runs longer. This would suggest that whatever is using up the stack is still causing a problem and nothing has really changed, its just that making the variables static you are delaying the symptom. This would suggest that there is an unrelated cause - maybe interrupts not completing correctly?
Regards.
RE: ATMEGA32 resetsPosted by Nobody/Anonymous on October 8, 2005 Are you yielding from within the ISR? If so are you doing it at the very end of the ISR (which you must do)?
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|