-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
stm32/nucleo_wb55: Fix mpremote file transfer over uart repl. #8713
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
Closed
andrewleech
wants to merge
1
commit into
micropython:master
from
andrewleech:stm32-nucleo-wb55-uart-ram
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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,15 @@ | ||
#include <string.h> | ||
#include <py/mphal.h> | ||
|
||
// This is the default MICROPY_BOARD_STARTUP on stm32 | ||
extern void powerctrl_check_enter_bootloader(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You should be able to include |
||
|
||
void ram_isr_fn_init() { | ||
|
||
// Copy IRQ vector table and other RAM functions to RAM and point VTOR there | ||
extern uint32_t _start_init_isr, _start_isr, _end_isr; | ||
memcpy(&_start_isr, &_start_init_isr, (&_end_isr - &_start_isr) * sizeof(uint32_t)); | ||
SCB->VTOR = (uint32_t)&_start_isr; | ||
|
||
powerctrl_check_enter_bootloader(); | ||
} |
This file contains hidden or 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,61 @@ | ||
/* Memory layout for basic configuration with isr ram functions: | ||
|
||
FLASH .isr_vector | ||
FLASH .text | ||
FLASH .data | ||
|
||
RAM .data | ||
RAM .bss | ||
RAM .heap | ||
RAM .stack | ||
*/ | ||
|
||
ENTRY(Reset_Handler) | ||
|
||
/* define output sections */ | ||
SECTIONS | ||
{ | ||
/* The startup code here is run from RAM */ | ||
.isr_vector : | ||
{ | ||
. = ALIGN(4); | ||
_start_isr = .; | ||
KEEP(*(.isr_vector)) /* Startup code */ | ||
|
||
/* These functions need to run from ram. | ||
Defining them here ensures they're copied from | ||
flash (in ram_irq.c) along with the isr_vector above. | ||
*/ | ||
. = ALIGN(4); | ||
*(.text.pendsv_kbd_intr) | ||
*(.text.pendsv_schedule_dispatch) | ||
*(.text.UART*_IRQHandler) | ||
*(.text.USART*_IRQHandler) | ||
*(.text.storage_systick_callback) | ||
*(.text.SysTick_Handler) | ||
*(.text.uart_irq_handler) | ||
*(.text.HAL_GetTick) | ||
*(.text.FLASH_PageErase) | ||
*(.text.FLASH_WaitForLastOperation) | ||
*(.text.HAL_FLASHEx_Erase) | ||
_end_isr = .; | ||
. = ALIGN(4); | ||
} >RAM AT >FLASH | ||
_start_init_isr = LOADADDR(.isr_vector); /* Used by the start-up code to initialise data */ | ||
|
||
/* The program code and other data goes into FLASH */ | ||
.text : | ||
{ | ||
. = ALIGN(4); | ||
*(.text*) /* .text* sections (code) */ | ||
*(.rodata*) /* .rodata* sections (constants, strings, etc.) */ | ||
/* *(.glue_7) */ /* glue arm to thumb code */ | ||
/* *(.glue_7t) */ /* glue thumb to arm code */ | ||
|
||
. = ALIGN(4); | ||
_etext = .; /* define a global symbol at end of code */ | ||
} >FLASH | ||
|
||
INCLUDE common_extratext_data_in_flash.ld | ||
INCLUDE common_bss_heap_stack.ld | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an
8000
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,61 @@ | ||
/* Memory layout for bootloader configuration with isr ram functions: | ||
|
||
FLASH_APP .isr_vector | ||
FLASH_APP .text | ||
FLASH_APP .data | ||
|
||
RAM .data | ||
RAM .bss | ||
RAM .heap | ||
RAM .stack | ||
*/ | ||
|
||
ENTRY(Reset_Handler) | ||
|
||
/* define output sections */ | ||
SECTIONS | ||
{ | ||
/* The startup code here is run from RAM */ | ||
.isr_vector : | ||
{ | ||
. = ALIGN(4); | ||
_start_isr = .; | ||
KEEP(*(.isr_vector)) /* Startup code */ | ||
|
||
/* These functions need to run from ram. | ||
Defining them here ensures they're copied from | ||
flash (in ram_irq.c) along with the isr_vector above. | ||
*/ | ||
. = ALIGN(4); | ||
*(.text.pendsv_kbd_intr) | ||
*(.text.pendsv_schedule_dispatch) | ||
*(.text.UART*_IRQHandler) | ||
*(.text.USART*_IRQHandler) | ||
*(.text.storage_systick_callback) | ||
*(.text.SysTick_Handler) | ||
*(.text.uart_irq_handler) | ||
*(.text.HAL_GetTick) | ||
*(.text.FLASH_PageErase) | ||
*(.text.FLASH_WaitForLastOperation) | ||
*(.text.HAL_FLASHEx_Erase) | ||
_end_isr = .; | ||
. = ALIGN(4); | ||
} >RAM AT >FLASH_APP | ||
_start_init_isr = LOADADDR(.isr_vector); /* Used by the start-up code to initialise data */ | ||
|
||
/* The program code and other data goes into FLASH */ | ||
.text : | ||
{ | ||
. = ALIGN(4); | ||
*(.text*) /* .text* sections (code) */ | ||
*(.rodata*) /* .rodata* sections (constants, strings, etc.) */ | ||
/* *(.glue_7) */ /* glue arm to thumb code */ | ||
/* *(.glue_7t) */ /* glue thumb to arm code */ | ||
|
||
. = ALIGN(4); | ||
_etext = .; /* define a global symbol at end of code */ | ||
} >FLASH_APP | ||
|
||
INCLUDE common_extratext_data_in_flash_app.ld | ||
INCLUDE common_bss_heap_stack.ld | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably only be configured if
USE_RAM_ISR_UART_FLASH_FN
is enabled.Also, maybe call it
board_startup
. And putvoid
in the arg list.