Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT




Loading

Task doesn't complete

Posted by monica on May 6, 2013
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

RE: Task doesn't complete

Posted by Richard Damon on May 6, 2013
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.

RE: Task doesn't complete

Posted by monica on May 6, 2013
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

RE: Task doesn't complete

Posted by Richard on May 6, 2013
Check:

1) That the code works as expected when FreeRTOS is not running, then, assuming it does
2) That nothing else is using this RAM space when FreeRTOS is running.
3) That the code works (or not) when that is the only task that is running.
4) That sizeof( i ) is at least 4. If you are using a Microblaze, it probably isn't and you will need to make i an long rather than int.

Regards.

RE: Task doesn't complete

Posted by Richard Damon on May 7, 2013
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.


[ Back to the top ]    [ About FreeRTOS ]    [ Sitemap ]    [ ]




Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

FreeRTOS kernel V10 is available for immediate download. Now MIT licensed.


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

OpenRTOS and SafeRTOS