Skip to main content
Vlad Mishustov
Associate
May 10, 2019
Solved

How to change memory areas in CubeIDE?

  • May 10, 2019
  • 1 reply
  • 3370 views

If I need to change memory areas in project (for example for Read-only memory I need 0x8080000 start, 0x40000 size), how can I do in in CubeIDE ?

(addition) I have found Build analyzer, but the fields are not changeable, only view.

This topic has been closed for replies.
Best answer by OStan.1

Hi VMish,

I believe that by now you would have found a solution to your problem, but like me, there must be others too, who are seeking a solution. I am using both CubeIDE and Keil MDK. Keil has a GUI based solution to this problem to set the memory regions, but I didn't find one in CubeIDE, so I'm thinking there must be a plugin or something that helps in this matter.

Anyway, for now, my solution requires the user to simply modify the LinkerScript.ld file located in the project. LinkerScript.ld will be renamed however to reflect the used MCU, ex. STM32F030F4PX_FLASH.ld. In this file you have:

/* Memories definition */

MEMORY

{

 RAM  (xrw)  : ORIGIN = 0x20000000,  LENGTH = 4K

 FLASH  (rx)  : ORIGIN = 0x8000000,  LENGTH = 16K

}

Modify, save and build. That should do it.

I hope it helps,

OG.

1 reply

OStan.1
OStan.1Best answer
Visitor II
October 12, 2020

Hi VMish,

I believe that by now you would have found a solution to your problem, but like me, there must be others too, who are seeking a solution. I am using both CubeIDE and Keil MDK. Keil has a GUI based solution to this problem to set the memory regions, but I didn't find one in CubeIDE, so I'm thinking there must be a plugin or something that helps in this matter.

Anyway, for now, my solution requires the user to simply modify the LinkerScript.ld file located in the project. LinkerScript.ld will be renamed however to reflect the used MCU, ex. STM32F030F4PX_FLASH.ld. In this file you have:

/* Memories definition */

MEMORY

{

 RAM  (xrw)  : ORIGIN = 0x20000000,  LENGTH = 4K

 FLASH  (rx)  : ORIGIN = 0x8000000,  LENGTH = 16K

}

Modify, save and build. That should do it.

I hope it helps,

OG.