Skip to content

Commit 9ec9644

Browse files
authored
Merge pull request #3071 from jgillick/jeremy/stm-nvm-flash
STM32 (ThunderPack) - Move NVM sector to increase program size.
2 parents 12df4ce + 017c188 commit 9ec9644

File tree

3 files changed

+12
-17
lines changed

3 files changed

+12
-17
lines changed

ports/stm/boards/STM32F411_nvm.ld

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
MEMORY
77
{
88
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 512K /* entire flash */
9-
FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 16K /* sector 0 */
10-
FLASH_FS (rx) : ORIGIN = 0x08004000, LENGTH = 32K /* sectors 1,2 are 16K */
11-
FLASH_NVM (rwx) : ORIGIN = 0x0800C000, LENGTH = 16K /* sector 3 is 16K */
12-
FLASH_FIRMWARE (rx) : ORIGIN = 0x08010000, LENGTH = 448K /* sector 4 is 64K, sectors 5,6,7 are 128K */
9+
FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 16K /* sector 0 */
10+
FLASH_FS (rx) : ORIGIN = 0x08004000, LENGTH = 48K /* sectors 1,2,3 are 16K */
11+
FLASH_NVM (rwx) : ORIGIN = 0x08010000, LENGTH = 64K /* sector 4 is 64K */
12+
FLASH_FIRMWARE (rx) : ORIGIN = 0x08020000, LENGTH = 384K /* sectors 5,6,7 are 128K */
1313
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K
1414
}
1515

ports/stm/boards/thunderpack/mpconfigboard.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,16 @@
2828

2929
// Non-volatile memory config
3030
#define CIRCUITPY_INTERNAL_NVM_SIZE (0x4000)
31-
#define CIRCUITPY_INTERNAL_NVM_START_ADDR (0x0800C000)
32-
#define CIRCUITPY_INTERNAL_NVM_SECTOR FLASH_SECTOR_3
31+
#define CIRCUITPY_INTERNAL_NVM_START_ADDR (0x08010000)
32+
#define CIRCUITPY_INTERNAL_NVM_SECTOR FLASH_SECTOR_4
3333

3434
// Putting the entire flash sector in the NVM byte array buffer
3535
// would take up too much RAM. This limits how much of the sector we use.
36-
#define NVM_BYTEARRAY_BUFFER_SIZE 512
36+
#define NVM_BYTEARRAY_BUFFER_SIZE 512
3737

3838
// Flash config
39-
#define FLASH_SIZE (0x80000)
40-
#define FLASH_PAGE_SIZE (0x4000)
39+
#define FLASH_SIZE (0x80000)
40+
#define FLASH_PAGE_SIZE (0x4000)
4141
#define BOARD_FLASH_SIZE (FLASH_SIZE - CIRCUITPY_INTERNAL_NVM_SIZE- 0x2000 - 0xC000)
4242

4343
#define HSE_VALUE ((uint32_t)24000000U)
@@ -47,7 +47,7 @@
4747
#define BOARD_HAS_LOW_SPEED_CRYSTAL (0)
4848

4949
// Status LEDs
50-
#define MICROPY_HW_LED_STATUS (&pin_PA02)
50+
#define MICROPY_HW_LED_STATUS (&pin_PA02)
5151

52-
#define DEFAULT_I2C_BUS_SCL (&pin_PB06)
53-
#define DEFAULT_I2C_BUS_SDA (&pin_PB07)
52+
#define DEFAULT_I2C_BUS_SCL (&pin_PB06)
53+
#define DEFAULT_I2C_BUS_SDA (&pin_PB07)

ports/stm/supervisor/internal_flash.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,9 @@
4141

4242
#ifdef STM32F411xE
4343
#define STM32_FLASH_SIZE 0x80000 //512KiB
44-
#if CIRCUITPY_NVM
45-
#define INTERNAL_FLASH_FILESYSTEM_SIZE 0x8000 //32KiB
46-
#define INTERNAL_FLASH_FILESYSTEM_START_ADDR 0x08004000
47-
#else
4844
#define INTERNAL_FLASH_FILESYSTEM_SIZE 0xC000 //48KiB
4945
#define INTERNAL_FLASH_FILESYSTEM_START_ADDR 0x08004000
5046
#endif
51-
#endif
5247

5348
#ifdef STM32F412Zx
5449
#define STM32_FLASH_SIZE 0x100000 //1MB

0 commit comments

Comments
 (0)