Hello
I created a task, which should write to a memory position an incrementing value as follows:
static void prvRead_Task( void *pvParameters )
{
pointer = (int*)0x3000000;
*pointer = 0;
for (;;)
{
//void (*p)(void) = address;
//p();
for(i=0;i<0x10000000;i++){
*pointer = i;
}
xil_printf("Script Successfully Excecuted!\r\n");
vTaskSuspend(xTaskRead);
}
}
The problem is that if I run the task, the last value it writes is 0x0031fda3.. This is the task with the highest priority, so here is no other task running at the moment.
How can this problem be fixed??
Thanks
I don't see a definition of pointer here, I assume it is an int*.
is the address 0x3000000 used by anyone? If this is in your ram space, if something has been placed here (like a FreeRTOS control structure), you may crash something.
Hi richard. Thank you for your answer.
Yes.. the pointer is defined as an int *
int * pointer;
And no.. I don't have anything on this ram space.. if I write a fixed value it works..
If I use for example for(i=0;i<0x1000;i++) It works fine... but with a big number the task doesn't finish (I think that is what is happening) and writes until certain value and stops...
Thanks
Sounds like the problem is that if you take over a certain amount of time things have problems. It could be that the location is being used by an interrupt (have you checked you link map that the location is unused). It could be some interrupt corrupting something that causes this to crash.