Skip to content

Commit

Permalink
stm32/boards: Enable RAM_ISR feature on boards with UART REPL.
Browse files Browse the repository at this point in the history
Allows mpremote file transfer to work correctly when mpremote is used over
the ST-link USB/UART REPL port.

Fixes issue micropython#8386.

Signed-off-by: Andrew Leech <[email protected]>
  • Loading branch information
pi-anl authored and dpgeorge committed Sep 2, 2024
1 parent 1f5cab9 commit 9670666
Show file tree
Hide file tree
Showing 30 changed files with 52 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ports/stm32/boards/B_L475E_IOT01A/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ CMSIS_MCU = STM32L475xx
AF_FILE = boards/stm32l476_af.csv
LD_FILES = boards/stm32l476xg.ld boards/common_basic.ld
OPENOCD_CONFIG = boards/openocd_stm32l4.cfg

MICROPY_HW_ENABLE_ISR_UART_FLASH_FUNCS_IN_RAM = 1
1 change: 1 addition & 0 deletions ports/stm32/boards/NUCLEO_F091RC/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ LD_FILES = boards/stm32f091xc.ld boards/common_basic.ld
# MicroPython settings
MICROPY_VFS_FAT = 0
MICROPY_VFS_LFS1 ?= 1
MICROPY_HW_ENABLE_ISR_UART_FLASH_FUNCS_IN_RAM = 1

# Don't include default frozen modules because MCU is tight on flash space
FROZEN_MANIFEST ?=
Expand Down
2 changes: 2 additions & 0 deletions ports/stm32/boards/NUCLEO_F401RE/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ AF_FILE = boards/stm32f401_af.csv
LD_FILES = boards/stm32f401xe.ld boards/common_ifs.ld
TEXT0_ADDR = 0x08000000
TEXT1_ADDR = 0x08020000

MICROPY_HW_ENABLE_ISR_UART_FLASH_FUNCS_IN_RAM = 1
2 changes: 2 additions & 0 deletions ports/stm32/boards/NUCLEO_F411RE/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ AF_FILE = boards/stm32f411_af.csv
LD_FILES = boards/stm32f411.ld boards/common_ifs.ld
TEXT0_ADDR = 0x08000000
TEXT1_ADDR = 0x08020000

MICROPY_HW_ENABLE_ISR_UART_FLASH_FUNCS_IN_RAM = 1
2 changes: 2 additions & 0 deletions ports/stm32/boards/NUCLEO_F412ZG/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ AF_FILE = boards/stm32f412_af.csv
LD_FILES = boards/stm32f412zx.ld boards/common_ifs.ld
TEXT0_ADDR = 0x08000000
TEXT1_ADDR = 0x08020000

MICROPY_HW_ENABLE_ISR_UART_FLASH_FUNCS_IN_RAM = 1
2 changes: 2 additions & 0 deletions ports/stm32/boards/NUCLEO_F413ZH/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ AF_FILE = boards/stm32f413_af.csv
LD_FILES = boards/stm32f413xh.ld boards/common_ifs.ld
TEXT0_ADDR = 0x08000000
TEXT1_ADDR = 0x08060000

MICROPY_HW_ENABLE_ISR_UART_FLASH_FUNCS_IN_RAM = 1
1 change: 1 addition & 0 deletions ports/stm32/boards/NUCLEO_F429ZI/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ TEXT1_ADDR = 0x08020000
MICROPY_PY_LWIP = 1
MICROPY_PY_SSL = 1
MICROPY_SSL_MBEDTLS = 1
MICROPY_HW_ENABLE_ISR_UART_FLASH_FUNCS_IN_RAM = 1

FROZEN_MANIFEST = $(BOARD_DIR)/manifest.py
1 change: 1 addition & 0 deletions ports/stm32/boards/NUCLEO_F439ZI/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ TEXT1_ADDR = 0x08020000
MICROPY_PY_LWIP = 1
MICROPY_PY_SSL = 1
MICROPY_SSL_MBEDTLS = 1
MICROPY_HW_ENABLE_ISR_UART_FLASH_FUNCS_IN_RAM = 1

FROZEN_MANIFEST = $(BOARD_DIR)/manifest.py
2 changes: 2 additions & 0 deletions ports/stm32/boards/NUCLEO_F446RE/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ AF_FILE = boards/stm32f446_af.csv
LD_FILES = boards/stm32f411.ld boards/common_ifs.ld
TEXT0_ADDR = 0x08000000
TEXT1_ADDR = 0x08020000

MICROPY_HW_ENABLE_ISR_UART_FLASH_FUNCS_IN_RAM = 1
2 changes: 2 additions & 0 deletions ports/stm32/boards/NUCLEO_F722ZE/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ AF_FILE = boards/stm32f722_af.csv
LD_FILES = boards/stm32f722.ld boards/common_ifs.ld
TEXT0_ADDR = 0x08000000
TEXT1_ADDR = 0x08020000

