I’m using the FreeRTOS port AVR32 UC3A0512 (Atmel EVK1100 Starter Kit)! In my application i two interrupt service routines which manage the RS232 traffic like in the demo application. Everything works fine with no RS232 traffic. With RS232 traffic Free RTOS crashes after an undefined time. Sometimes the Application runs half an hour with a lot of RS232 traffic before RS232 crashes. When a crash occours and i stop the Application in debug mode (Jtag mk II) one of the following execptions is viewed:
“Bus error data fetch” or “Bus error instruction fetch”
Has any one a solution for this problem or can anyone give me a help to isolate the failure!?!
Have you checked the usual suspects? If your interrupt routines use API calls, do they use the "FromISR" versions? And if they do, do you correctly put a critical section around your ISR as directed in http://www.freertos.org/portAVR32.html?
I’m seeing the same problem using ATSAM7x and the Atmel eval kit (256KB part). I’m using FreeRTOS 5.3 and see a prefetch abort error.
I debugged it yesterday and I’ve been able to catch it sometimes. The crash happens during portRESTORE_CONTEXT. It is on this line:
/* And return - correcting the offset in the LR to obtain the */
/* correct address. */
"SUBS PC, LR, #4 \n\t" \
The PC is restored incorrectly and then the processor crashes because of bad opcode or data (depending on circumstance). I also notice that r14_irq contains an invalid address (0xe94e7fff) but this may be a derivative problem of the stack crash.
I originally thought it was an issue with using the Queue calls (and, yes, I am using the "FromISR" ones!). But I reduced the UART ISR to just read the byte out of the holding register and exit; the crash still occurs.
Clarification - I think my last post suggested I only read in one byte and then it crashes. In fact, it takes several bytes before the crash occurs; exact number seems to be "random".