FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [March 2009 Threads] Bug in FreeRTOS??Posted by Konoppo on March 23, 2009 Hi!!
I noticed a strange thing! When 3 tasks have been started without enough free stack system crashed! I didn't return from last xTaskCreate! System crashed in prvAllocateTCBAndStack function - it didn't come out from: memset( pxNewTCB->pxStack, tskSTACK_FILL_BYTE, usStackDepth * sizeof( portSTACK_TYPE ) );
When I simply comment this line (it is useful only when debuging) system start working correctly! It means it returned an error code from xTaskCreate function insted of hang up in this function!!
Is it a kind of bug?? Or maybe I made something wrong??
I use FreeRTOS on LPC2364 ARM7 microcontroller.
Regards Konoppo
RE: Bug in FreeRTOS??Posted by Dave on March 23, 2009 Most likely your linker script is wrong, or the startup code is not correctly initializing variables.
RE: Bug in FreeRTOS??Posted by Konoppo on March 23, 2009 For what should I pay attention in linker script or in startup code?? In my opinion both are correct but maybe I missed something ;)...
RE: Bug in FreeRTOS??Posted by Richard on March 23, 2009 If there is not enough heap space to create a task then pvPortMalloc() will return NULL and xTaskCreate() will never call memset(). Do you mean without enough stack, or do you mean without enough heap? (you say stack).
Which heap implementation are you using, heap_1, heap_2 or heap_3?
Which compiler are you using?
Regards.
RE: Bug in FreeRTOS??Posted by Konoppo on March 23, 2009 OK, thanks for suggestion!! The USER_MODE stack size was only 2kB, when the total cheap size for freeRTOS was 4kB ;)... When I changed it everything is OK now :)...
RE: Bug in FreeRTOS??Posted by Konoppo on March 23, 2009 I use heap_2, and I should say "heap" instead of stack ;)... But problem Was in stack size, I think... When I increased it - everything is OK now. But I think it's not good idea, that xTaskCreate() call memset in this situation and crash system (my uC went to address like 0xa5000000 and NOPs instruction)...
Regards Konoppo
RE: Bug in FreeRTOS??Posted by Richard on March 23, 2009 Are you suggesting each line if FreeRTOS should check the user has not overflowed the stack before executing - even before the scheduler has been started?
Regards.
RE: Bug in FreeRTOS??Posted by Konoppo on March 23, 2009 OK, you are right, my suggestion was a bit stupid ;)... For me it wasn't obvious that freeRTOS uses a Supervisor Stack Size...
RE: Bug in FreeRTOS??Posted by Konoppo on March 23, 2009 OK, please, tell me - which memory is used by freeRTOS for "heap"?? It's a free RAM (bss_section) or it's stored in the stac region?? I thought that heap uses the stack region but now I think that it's stored in BSS section (like any other variable)... I use GCC...
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|