I am trying to get FreeRTOS running on LPC2148. I am able to call my task function.
Inside my task funtion I want to have a delay and hence called vTaskDelay(0) (to first test things out I have zero timeout). However I dont think my task is called again, i.e, brought back to RUNNING state again…
I stepped through, the functions called by vTaskDelay(0). They are
vTaskDelay(0)->portYIELD_WITHIN_API()->vPortYield
(I’ve taken portASM.s from \FreeRTOSv10.0.0\FreeRTOSv10.0.0\FreeRTOS\Source\portable\RVDS\ARM7_LPC21xx)
and this lands up in the “SWI_Handler B SWI_Handler” defined in Startup.s .
The debugger dosent proceed further . I’ve set INCLUDE_vTaskDelay = 1 in FreeRTOSConfig.h
Can anyone tell me how to proceed ?
Does the exisiting PortYield function need to be modified ?
Exisiting vPortYield functions is,
and this lands up in the “SWI_Handler B SWI_Handler” defined in Startup.s .
It looks like you are using the default SWI handler, which does nothing
but jump to itself, so once it is entered it never exits. You need to
have the SWI handler jump to the FreeRTOS SWI handler, which in your
case is called vPortYieldProcessor. However you don’t want to try
branching to it directly, as it may be located in memory that is too far
away for a simple ‘b’ branch - instead branch to it indirectly by
loading its address. Your vector table will then look something like
this (which I have taken from here FreeRTOS Real Time Kernel (RTOS) / Code / [r2837] /trunk/FreeRTOS/Demo/ARM7_LPC2129_Keil_RVDS/Startup.s):