Discussion in "ARM Development" started by    bikashh    Aug 16, 2012.
Thu Aug 16 2012, 06:46 pm
#1
Hello all,
I am doing a project where the microcontroller is receiving packets of data from the server via wifi, which i am receiving in a buffer. My buffer size is of 500 i.e it can receive only 500 bytes from it. But I want to increase the size of this buffer and whenever i try to increase the size, my IDE gives an error that RAM is overflowed by xxx bytes.

My controller is STM32F100xx
Flash : 128kBytes
RAM : 8KBytes.
A small part from the standard .ld file
/* Entry Point */
ENTRY(Reset_Handler)

/* Highest address of the user mode stack */
_estack = 0x20002000;    /* end of 8K RAM */

/* Generate a link error if heap and stack don't fit into RAM */
_Min_Heap_Size = 0;      /* required amount of heap  */
_Min_Stack_Size = 0x80; /* required amount of stack */

/* Specify the memory areas */
MEMORY
{
  FLASH (rx)      : ORIGIN = 0x08000000, LENGTH = 128K	
  RAM (xrw)       : ORIGIN = 0x20000000, LENGTH = 8K
  MEMORY_B1 (rx)  : ORIGIN = 0x60000000, LENGTH = 0K
}


From the .map file, i came to know that my heap is starting from 0x1610 which means for stack and heap we are using 2.48KBytes whcih we can decrease to 1K and we can increase the buffer from 500 bytes to 1K.
A part from .map file for heap beginning
._user_heap_stack
                0x20001610       0x80 load address 0x080040b4
                0x20001610                . = ALIGN (0x4)
                0x20001610                PROVIDE (end, .)
                0x20001610                PROVIDE (_end, .)
                0x20001610                . = (. + _Min_Heap_Size)
                0x20001690                . = (. + _Min_Stack_Size)
 *fill*         0x20001610       0x80 00
                0x20001690                . = ALIGN (0x4)


Now my question is how can i make this happen, I mean how can I push the starting of the heap? Correct me if I am wrong somewhere...
Thanks in advance.
Tue Aug 21 2012, 02:42 am
#2
looks like you're using a lot of ram. try to use more local variables than global. which IDE you're using? and are you using any RTOS?

Get Social

Information

Powered by e107 Forum System

Downloads

Comments

JamesroW
Mon May 06 2024, 09:37 am
Chrispes
Mon May 06 2024, 07:34 am
ArktiTic
Sun May 05 2024, 07:06 pm
CesslasyNear
Sun May 05 2024, 02:58 pm
chimichmedic1204
Sun May 05 2024, 11:06 am
Jamiegob
Sun May 05 2024, 10:11 am
Gregoryjed
Sun May 05 2024, 10:02 am
Mariocax
Sun May 05 2024, 08:51 am