mirror of
https://github.com/hathach/tinyusb.git
synced 2025-01-17 05:32:55 +08:00
make sure g_bsp_rom_registers is not dropped by linker in cmake build.
always reserve 0x100 for option setting in linker to prevent possible bricked mcu
This commit is contained in:
parent
380bfc0a63
commit
656772fc9d
@ -173,6 +173,9 @@ SECTIONS
|
||||
. = OPTION_SETTING_LENGTH > 0 ? . : __ROM_Start + 0x400;
|
||||
KEEP(*(.rom_registers*))
|
||||
|
||||
/* Reserving 0x100 bytes of space for ROM registers. */
|
||||
. = OPTION_SETTING_LENGTH > 0 ? . : __ROM_Start + 0x500;
|
||||
|
||||
/* Allocate flash write-boundary-aligned
|
||||
* space for sce9 wrapped public keys for mcuboot if the module is used.
|
||||
*/
|
||||
|
@ -173,6 +173,9 @@ SECTIONS
|
||||
. = OPTION_SETTING_LENGTH > 0 ? . : __ROM_Start + 0x400;
|
||||
KEEP(*(.rom_registers*))
|
||||
|
||||
/* Reserving 0x100 bytes of space for ROM registers. */
|
||||
. = OPTION_SETTING_LENGTH > 0 ? . : __ROM_Start + 0x500;
|
||||
|
||||
/* Allocate flash write-boundary-aligned
|
||||
* space for sce9 wrapped public keys for mcuboot if the module is used.
|
||||
*/
|
||||
|
@ -173,6 +173,9 @@ SECTIONS
|
||||
. = OPTION_SETTING_LENGTH > 0 ? . : __ROM_Start + 0x400;
|
||||
KEEP(*(.rom_registers*))
|
||||
|
||||
/* Reserving 0x100 bytes of space for ROM registers. */
|
||||
. = OPTION_SETTING_LENGTH > 0 ? . : __ROM_Start + 0x500;
|
||||
|
||||
/* Allocate flash write-boundary-aligned
|
||||
* space for sce9 wrapped public keys for mcuboot if the module is used.
|
||||
*/
|
||||
|
@ -173,6 +173,9 @@ SECTIONS
|
||||
. = OPTION_SETTING_LENGTH > 0 ? . : __ROM_Start + 0x400;
|
||||
KEEP(*(.rom_registers*))
|
||||
|
||||
/* Reserving 0x100 bytes of space for ROM registers. */
|
||||
. = OPTION_SETTING_LENGTH > 0 ? . : __ROM_Start + 0x500;
|
||||
|
||||
/* Allocate flash write-boundary-aligned
|
||||
* space for sce9 wrapped public keys for mcuboot if the module is used.
|
||||
*/
|
||||
|
@ -173,6 +173,9 @@ SECTIONS
|
||||
. = OPTION_SETTING_LENGTH > 0 ? . : __ROM_Start + 0x400;
|
||||
KEEP(*(.rom_registers*))
|
||||
|
||||
/* Reserving 0x100 bytes of space for ROM registers. */
|
||||
. = OPTION_SETTING_LENGTH > 0 ? . : __ROM_Start + 0x500;
|
||||
|
||||
/* Allocate flash write-boundary-aligned
|
||||
* space for sce9 wrapped public keys for mcuboot if the module is used.
|
||||
*/
|
||||
|
@ -177,6 +177,9 @@ SECTIONS
|
||||
. = OPTION_SETTING_LENGTH > 0 ? . : __ROM_Start + 0x400;
|
||||
KEEP(*(.rom_registers*))
|
||||
|
||||
/* Reserving 0x100 bytes of space for ROM registers. */
|
||||
. = OPTION_SETTING_LENGTH > 0 ? . : __ROM_Start + 0x500;
|
||||
|
||||
/* Allocate flash write-boundary-aligned
|
||||
* space for sce9 wrapped public keys for mcuboot if the module is used.
|
||||
*/
|
||||
|
@ -173,6 +173,9 @@ SECTIONS
|
||||
. = OPTION_SETTING_LENGTH > 0 ? . : __ROM_Start + 0x400;
|
||||
KEEP(*(.rom_registers*))
|
||||
|
||||
/* Reserving 0x100 bytes of space for ROM registers. */
|
||||
. = OPTION_SETTING_LENGTH > 0 ? . : __ROM_Start + 0x500;
|
||||
|
||||
/* Allocate flash write-boundary-aligned
|
||||
* space for sce9 wrapped public keys for mcuboot if the module is used.
|
||||
*/
|
||||
|
@ -54,7 +54,6 @@ function(add_board_target BOARD_TARGET)
|
||||
${FSP_RA}/src/bsp/mcu/all/bsp_io.c
|
||||
${FSP_RA}/src/bsp/mcu/all/bsp_irq.c
|
||||
${FSP_RA}/src/bsp/mcu/all/bsp_register_protection.c
|
||||
${FSP_RA}/src/bsp/mcu/all/bsp_rom_registers.c
|
||||
${FSP_RA}/src/bsp/mcu/all/bsp_sbrk.c
|
||||
${FSP_RA}/src/bsp/mcu/all/bsp_security.c
|
||||
${FSP_RA}/src/r_ioport/r_ioport.c
|
||||
@ -125,12 +124,17 @@ function(family_configure_example TARGET RTOS)
|
||||
# BSP
|
||||
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/family.c
|
||||
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/../board.c
|
||||
# Explicitly added bsp_rom_registers here, otherwise MCU can be bricked if g_bsp_rom_registers is dropped by linker
|
||||
${FSP_RA}/src/bsp/mcu/all/bsp_rom_registers.c
|
||||
)
|
||||
target_include_directories(${TARGET} PUBLIC
|
||||
# family, hw, board
|
||||
${CMAKE_CURRENT_FUNCTION_LIST_DIR}
|
||||
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/../../
|
||||
)
|
||||
target_compile_options(${TARGET} PUBLIC
|
||||
-Wno-error=undef
|
||||
)
|
||||
|
||||
# # RA has custom freertos port
|
||||
# if (NOT TARGET freertos_kernel_port)
|
||||
|
Loading…
x
Reference in New Issue
Block a user