at91 sam7 port – system irq

Does anyone know if you can get the DBGU serial port running under interrupt whe using the freertos?  The main tick is derived from the PIT interrupt which is handled in the low level assembler, but as this is a shared IRQ with the DBGU serial and other peripherals, is it valid to extend out from that assembler to call another handler or do you just loose that functionality so that the interrupt is purely used for the PIT scheduler interrupt and nothing else?  any thoughts would be good!  regards, Andy

at91 sam7 port – system irq

I think this came up some time back and it was suggested to simply move the generation of the tick to a different timer.  I don’t know how feasible this is.  If you want extra functionality at the same frequency then you can use a tick hook function (see the section on the WEB site docs).

at91 sam7 port – system irq

i have all the timer counter blocks used in this design to measure temperature and flow sensors!  I think i will just have to add some assembler in the portasm file to create another irq handle if the PIT status flag is not set and we are in the irq.  Andy

at91 sam7 port – system irq

As you say, you could test to see where the interrupt came from in the asm code, but my preference would be to do it in the C code.  You could call a handler that then switches to either the scheduler of dbg from within C depending on the interrupt flags.  This is just theory, I have not actually tried it. If you do it from asm code make sure you don’t alter any registers until after the context is saved.

at91 sam7 port – system irq

I have done it by modifying the portask PIT code, checking the IRQ type there and branching. Works fine.