0

I'm trying to write my own bootloader and an entire program to be flashed to my microcontroller from scratch (STM32F303RE based on the ARM Cortex-m4 architecture)

I've been watching a tutorial series and at this point in a video I am completely lost as to where he found this memory map diagram. My reference manuals, programming manuals, and technical reference manuals have no diagram that looks like this. It's a FLASH memory diagram that explicitly illustrates the sequence of sections as they appear in the FLASH memory. I know that the Vector Table is always at the beginning, but what exactly says that the .text , .rodata, and .data sections are all after in that order?

I'll provide a screenshot right here too: enter image description here

MBJ
  • 1
  • My STM32F projects correspond to that image. I would imagine it's some de facto standard for STM32. Every other Cortex M I've worked with start addressing from 0x0 and upwards, but that made too much sense for ST apparently. – Lundin Dec 17 '20 at 09:02

1 Answers1

2

Nothing, and they don't have to be. The hardware doesn't attach any significance to those sections — all that matters is that they all end up in code memory and that everything knows the locations of everything it needs (e.g. the code in .text knows where .data ended up so that it can correctly reference the variables there). Getting that right is the linker's job.

hobbs
  • 6,719
  • 1
  • 19
  • 31