Skip to content

Commit 408249c

Browse files
committed
Remove user_data section from linker script since it breaks bootloader when erased
1 parent cac28b7 commit 408249c

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

firmware/bootloader/main.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,19 @@
3434
#define APP2_ADDRESS_OFFSET 0x22000
3535
#define APP2_ADDRESS (FLASH_BASE + APP2_ADDRESS_OFFSET)
3636

37+
#define BOOT_DATA_ADDRESS 0x08003800
38+
3739
typedef void (*app_func_t)(void);
3840
typedef struct __attribute__((__packed__))
3941
{
4042
uint8_t active_image;
4143
} config_t;
4244

43-
__attribute__((__section__(".user_data"))) const char data[1];
44-
4545
int main()
4646
{
4747
app_func_t app;
4848
uint32_t jump_addr, vt_offset, sp_addr;
49-
config_t *config = (config_t *)data;
49+
volatile config_t *config = (config_t *)BOOT_DATA_ADDRESS;
5050

5151
uart_init();
5252
print(VERSION);

firmware/bootloader/stm32_flash.ld

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,6 @@ SECTIONS
9090
PROVIDE_HIDDEN(__fini_array_end = .);
9191
} > FLASH
9292

93-
.user_data :
94-
{
95-
. = ALIGN(4);
96-
KEEP(*(.user_data))
97-
. = ALIGN(4);
98-
} > DATA
99-
10093
/* Used by startup code to initialize data */
10194
_sidata = .;
10295

0 commit comments

Comments
 (0)