Skip to content

Commit

Permalink
Fix to linker scripts.
Browse files Browse the repository at this point in the history
Placement of the data section in ROM was not always exactly at _etext before. The section was just plonked in ROM and sometimes due to strange alignment issues it would not get copied into RAM correctly at startup. Changed so that the section is added to ROM at a well defined address.
  • Loading branch information
fnoble committed Apr 19, 2012
1 parent 92f74a9 commit a5f4a98
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
5 changes: 3 additions & 2 deletions lib/stm32/f1/libopencm3_stm32f1.ld
Expand Up @@ -50,12 +50,13 @@ SECTIONS

_etext = .;

.data : {
_data_flash = .;
.data : AT (_data_flash) {
_data = .;
*(.data*) /* Read-write initialized data */
. = ALIGN(4);
_edata = .;
} >ram AT >rom
} >ram

.bss : {
*(.bss*) /* Read-write zero initialized data */
Expand Down
6 changes: 3 additions & 3 deletions lib/stm32/f2/libopencm3_stm32f2.ld
Expand Up @@ -47,15 +47,15 @@ SECTIONS
} > rom
__exidx_end = .;


_etext = .;

.data : {
_data_flash = .;
.data : AT (_data_flash) {
_data = .;
*(.data*) /* Read-write initialized data */
. = ALIGN(4);
_edata = .;
} >ram AT >rom
} >ram

.bss : {
*(.bss*) /* Read-write zero initialized data */
Expand Down
5 changes: 3 additions & 2 deletions lib/stm32/f4/libopencm3_stm32f4.ld
Expand Up @@ -50,12 +50,13 @@ SECTIONS

_etext = .;

.data : {
_data_flash = .;
.data : AT (_data_flash) {
_data = .;
*(.data*) /* Read-write initialized data */
. = ALIGN(4);
_edata = .;
} >ram AT >rom
} >ram

.bss : {
*(.bss*) /* Read-write zero initialized data */
Expand Down

0 comments on commit a5f4a98

Please sign in to comment.