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] [October 2009 Threads] How to manage memory on PIC24.Posted by Nakorn Threesinghawong on October 7, 2009 Hi,
I start to use freeRTOS. But i have some problem. when i announce more variable,Compiler is build failed. it show message "..\..\Source\croutine.o: Link Error: Could not allocate section .ndata, size = 2 bytes, attributes = data near Link Error: Could not allocate data memory ---------------- Release build of project `C:\FreeRTOS\Demo\PIC24_MPLAB_Edit\RTOSDemo_PIC24.mcp' failed. Wed Oct 07 15:04:38 2009 -------------------
BUILD FAILED
"
please advice me.
RE: How to manage memory on PIC24.Posted by Peter on October 7, 2009 Hej, as the linker said -> Could not allocate data in section -> NDATA. You are running out of RAM. This ram is being static declared in your source code. e.g. unsigned char buffer[512]; This statement will allocate 512 bytes of memory. So you need to reduce the memory usage of freeRTOS. See in FreeRTOSconfig.h for the parameters. Also have a look in MPLAB at View -> Memory Usage Gauge to have an overview of you consumed ram.
Kind regards, Peter
RE: How to manage memory on PIC24.Posted by Richard on October 7, 2009 Look at the configTOTAL_HEAP_SIZE parameter in FreeRTOSConfig.h. It allocates a huge array that is used as the heap. Lowing it will reduce the RAM consumption.
Regards.
RE: How to manage memory on PIC24.Posted by Nakorn Threesinghawong on October 8, 2009 Thank You.
First i look to Memory Usage Gauge,When i do not add variable. it show that have free memory about 2042 byte. But When i add more variable,i build Failed.
Second i try to reduce configTOTAL_HEAP_SIZE from 5120 to 4864 byte. but it do not work too.
Best regards. EchoRtos
RE: How to manage memory on PIC24.Posted by Richard Damon on October 8, 2009 Note that it said you were out of "near" memory. Pic24s have if I remember right 2k of "near" ram and the rest is "far" ram. You may need to change your memory model or explicitly declare some buffer to be put into "far" memory.
RE: How to manage memory on PIC24.Posted by Nakorn Threesinghawong on October 8, 2009 Thank you very much for your kindy.
it work, when i announce with far attribute.
Other Question. When i announce configTOTALHEAPSIZE 4864 byte, But memory useage gauge is show that it use data memory same as announce 5120 byte. Why?
Best regards. EchoRtos
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|