STM32CUBEIDE code run extern flash
I'm using the STM32H7B0, but I want to place the executable file compiled from a certain file in the project into the external flash for execution. For example, the `BSP/led/led.c` file.
I've modified the linker script (ld file), added the address of the external flash, and created a new section for the external flash.
MEMORY {
ITCMRAM (xrw) : ORIGIN = 0x00000000, LENGTH = 64K
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 128K
DTCMRAM1 (xrw) : ORIGIN = 0x20000000, LENGTH = 64K
DTCMRAM2 (xrw) : ORIGIN = 0x20010000, LENGTH = 64K
RAM (xrw) : ORIGIN = 0x24000000, LENGTH = 1024K
RAM_CD (xrw) : ORIGIN = 0x30000000, LENGTH = 128K
RAM_SRD (xrw) : ORIGIN = 0x38000000, LENGTH = 32K
SPI_FLASH (rx) : ORIGIN = 0x90000000, LENGTH = 8192K
}
.usart_in_spi_flash :
{
. = ALIGN(4);
BSP/led/led.o(.text*) /* Place .text section of usart.o into SPI_FLASH */
BSP/led/led.o(.rodata*) /* Place .rodata section of usart.o into SPI_FLASH */
BSP/led/led.o(.data*) /* Place .data section of usart.o into SPI_FLASH */
BSP/led/led.o(.bss*) /* Place .bss section of usart.o into SPI_FLASH */
. = ALIGN(4);
} >SPI_FLASH
However, when compiling, a "multiple definition" error occurs.
../BSP/led/led.c:11: multiple definition of `led_open';
