I am porting FreeRTOS on PowerPC arch processor P4080, basically followed the example port PPC405.
Its all successful, everything is working fine except for vTaskDelay.
Whenever there is a a call to vTaskDelay the processor gets a halted. The exception is not consistent i.e., sometimes it’s Data TLB error, sometimes it’s Program Error, and sometime it’s just Target Reset. I have tested all other functionalities, they are working fine.
But the amazing thing is, whenever I try to do step-input debugging – I never get any problem, vTaskDelay works just fine. But I run the program, I get this error.
- Can anyone tell me where could be the problem?
- Any other way to debug the issue?
Kindly help me solve it asap. As I am nearing to my master thesis dead line, without this being solved I can’t proceed further. ( I am using Re-entrant NEWLIB for printf — its working FINE, for all other functionality test)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include “stdlib.h”
include “string.h”
include “math.h”
include “malloc.h”
/* Scheduler includes. */
include “FreeRTOS/FreeRTOS.h”
include “FreeRTOS/task.h”
xTaskHandle t1,t2,t3;
volatile portTickType TempLocalVar4,TempLocalVar5;
void task1();
void task1()
{
for(;;)
{
TempLocalVar4=xTaskGetTickCount();
printf("r%dn",TempLocalVar4); //print the TICK count before delay
vTaskDelay(50);
TempLocalVar5=xTaskGetTickCount(); //Get the Tick count after delay
printf("r%dn",TempLocalVar5);
TempLocalVar4=TempLocalVar5-TempLocalVar4;
}
}
int main( void )
{
mallopt(M
TOPPAD, 0);
SetupHardware();
xTaskCreate(task1, “task1”, configMINIMAL
STACKSIZE, NULL, 7, &t1);
vTaskStartScheduler();
for( ;; );
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In the output I can only one see 45(tick count). I can surely say that its not a problem of printf function,
because, even if I remove printf and just do something like
~~~~
int a=0;
for(;;){
a++;
vTaskDelay(50);
a++;
}
~~~~~
Still I can see that the value of ‘a’, will be 1.
Thanks for your help.
Regrads