Skip to content

Commit bbc3099

Browse files
authored
Merge pull request micropython#21 from emfcamp/l4-flash-size
L4 flash size
2 parents af1c3f9 + ecae2c2 commit bbc3099

File tree

6 files changed

+25
-13
lines changed

6 files changed

+25
-13
lines changed

stmhal/boards/STM32L475_EMFBADGE/mpconfigboard.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#define MICROPY_HW_ENABLE_SERVO (1)
1515
#define MICROPY_HW_HAS_UGFX (1)
1616
#define MICROPY_HW_HAS_CC3100 (1)
17+
#define MICROPY_HW_L4_512_FS (1)
1718

1819
#define MICROPY_BOARD_EARLY_INIT STM32L475_EMFBADGE_board_early_init
1920
void STM32L475_EMFBADGE_board_early_init(void);

stmhal/boards/STM32L476_EMFBADGE/mpconfigboard.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#define MICROPY_HW_ENABLE_SERVO (1)
1515
#define MICROPY_HW_HAS_UGFX (1)
1616
#define MICROPY_HW_HAS_CC3100 (1)
17+
#define MICROPY_HW_L4_512_FS (1)
1718

1819
#define MICROPY_BOARD_EARLY_INIT STM32L476_EMFBADGE_board_early_init
1920
void STM32L476_EMFBADGE_board_early_init(void);

stmhal/boards/stm32l475xg.ld

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@
55
/* Specify the memory areas */
66
MEMORY
77
{
8-
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024K
9-
FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 0x0000800 /* sector 0, 2 KiB */
10-
FLASH_FS (r) : ORIGIN = 0x08000800, LENGTH = 0x001F800 /* sectors 1-63 (2K each = 126 KiB) */
11-
FLASH_TEXT (rx) : ORIGIN = 0x08020000, LENGTH = 0x0080000 /* Sector starting @ 64 */
12-
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 96K
13-
SRAM2 (xrw) : ORIGIN = 0x10000000, LENGTH = 32K
8+
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 0x0100000 /* entire flash, 1 MiB */
9+
FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 0x0000800 /* sector 0, 2 KiB */
10+
FLASH_FS (r) : ORIGIN = 0x08000800, LENGTH = 0x001F800 /* sectors 1-63 (2K each = 126 KiB) */
11+
FLASH_TEXT (rx) : ORIGIN = 0x08020000, LENGTH = 0x0080000 /* Sector starting @ 64 */
12+
FLASH_FS2 (r) : ORIGIN = 0x080A0000, LENGTH = 0x0060000 /* Sector starting @ 320 (2K each = 384 KiB) */
13+
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 0x0018000 /* 96K */
14+
SRAM2_FS_BUF (xrw) : ORIGIN = 0x10000000, LENGTH = 0x0000800 /* 2K, do not touch used directly by storage.c */
15+
SRAM2 (xrw) : ORIGIN = 0x10000800, LENGTH = 0x0007800 /* 30K */
1416
}
1517

1618
ENTRY(Reset_Handler)

stmhal/boards/stm32l476xe.ld

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ MEMORY
1010
FLASH_FS (r) : ORIGIN = 0x08000800, LENGTH = 0x001F800 /* sectors 1-63 (2K each = 126 KiB) */
1111
FLASH_TEXT (rx) : ORIGIN = 0x08020000, LENGTH = 0x0060000 /* Sector starting @ 64 */
1212
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 96K
13-
SRAM2 (xrw) : ORIGIN = 0x10000000, LENGTH = 32K
13+
SRAM2_FS_BUF (xrw) : ORIGIN = 0x10000000, LENGTH = 0x0000800 /* 2K, do not touch used directly by storage.c */
14+
SRAM2 (xrw) : ORIGIN = 0x10000800, LENGTH = 0x0007800 /* 30K */
1415
}
1516

1617
ENTRY(Reset_Handler)

stmhal/boards/stm32l476xg.ld

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@
55
/* Specify the memory areas */
66
MEMORY
77
{
8-
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024K
9-
FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 0x0000800 /* sector 0, 2 KiB */
10-
FLASH_FS (r) : ORIGIN = 0x08000800, LENGTH = 0x001F800 /* sectors 1-63 (2K each = 126 KiB) */
11-
FLASH_TEXT (rx) : ORIGIN = 0x08020000, LENGTH = 0x0080000 /* Sector starting @ 64 */
12-
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 96K
13-
SRAM2 (xrw) : ORIGIN = 0x10000000, LENGTH = 32K
8+
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 0x0100000 /* entire flash, 1 MiB */
9+
FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 0x0000800 /* sector 0, 2 KiB */
10+
FLASH_FS (r) : ORIGIN = 0x08000800, LENGTH = 0x001F800 /* sectors 1-63 (2K each = 126 KiB) */
11+
FLASH_TEXT (rx) : ORIGIN = 0x08020000, LENGTH = 0x0080000 /* Sector starting @ 64 */
12+
FLASH_FS2 (r) : ORIGIN = 0x080A0000, LENGTH = 0x0060000 /* Sector starting @ 320 (2K each = 384 KiB) */
13+
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 0x0018000 /* 96K */
14+
SRAM2_FS_BUF (xrw) : ORIGIN = 0x10000000, LENGTH = 0x0000800 /* 2K, do not touch used directly by storage.c */
15+
SRAM2 (xrw) : ORIGIN = 0x10000800, LENGTH = 0x0007800 /* 30K */
1416
}
1517

1618
ENTRY(Reset_Handler)

stmhal/storage.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,11 @@ STATIC byte flash_cache_mem[0x4000] __attribute__((aligned(4))); // 16k
9191
#define FLASH_SECTOR_SIZE_MAX (0x00800) // 2k max
9292
#define FLASH_MEM_SEG1_START_ADDR (0x08000800) // sector 1
9393
#define FLASH_MEM_SEG1_NUM_BLOCKS (252) // 1 Block=512 Bytes Reserve 126 kBytes
94+
// on the STM32L47xxG we have 1MB of flash so can enable a bigger FS
95+
#if defined(MICROPY_HW_L4_512_FS) && MICROPY_HW_L4_512_FS
96+
#define FLASH_MEM_SEG2_START_ADDR (0x080A0000) // sector 320
97+
#define FLASH_MEM_SEG2_NUM_BLOCKS (768) // 384 kBytes
98+
#endif
9499

95100
#else
96101
#error "no storage support for this MCU"

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy