arm/gcc context switch not enabling interrupt

dsvend wrote on Thursday, March 06, 2008:

dear forum,

I have an acquistion interrupt running at SSC with DMA, 4Khz, but I am missing interrupts when I use the Webserver application. The EMAC ISR is takes only 50us, but the RTOS takes 500us or more to listen to the SSC interrupt request.
So my conclusion is that when the EMAC ISR makes a conext switch, it does not enable interrupts after it.
If I do not request the webserver app through an app,  I never miss the SSC interrupt.

Am I right ? Is there anyway to re-enable interrupts right after the EMAC ISR has exit ?

I am using LWIP Rowley Demo with yagarto GCC 4.2.2, lwip 1.2.0, freertos 4.7.1

thanks in advance,

danilo

davedoors wrote on Thursday, March 06, 2008:

Every ISR will return to a task and leave interrupts as that task expects to find them. 

Is the WEB server generating the page that shows the stats on each task?  If so then this uses a critical section and is a very long slow process designed for demo only not production code. It could be causing your problem.

dsvend wrote on Thursday, March 06, 2008:

actually i´m not using the function vtasklist, that shows the tasks being executed. i have done my own webpage.

thanks

dsvend wrote on Friday, March 07, 2008:

i have debugged my application and came to conclusion that the function disabling the interrupt is the lEMACsend, and it is taking almost 500us to execute, that is a lot of time without interrutpts.

Now I will have to figure out how to hack this function so it does not disable the interrupt for so long.

if anyone have any suggestion, I would appreciate it.

thanks

dsvend wrote on Friday, March 07, 2008:

ok, i guess I have come to a solution:

i´ve just compared the SAM7_EMAC.c of the eclipse uip port with the Lwip rowley one, and the interrupts are disabled after the last frame to send check, so I´ve made the same thing on the lwip port and I it will fix the problem because the memcpy is the function which is really taking all the time to execute.

I hope this is a safe hack.

thanks,

danilo