Skip to content

linker _user_heap definition may conflict with Arduino IDE RAM calculation #8

Closed
@fpistm

Description

@fpistm

From @rogerclarkmelbourne on November 20, 2016 21:52

See http://stm32duino.com/viewtopic.php?f=48&t=1564&p=20198#p20198

@RickKimball posted

The way the arduino IDE calculates RAM usage and the way the linker script attempts to warn you about the low memory usage are in conflict. There are really 1536 bytes of RAM that the linker "allocates" to the heap and the stack. However, the linker's approach doesn't really reflect how much heap or RAM is used. The arduino IDE knows how much RAM a board/chip has and will report low memory issues with a warning about stability. However, neither approach is accurate.

You could probably change the linker script part here from:

 ._user_heap_stack :
   {
     . = ALIGN(4);
     PROVIDE ( end = . );
     PROVIDE ( _end = . );
     . = . + _Min_Heap_Size;
     . = . + _Min_Stack_Size;
     . = ALIGN(4);
   } >RAM

to:

 ._user_heap_stack :
  {
  . = ALIGN(4);
 PROVIDE ( end = . );
 PROVIDE ( _end = . );
 } >RAM

This would stop the reporting of a bogus RAM memory usage and in our case, the arduino IDE will start complaining if you are getting too close to the edge.

Copied from original issue: fpistm/Arduino_Core_STM32L4#6

Metadata

Metadata

Assignees

No one assigned

    Labels

    question ❓Usually converted as a discussion

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions