# STM32F103 flash memory start address

I'm trying to write a linker script for my first firmware for STM32F103C8T6 microcontroller. I have an example script that works. What I'm trying to understand is why it works.

The linker script I have defines two memory locations:

MEMORY
{
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 64K
RAM (rwx)  : ORIGIN = 0x20000000, LENGTH = 32K
}


Official STM32 programming manual section 2.2 states that "Code" memory section starts with address 0x00000000. The next section is RAM, which is 0x20000000, just like stated in my linker script.

Where the FLASH origin value 0x08000000 comes from?

• Have you got the datasheet and reference manual for your processor, the datasheet will have a memory map and show flash at 0x08000000 – Colin Dec 25 '17 at 19:46
• Hm, indeed, the datasheet says 0x00000000 is "Aliased to Flash or system memory depending on Boot pins" – Andrey Lebedev Dec 25 '17 at 19:54
• see section 2.3.8 of this st.com/content/ccc/resource/technical/document/datasheet/33/d4/… – jsotola Dec 25 '17 at 20:03

Apparently, the 0x08000000 value comes from the datasheet section 4. Memory region starting from 0x00000000 is "Aliased to Flash or system memory depending on Boot pins", and "Flash memory" starts from 0x08000000.