Apologize for the delay.
It seems you want to run some code which was related to SRAM in Flash, I am not sure if below comments help you.
// data.ldt for reference.
MEMORY
{
SRAM_ITC (rwx) : ORIGIN = 0x20200000, LENGTH = 0x40000
}
SECTIONS
{
.text.sram_init :
{
*spi.o(.text)
*semc_sram.o(.text)
*fsl_semc.o(.text)
} > FLASH
.rodata.sram_init :
{
*spi.o(.rodata)
*semc_sram.o(.rodata)
*fsl_semc.o(.rodata)
} > FLASH
}
// main_text.ldt for reference.
MEMORY
{
FLASH (rx) : ORIGIN = 0x60000000, LENGTH = 0x800000 /* Adjust as per your flash size */
SRAM_OC (rwx) : ORIGIN = 0x20000000, LENGTH = 0x20000
SRAM_ITC (rwx) : ORIGIN = 0x20200000, LENGTH = 0x40000
SDRAM (rwx) : ORIGIN = 0x80000000, LENGTH = 0x800000 /* Adjust as per your SDRAM size */
}
SECTIONS
{
.text :
{
*(EXCLUDE_FILE(*spi.o *semc_sram.o *fsl_semc.o) .text)
} > FLASH
.text.sram_init :
{
*spi.o(.text)
*semc_sram.o(.text)
*fsl_semc.o(.text)
} > FLASH
.rodata :
{
*(EXCLUDE_FILE(*spi.o *semc_sram.o *fsl_semc.o) .rodata)
} > FLASH
.rodata.sram_init :
{
*spi.o(.rodata)
*semc_sram.o(.rodata)
*fsl_semc.o(.rodata)
} > FLASH
.bss :
{
*(.bss)
} > SRAM_OC
.data :
{
*(.data)
} > SRAM_OC AT>FLASH
.data_RAM4 :
{
*(.data_RAM4)
} > SDRAM
}