Hello,
I really need some help here, with my first attemp to blink a LED
inside a simple task,
I’m using pic32MX795F512L, and I checked the configuration fuses
without FreeRTOS kernel, everything works fine.
then i used the demo provided with the FreeRTOS download to make my own
code, here is the small code that i create
define LEDR_SYSTEM LATCbits.LATC1 // inverse
static void prvSetupHardware( void );
portBASE_TYPE TaskValid ;
void vTask1(void *pvParameters)
{
portTickType xLastWakeTime;
char toggle;
xLastWakeTime = xTaskGetTickCount();
for(;;)
{
if(toggle ==1)
LEDR
SYSTEM = 0, toggle = 0;
else
LEDRSYSTEM = 1, toggle = 1;
vTaskDelayUntil(&xLastWakeTime,(10000/portTICK
RATEMS));
}
}
void main( void )
{
TRISCbits.TRISC1 = 0;
TaskValid = xTaskCreate(vTask1,"Task 1",1000,NULL,1,NULL);
vTaskStartScheduler();
for(;;);
}
So I had a clean build for this code and ofcourse nothing working on the
board, yet i noticed when i start debugging that the debugger tells me
that the breakpoint in the line “portTickType xLastWakeTime;” in the
task function is not valid, here is the exact error i’m getting
Break point at line 82 in file C:/*****/main.c cannot be resolved to a
valid program memory address
and i’m getting the same error in each line inside the vTask1 function
I think that the function xTask1 function doesn’t exist in the program
memory, and some how the code failed to create it.
I checked the return value of the xTaskCreate and it is equal to 1,
which means that the task was created successfully
another thing that i noticed is about the parameters portTICK
RATEMS,
i followed it’s definition and here what i found
define portTICKRATEMS ( ( portTickType ) 1000 /
configTICK
RATEHZ )
define configTICKRATEHZ ( ( portTickType ) 1000 )
That’s mean portTICK
RATEMS is equal to 1 ?, is that normal ? cause i’m
not sure yet whether the portTICK
RATEMS is defined and calculated by
default or it is the programmer job.
I Really appreciate any help from you guys, cause i have like 10 days to
integrate a GPS module in FreeRTOS