forked from micropython/micropython
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
stm32/isr: Add option to run flash & uart isr function from ram.
This allows uart rx to function while flash erase/writes operations are under way, preventing lost data so long as it fits in the uart rx buffer. Enable in mpconfigboard.mk: MICROPY_USE_RAM_ISR_UART_FLASH_FN = 1 Signed-off-by: Andrew Leech <[email protected]>
- Loading branch information
Showing
28 changed files
with
109 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* This linker script fragment is intended to be included in SECTIONS. */ | ||
|
||
/* The startup code goes first into FLASH */ | ||
.isr_vector : | ||
{ | ||
. = ALIGN(4); | ||
__isr_vector_ram_start = .; | ||
|
||
KEEP(*(.isr_vector)) /* Startup code */ | ||
|
||
/* These functions need to run from ram to enable uart | ||
reception during flash erase/write operations. | ||
Defining them here ensures they're copied from | ||
flash (in main.c) along with the isr_vector above. | ||
*/ | ||
. = ALIGN(4); | ||
*(.text.pendsv_kbd_intr) | ||
*(.text.pendsv_schedule_dispatch) | ||
*(.text.storage_systick_callback) | ||
*(.text.SysTick_Handler) | ||
*(.text.uart_irq_handler) | ||
*(.text.UART*_IRQHandler) | ||
*(.text.USART*_IRQHandler) | ||
*(.text.FLASH_PageErase) | ||
*(.text.FLASH_SectorErase) | ||
*(.text.FLASH_WaitForLastOperation) | ||
*(.text.HAL_FLASHEx_Erase) | ||
*(.text.HAL_GetTick) | ||
|
||
__isr_vector_ram_end = .; | ||
. = ALIGN(4); | ||
|
||
} >RAM AT >FLASH_ISR | ||
|
||
/* Used by the start-up code to initialise data */ | ||
__isr_vector_flash_addr = LOADADDR(.isr_vector); |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,4 @@ | |
. = ALIGN(4); | ||
KEEP(*(.isr_vector)) /* Startup code */ | ||
. = ALIGN(4); | ||
} >FLASH_COMMON | ||
} >FLASH_ISR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* This linker script fragment is intended to be included in SECTIONS when | ||
common_ifs.ld is used with common_isr.ld | ||
. */ | ||
|
||
.isr_extratext : | ||
{ | ||
. = ALIGN(4); | ||
|
||
/* This first flash block is 16K and the isr vectors only take up | ||
about 400 bytes. So we pull in a couple of object files to pad it | ||
out and save flash space in later blocks. | ||
|
||
NOTE: If you update the list of files contained her in .isr_extratext | ||
then be sure to also update stm32/Makefile where it builds each of | ||
these files with -Os to keep this section as compact as possible. | ||
*/ | ||
*/ff.o(.text*) | ||
*/vfs_fat_*.o(.text*) | ||
*/py/formatfloat.o(.text*) | ||
*/py/parsenum.o(.text*) | ||
*/py/mpprint.o(.text*) | ||
|
||
. = ALIGN(4); | ||
} >FLASH_ISR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters