Skip to content

fix(CMSIS): Reduce Available MAX32670 Flash by 8KB, Reserve Final Page for Bootloader #968

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

Merged
merged 1 commit into from
Apr 1, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion Libraries/CMSIS/Device/Maxim/GCC/mxc_version.mk
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#
##############################################################################
# Autogenerated version info for build system.
MSDK_VERSION_STRING := v2024_02-22-g61823d75cf
MSDK_VERSION_STRING := v2024_02-25-g3a91bd6c4a
MSDK_VERSION_YEAR := 2024
MSDK_VERSION_MONTH := 2

Expand Down
4 changes: 3 additions & 1 deletion Libraries/CMSIS/Device/Maxim/MAX32670/Include/max32670.h
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,9 @@ typedef enum {
#define MXC_FLASH0_MEM_BASE 0x10000000UL
#define MXC_FLASH_MEM_BASE MXC_FLASH0_MEM_BASE
#define MXC_FLASH_PAGE_SIZE 0x00002000UL
#define MXC_FLASH_MEM_SIZE 0x00060000UL
#define MXC_FLASH_MEM_SIZE (0x00060000UL - MXC_FLASH_PAGE_SIZE)
// ^ Last page of flash is used by the bootloader and cannot be used by app code.
// Furthermore, it appears that using this page will brick the device...
#define MXC_INFO0_MEM_BASE 0x10800000UL
#define MXC_INFO_MEM_BASE MXC_INFO0_MEM_BASE
#define MXC_INFO_MEM_SIZE 0x00004000UL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
******************************************************************************/

MEMORY {
FLASH (rx) : ORIGIN = 0x10000000, LENGTH = 384K /* 384kB "FLASH" */
FLASH (rx) : ORIGIN = 0x10000000, LENGTH = 376K /* 384kB "FLASH" - reserved last page used by bootloader */
SRAM (rwx) : ORIGIN = 0x20000000, LENGTH = 128K /* 160kB SRAM with ECC*/
/*^ If ECC is enabled, the stack size must be reduced. Otherwise, a
HardFault will occur on startup as the stack is expanded into the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

MEMORY {
ROM (rx) : ORIGIN = 0x00000000, LENGTH = 0x00020000 /* 128kB "ROM" */
FLASH (rx) : ORIGIN = 0x10000000, LENGTH = 384K /* 256kB "FLASH" */
FLASH (rx) : ORIGIN = 0x10000000, LENGTH = 376K /* 384kB "FLASH" - reserved last page used by bootloader */
SRAM (rwx) : ORIGIN = 0x20000000, LENGTH = 160K /* 760kB SRAM */
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

MEMORY {
ROM (rx) : ORIGIN = 0x00000000, LENGTH = 0x00020000 /* 128kB "ROM" */
FLASH (rx) : ORIGIN = 0x10000000, LENGTH = 384K /* 256kB "FLASH" */
FLASH (rx) : ORIGIN = 0x10000000, LENGTH = 376K /* 384kB "FLASH" - reserved last page used by bootloader */
SRAM (rwx) : ORIGIN = 0x20000000, LENGTH = 160K /* 608kB SRAM */
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

MEMORY {
ROM (rx) : ORIGIN = 0x00000000, LENGTH = 0x00020000 /* 128kB "ROM" */
FLASH (rx) : ORIGIN = 0x10000000, LENGTH = 0x00040000 /* 256kB "FLASH" */
FLASH (rx) : ORIGIN = 0x10000000, LENGTH = 376K /* 384kB "FLASH" - reserved last page used by bootloader */
SRAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x000BE000 /* 760kB SRAM */

XIP_0 (rx) : ORIGIN = 0x08000000, LENGTH = 0x00010000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

MEMORY {
ROM (rx) : ORIGIN = 0x00000000, LENGTH = 0x00020000 /* 128kB "ROM" */
FLASH (rx) : ORIGIN = 0x10000000, LENGTH = 0x00040000 /* 256kB "FLASH" */
FLASH (rx) : ORIGIN = 0x10000000, LENGTH = 376K /* 384kB "FLASH" - reserved last page used by bootloader */
XIP (rx) : ORIGIN = 0x08000000, LENGTH = 0x00100000 /* 1MB XIP Flash */
SRAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x000BE000 /* 760kB SRAM */
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

MEMORY {
ROM (rx) : ORIGIN = 0x00000000, LENGTH = 0x00020000 /* 128kB ROM */
FLASH (rx) : ORIGIN = 0x10000000, LENGTH = 384K /* 384kB "FLASH" */
FLASH (rx) : ORIGIN = 0x10000000, LENGTH = 376K /* 384kB "FLASH" - reserved last page used by bootloader */
SRAM (rwx) : ORIGIN = 0x20000000, LENGTH = 128K /* 160kB SRAM with ECC*/
/*^ If ECC is enabled, the stack size must be reduced. Otherwise, a
HardFault will occur on startup as the stack is expanded into the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
******************************************************************************/

MEMORY {
FLASH (rx) : ORIGIN = 0x10000000, LENGTH = 384K /* 256kB "FLASH" */
FLASH (rx) : ORIGIN = 0x10000000, LENGTH = 376K /* 384kB "FLASH" - reserved last page used by bootloader */
/* 152Kx32 total size of RAMS 0-10 (608Kbytes). */
/* 38Kx32 total size of RAMs 11-21 for optional ECC (152Kbytes) */
/* NOTE 1: The MAX32570 has Error correcting RAM which removes 152KByte of usable RAM from the memory map. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
******************************************************************************/
MEMORY {
ROM (rx) : ORIGIN = 0x00000000, LENGTH = 0x00020000 /* 128kB ROM */
FLASH (rx) : ORIGIN = 0x10000000, LENGTH = 384K /* 384kB "FLASH" */
FLASH (rx) : ORIGIN = 0x10000000, LENGTH = 376K /* 384kB "FLASH" - reserved last page used by bootloader */
SRAM (rwx) : ORIGIN = 0x20000000, LENGTH = 128K /* 160kB SRAM with ECC*/
/*^ If ECC is enabled, the stack size must be reduced. Otherwise, a
HardFault will occur on startup as the stack is expanded into the
Expand Down
2 changes: 1 addition & 1 deletion mxc_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
* Format: `[Release tag]-[commits since release tag]-g[commit SHA]`
* If exactly on a release tag, this string will match the tag
*/
#define MSDK_VERSION_STRING "v2024_02-22-g61823d75cf"
#define MSDK_VERSION_STRING "v2024_02-25-g3a91bd6c4a"
/**
* @brief The month of the current MSDK version
*/
Expand Down