I am developing on Atmel SAM4_Xplained board, with SAM4 processor and Atmel Studio6 GCC. I have Free RTOS working OK. The current application has serial ports running under PDC and interrupt control, with inter-task messages for internal communications. So far so good.
Now the problem. I am trying to get USB running. Everything I have tried gets the same result, the program hangs. It seems as if the global interrupts are disabled.
So far I have tried
a) make stack bigger for each task (up to 512 bytes) in Free RTOS config
b) change ISR priority from 5 (as delivered by ASF) to 11 to be less than the FreeRTOS max interrupt priority.
(even though I do not make any FreeRTOS calls in the USB stack)
c) delay start up of the USB stack for 10secs by initializing from a delayed task.
No good they all crash.
I have built and loaded the demo applications USB-CDC and USB-MSC-RTOS. These seem to work OK and I cant see any code difference between those applications and mine.
Tracing the crash seems to happen after the first interrupt to the USB handler. (I break then continue). No other interrupt is then hit after that point. When I break the program manually I find it is then in the FreeRTOS ‘lists’ and I presume that it
will effectively loop forever as no tick or other stimulus is occurring.
Given that the USB stack only runs from this one interrupt and uses callbacks to signal events then I believe it should run (but do nothing) if all the callbacks are do-nothing functions.
I also find it difficult ton see what interactions there could be between FreeRTOS and the USB stack.
Has any one successfully implemented the ASF(3.4.1) USB stack on and Atmel SAM 4 processor ?
I would be grateful for any advice on what to do next ?