This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Linker RAM setting changes between 12.1 and 12.2

I've been trying to trying to upgrade some code from SDK 12.1 to 12.3 and it no longer fits in 16k RAM.

I initially thought the problem was this data segment in the linker file, as it got added at 12.1 I've eventually tracked the problem down to this difference in the gcc linker file

  .pwr_mgmt_data :
  {
    PROVIDE(__start_pwr_mgmt_data = .);
    KEEP(*(.pwr_mgmt_data))
    PROVIDE(__stop_pwr_mgmt_data = .);
  } > RAM

And this data section is not needed apart from the power management and SAADC examples, so can be removed

However this didn't free up much RAM, and I still got the error with there not being enough memory for the stack

As a temporary fix I have changed the heap size by adding an assembler directive

ASMFLAGS += -D__HEAP_SIZE=1024

But ideally it would be good to know what has changed between 12.1 and 12.3 that prevent my application from working in 12.3 when it worked fine in 12.1 without adjusting the heap.

PS. I checked all the linker files and the startup assembler and they all seem to be identical, so I'm not entirely sure what the difference is.

It could just be that my application was very close to the edge in 12.1 and some other minor change in 12.2 pushed it over the edge.

But it would be good to

Parents Reply
  • OK. I didn't realise that that section should be in Flash.

    It just didn't seem to be required a unless the power management driver was being used

    Could you tell me what the correct linker settings for this to put it in Flash ?

    Re: Heap size.

    I've now reduced this to 512 as I've switched to using Segger RTT and this seems to require even more stack space.

    I'm not currently using malloc, so I may reduce it the heap to zero.

Children
No Data
Related