Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

F421: work around bug in old bootloader #68

Merged
merged 1 commit into from
Sep 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions Mcu/f421/AT32F421x6_FLASH.ld
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,16 @@
/* Entry Point */
ENTRY(Reset_Handler)

/* Highest address of the user mode stack */
_estack = 0x20004000; /* end of RAM */
/*
Highest address of the user mode stack

we set this less than the 16k available due to a bug in the old
bootloader for F421. The old bootloader writes to the stack pointer
after setting up the stack based on the app header. This means if we
set the app stack right at the end of memory then the bootloader
hard faults.
*/
_estack = 0x20003c00;

/* Generate a link error if heap and stack don't fit into RAM */
_Min_Heap_Size = 0x200; /* required amount of heap */
Expand All @@ -34,7 +42,7 @@ FLASH (rx) : ORIGIN = 0x08001000, LENGTH = 27K
FLASH_VERSION (rx) : ORIGIN = 0x08007C00 - 48, LENGTH = 16
FILE_NAME (rx) : ORIGIN = 0x08007C00 - 32, LENGTH = 32
EEPROM (rx) : ORIGIN = 0x08007C00, LENGTH = 1K
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 16K
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 15K

}

Expand Down
Loading