MICROPY_HW_ENABLE_ISR_UART_FLASH_FUNCS_IN_RAM = 1
1 change: 1 addition & 0 deletions ports/stm32/boards/NUCLEO_F746ZG/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ TEXT1_ADDR = 0x08020000
MICROPY_PY_LWIP = 1
MICROPY_PY_SSL = 1
MICROPY_SSL_MBEDTLS = 1
MICROPY_HW_ENABLE_ISR_UART_FLASH_FUNCS_IN_RAM = 1

FROZEN_MANIFEST = $(BOARD_DIR)/manifest.py
1 change: 1 addition & 0 deletions ports/stm32/boards/NUCLEO_F756ZG/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ TEXT1_ADDR = 0x08020000
MICROPY_PY_LWIP = 1
MICROPY_PY_SSL = 1
MICROPY_SSL_MBEDTLS = 1
MICROPY_HW_ENABLE_ISR_UART_FLASH_FUNCS_IN_RAM = 1

FROZEN_MANIFEST = $(BOARD_DIR)/manifest.py
1 change: 1 addition & 0 deletions ports/stm32/boards/NUCLEO_F767ZI/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ TEXT1_ADDR = 0x08020000
MICROPY_PY_LWIP = 1
MICROPY_PY_SSL = 1
MICROPY_SSL_MBEDTLS = 1
MICROPY_HW_ENABLE_ISR_UART_FLASH_FUNCS_IN_RAM = 1

FROZEN_MANIFEST = $(BOARD_DIR)/manifest.py
2 changes: 2 additions & 0 deletions ports/stm32/boards/NUCLEO_G0B1RE/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ endif

# LTO reduces final binary size, may be slower to build depending on gcc version and hardware
LTO ?= 1

MICROPY_HW_ENABLE_ISR_UART_FLASH_FUNCS_IN_RAM = 1
2 changes: 2 additions & 0 deletions ports/stm32/boards/NUCLEO_G474RE/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ CMSIS_MCU = STM32G474xx
MICROPY_FLOAT_IMPL = single
AF_FILE = boards/stm32g474_af.csv
LD_FILES = boards/stm32g474.ld boards/common_basic.ld

MICROPY_HW_ENABLE_ISR_UART_FLASH_FUNCS_IN_RAM = 1
1 change: 1 addition & 0 deletions ports/stm32/boards/NUCLEO_H563ZI/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ endif
MICROPY_PY_LWIP = 1
MICROPY_PY_SSL = 1
MICROPY_SSL_MBEDTLS = 1
MICROPY_HW_ENABLE_ISR_UART_FLASH_FUNCS_IN_RAM = 1
1 change: 1 addition & 0 deletions ports/stm32/boards/NUCLEO_H723ZG/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@ MICROPY_PY_LWIP = 1
MICROPY_PY_SSL = 1
MICROPY_SSL_MBEDTLS = 1
MICROPY_VFS_LFS2 = 1
MICROPY_HW_ENABLE_ISR_UART_FLASH_FUNCS_IN_RAM = 1

FROZEN_MANIFEST ?= $(BOARD_DIR)/manifest.py
1 change: 1 addition & 0 deletions ports/stm32/boards/NUCLEO_H743ZI/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@ MICROPY_PY_LWIP = 1
MICROPY_PY_SSL = 1
MICROPY_SSL_MBEDTLS = 1
MICROPY_VFS_LFS2 = 1
MICROPY_HW_ENABLE_ISR_UART_FLASH_FUNCS_IN_RAM = 1

FROZEN_MANIFEST ?= $(BOARD_DIR)/manifest.py
2 changes: 2 additions & 0 deletions ports/stm32/boards/NUCLEO_L152RE/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ MCU_SERIES = l1
CMSIS_MCU = STM32L152xE
AF_FILE = boards/stm32l152_af.csv
LD_FILES = boards/stm32l152xe.ld boards/common_basic.ld

MICROPY_HW_ENABLE_ISR_UART_FLASH_FUNCS_IN_RAM = 1
1 change: 1 addition & 0 deletions ports/stm32/boards/NUCLEO_L432KC/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ OPENOCD_CONFIG = boards/openocd_stm32l4.cfg
# MicroPython settings
MICROPY_VFS_FAT = 0
MICROPY_VFS_LFS1 ?= 1
MICROPY_HW_ENABLE_ISR_UART_FLASH_FUNCS_IN_RAM = 1

# Don't include default frozen modules because MCU is tight on flash space
FROZEN_MANIFEST ?=
Expand Down
2 changes: 2 additions & 0 deletions ports/stm32/boards/NUCLEO_L452RE/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ CMSIS_MCU = STM32L452xx
AF_FILE = boards/stm32l452_af.csv
LD_FILES = boards/stm32l452xe.ld boards/common_basic.ld
OPENOCD_CONFIG = boards/openocd_stm32l4.cfg

