9 years, 6 months ago.

How to know memory map?

Hi, I'm trying to locate some functions at the specified address in Flash by using attribute directives, like:

attribute((section(".ARM.at_0x08010000"))) for STM32F03x void foo() { ... }

int main() { foo(); }

I wish to confirm they are correctly mapped; is there a way to know the memory map generated by the online complier (linker)?

The aim of this code is to make a bootloader-like mechanism to download and control some programs via UART or other ways.

1 Answer

9 years, 6 months ago.

In the reference manual of your target you can find the address range for the flash memory (generally starts at zero up till flash size). You cannot easily find where the online compiles places everything, however that is in principle just from start up till amount of flash being used.

If you try to place it in a section that is already used by other code (either automatically placed code or where you already placed stuff manually), you will get an error message about it. So you don't need to worry about accidentally placing two code blocks on top of each other.

Accepted Answer

Erik, thank you for your comments. I understand that the way to guess the memory mapping. I'll try them!

posted by Junichi Akita 01 May 2015