Greetings to all,
I want to run code from a ram-location on a STM32F407 (Cortex-M4)
microcontroller, but before I can do this, I want to understand the
linker-commands, and this seems to be a real challenge.
At first, I want to find out where some code-fragments to run from ram
later are located.
I'm using Coocox in combined with launchpad-gcc-toolchain and modified
the default-linker-script:
1 | SECTIONS
|
2 | {
|
3 |
|
4 | .text 0x08000000:
|
5 | {
|
6 | bootstart = ABSOLUTE(.) ;
|
7 | KEEP(*(.isr_vector .isr_vector.*))
|
8 | bootend = ABSOLUTE(.) ;
|
9 | *(.text .text.* .gnu.linkonce.t.*)
|
10 | *(.glue_7t) *(.glue_7)
|
11 | *(.rodata .rodata* .gnu.linkonce.r.*)
|
12 | }
|
13 | ...
|
I inserted the assigment of the vars "bootstart" and "bootend" and hoped
to see where the isr_vector-section begins and where it ends.
Regarding to the documentation of the linker I should get
"bootstart = 0x08000000" and "bootend = 0x080001ff".
But even these simple assigments don't work, I got "bootstart =
0x20000804" and "bootend = 0xaf00b580", superfluouses to mention, that
the STM doesn't have so much memory.
1 | SECTIONS
|
2 | {
|
3 | . = 0x08000000;
|
4 | bootstart = . ;
|
5 | .text :
|
6 | { ...
|
7 |
|
8 | ...
|
It's amazing, that the code generated with these linker-scripts is still
executeable on my discovery-board...
Can someone please tell me, what's going (wr)on(g) here?
Lauren