MICROPY_HW_ENABLE_ISR_UART_FLASH_FUNCS_IN_RAM = 1
2 changes: 2 additions & 0 deletions ports/stm32/boards/NUCLEO_L476RG/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ CMSIS_MCU = STM32L476xx
AF_FILE = boards/stm32l476_af.csv
LD_FILES = boards/stm32l476xg.ld boards/common_basic.ld
OPENOCD_CONFIG = boards/openocd_stm32l4.cfg

MICROPY_HW_ENABLE_ISR_UART_FLASH_FUNCS_IN_RAM = 1
2 changes: 2 additions & 0 deletions ports/stm32/boards/NUCLEO_L4A6ZG/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ CMSIS_MCU = STM32L4A6xx
AF_FILE = boards/stm32l496_af.csv
LD_FILES = boards/stm32l496xg.ld boards/common_basic.ld
OPENOCD_CONFIG = boards/openocd_stm32l4.cfg

MICROPY_HW_ENABLE_ISR_UART_FLASH_FUNCS_IN_RAM = 1
1 change: 1 addition & 0 deletions ports/stm32/boards/NUCLEO_WB55/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ endif
MICROPY_PY_BLUETOOTH = 1
MICROPY_BLUETOOTH_NIMBLE = 1
MICROPY_VFS_LFS2 = 1
MICROPY_HW_ENABLE_ISR_UART_FLASH_FUNCS_IN_RAM = 1
1 change: 1 addition & 0 deletions ports/stm32/boards/NUCLEO_WL55/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ TEXT0_ADDR = 0x08000000
# MicroPython settings
MICROPY_VFS_FAT = 0
MICROPY_VFS_LFS2 = 1
MICROPY_HW_ENABLE_ISR_UART_FLASH_FUNCS_IN_RAM = 1

# Board-specific manifest (doesn't include default modules, adds LoRa driver).
FROZEN_MANIFEST ?= $(BOARD_DIR)/manifest.py
2 changes: 2 additions & 0 deletions ports/stm32/boards/OLIMEX_H407/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ AF_FILE = boards/stm32f405_af.csv
LD_FILES = boards/stm32f405.ld boards/common_ifs.ld
TEXT0_ADDR = 0x08000000
TEXT1_ADDR = 0x08020000

MICROPY_HW_ENABLE_ISR_UART_FLASH_FUNCS_IN_RAM = 1
2 changes: 2 additions & 0 deletions ports/stm32/boards/STM32F429DISC/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ AF_FILE = boards/stm32f429_af.csv
LD_FILES = boards/stm32f429.ld boards/common_ifs.ld
TEXT0_ADDR = 0x08000000
TEXT1_ADDR = 0x08020000

MICROPY_HW_ENABLE_ISR_UART_FLASH_FUNCS_IN_RAM = 1
7 changes: 7 additions & 0 deletions ports/stm32/boards/STM32F769DISC/f769_qspi.ld
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

MEMORY
{
FLASH_FS (r) : ORIGIN = 0x08008000, LENGTH = 96K /* sectors 1, 2, 3 (32K each) */
FLASH_APP (rx) : ORIGIN = 0x08020000, LENGTH = 1920K /* sectors 4-11 1*128K 7*256K */
FLASH_QSPI (rx) : ORIGIN = 0x90000000, LENGTH = 64M /* external QSPI flash in XIP mode */
DTCM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K /* Used for storage cache */
Expand All @@ -38,6 +39,12 @@ _ram_end = ORIGIN(RAM) + LENGTH(RAM);
_heap_start = _ebss; /* heap starts just after statically allocated memory */
_heap_end = _sstack;

/* Filesystem cache in RAM, and storage in flash */
_micropy_hw_internal_flash_storage_ram_cache_start = ORIGIN(DTCM);
_micropy_hw_internal_flash_storage_ram_cache_end = ORIGIN(DTCM) + LENGTH(DTCM);
_micropy_hw_internal_flash_storage_start = ORIGIN(FLASH_FS);
_micropy_hw_internal_flash_storage_end = ORIGIN(FLASH_FS) + LENGTH(FLASH_FS);

ENTRY(Reset_Handler)

REGION_ALIAS("FLASH_ISR", FLASH_APP);
Expand Down
1 change: 1 addition & 0 deletions ports/stm32/boards/STM32F7DISC/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ TEXT1_ADDR = 0x08020000
MICROPY_PY_LWIP = 1
MICROPY_PY_SSL = 1
MICROPY_SSL_MBEDTLS = 1
MICROPY_HW_ENABLE_ISR_UART_FLASH_FUNCS_IN_RAM = 1

FROZEN_MANIFEST = $(BOARD_DIR)/manifest.py
2 changes: 2 additions & 0 deletions ports/stm32/boards/STM32L496GDISC/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ CMSIS_MCU = STM32L496xx
AF_FILE = boards/stm32l496_af.csv
LD_FILES = boards/stm32l496xg.ld boards/common_basic.ld
OPENOCD_CONFIG = boards/openocd_stm32l4.cfg

MICROPY_HW_ENABLE_ISR_UART_FLASH_FUNCS_IN_RAM = 1

0 comments on commit 9670666

Please sign in to comment.