I have configASSERT enabled, stack checking enabled, calling vPortValidateInterruptPriority from all interrupts to verify priorities, and only calling from ISR API functions inside interrupts. However, intermittent faults continue to exist, mainly while in idle task it appears. I am using the SAM4L tickles port, IAR compiler, and the ATMEL ASF.
Looking at the FAQ:
- The application I created compiles, but does not run – it runs for a while…
- Stacks – overflow detection is on, calls to uxTaskGetStackHighWaterMark() show over 1000 bytes of stack available to all stacks including cstack
- I added a simple task to a demo, and now the demo crashes! – few thousands bytes of heap left after allocating all stacks
- Using API functions within interrupts – not calling non ISR API from interrupt doing…
- The RTOS scheduler crashes when attempting to start the first task – getting past this point
- The interrupt enable flag gets set incorrectly – hmmm. See below.
- My application crashes before the RTOS scheduler is even started – I may be allowing posting to queues prior to RTOS starting…
- Suspending the RTOS scheduler (calling vTaskSuspendAll()) causes me problems – my application never suspends the scheduler.
- I have created a new application - but it will not compile – my application compiles
- I get stuck on the line that starts – not having this problem
I don’t believe my application disables interrupts, however, I am using the ASF which does. There are so many interrupt disabling functions, it is unclear to me what I can and cannot be using. Should I be changing the Atmel ASF to replace the interrupt disabling with portENTER_CRITICAL?
cpu_irq_disable/ Disable_global_interrupt —same as Disable_global_interrupt / used by ASF and WDT
taskENTER_CRITICAL – used in freeRTOS and SAM4L_low_power_tick_management
__disable_interrupt – used by port.c
__disable_irq- used by ASF (interrupt_sam_nvic)
portDISABLE_INTERRUPTS –used by freertos
vPortEnterCritical / portENTER_CRITICAL – used by port.c
portDISABLE_INTERRUPTS / ulPortSetInterruptMask – used by port.c and FreeRTOS