I ported FreeRTOS IAR to GCC using Ride.
I can to create a Task for test and run good when I don´t use delay.
So when I use vTaskDelayUntil the scheduler never finish, and the kernel never return to execute the task. In debug mode, I found out the problem occur in WDG_IRQHandler, because in assemble debug the instruction don´t start in begin of the function, but start in the instruction os reset the WDG (WDG->SR &= ~0x0001;) and after execute the vPortEnterCritical and vPortExitCritical and return to WDG Reset, and so on.
My kernel can´t use task delay because this problem.
I’m not sure if I understand the description of your problem exactly. I am assuming you are using the watchdog peripheral to generate the tick interrupt. Is this correct?
I’ve just checked the STR75x RIDE port to see how the interrupt is set up. In this example the file crt0_STR75x_FreeRTOS.s has been updated to place the vPortTickISR handler on the TB peripheral (would be the watchdog peripheral in your case). Also the IRQ handler itself is written as:
IRQHandler:
portSAVE_CONTEXT /*; Save the context of the current task. */
LDR r0, =EIC_base_addr
LDR r1, =IVR_off_addr
LDR lr, =ReturnAddress /*; Load the return address. */
ADD pc,r0,r1 /*; Branch to the IRQ handler. */
ReturnAddress:
LDR r0, =EIC_base_addr
LDR r2, [r0, #CICR_off_addr] /*; Get the IRQ channel number. */
MOV r3,#1
MOV r3,r3,LSL r2
STR r3,[r0, #IPR_off_addr] /*; Clear the corresponding IPR bit. */
portRESTORE_CONTEXT /*; Restore the context of the selected task. */
to ensure the context is saved prior to the branch to vPortTickISR.
This is just one method of doing this, whereby the context is saved and restored by a single IRQ handler before jumping to the peripheral handler. Other examples jump directly to the peripheral handler where the handler can decide if it needs to save and restore the context of not.
vPortTickISR is defined within portISR.c, which must be compiled into ARM mode.
I have got a GCC port working for the STR9, although at the moment it is only running 1 task with a vTaskDelayUntil to flash an LED. I based it on a STR75c GCC port.
I have it configured to use any one of the 4 timers, I wanted to keep the watchdog timer free in case I needed to use it as a watchdog.
I am using it with Eclipse, but you are welcome to a copy if it will help you.