Quality RTOS & Embedded Software

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




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) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.


Free TCP/IP and file system demos for the RTOS


Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

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

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

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

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists