Skip to content

Commit

Permalink
Fix Flash 0 page size in Bootloader example
Browse files Browse the repository at this point in the history
  • Loading branch information
sihyung-maxim committed Sep 24, 2024
1 parent f852692 commit b654431
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Examples/MAX32690/Bluetooth/Bootloader/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ the main flash section is erased and replaced with the update image. If no valid
is identified, the Bootloader will boot the exiting image in the main flash space.

__0x10000000__: Bootloader
__0x10004000__: Main flash space
__0x10008000__: Main flash space
__0x10300000__: Update flash space

## Software
Expand Down
2 changes: 1 addition & 1 deletion Examples/MAX32690/Bluetooth/Bootloader/boot_lower.S
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
/* Boot from the lower flash array */
Boot_Lower:

ldr r0,=0x10004000 /* Address for main flash image */
ldr r0,=0x10008000 /* Address for main flash image */
ldr r1,=0xE000ED08 /* Address for SCB_VTOR_REG */

/* First 32-bit word in image is initial stack pointer */
Expand Down
16 changes: 9 additions & 7 deletions Examples/MAX32690/Bluetooth/Bootloader/bootloader.ld
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,17 @@
*
******************************************************************************/

BOOTLOADER_ORIGIN = 0x10000000;
BOOTLOADER_LEN = 0x4000;
FLASH_SECTION_LEN = 0x40000 - BOOTLOADER_LEN;
/* Note: Flash 0 page size is 16KB (0x4000). Flash 1 page size is 8KB (0x2000) */
BOOTLOADER_ORIGIN = 0x10000000; /* Bootloader resides in page 0 */
BOOTLOADER_LEN = 0x8000; /* 2 Flash 0 pages length (total 32KB) */
FLASH0_SECTION_LEN = 0x300000 - BOOTLOADER_LEN; /* 3MB - 2 pages (16KB/page) */
FLASH1_SECTION_LEN = 0x40000; /* 256KB */
FLASH0_ORIGIN = BOOTLOADER_ORIGIN + BOOTLOADER_LEN;

MEMORY {
FLASH (rx) : ORIGIN = BOOTLOADER_ORIGIN, LENGTH = BOOTLOADER_LEN
FLASH0 (rx) : ORIGIN = FLASH0_ORIGIN, LENGTH = FLASH_SECTION_LEN
FLASH1 (rx) : ORIGIN = 0x10300000, LENGTH = FLASH_SECTION_LEN
FLASH0 (rx) : ORIGIN = FLASH0_ORIGIN, LENGTH = FLASH0_SECTION_LEN
FLASH1 (rx) : ORIGIN = 0x10300000, LENGTH = FLASH1_SECTION_LEN
SRAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x20000
}

Expand All @@ -50,14 +52,14 @@ SECTIONS {
.flash0 (NOLOAD) :
{
_flash0 = ALIGN(., 4);
. = . + FLASH_SECTION_LEN;
. = . + FLASH0_SECTION_LEN;
_eflash0 = ALIGN(., 4);
} > FLASH0

.flash1 (NOLOAD) :
{
_flash1 = ALIGN(., 4);
. = . + FLASH_SECTION_LEN;
. = . + FLASH1_SECTION_LEN;
_eflash1 = ALIGN(., 4);
} > FLASH1

Expand Down

0 comments on commit b654431

Please sign in to comment.