我根据火哥关于代码在SDRAM中运行代码的ICF的配置,根据自己的工程进行了更改,但出现了问题。 具体问题是:我配置好ICF后,编译工程,在开始Link时出现如下错误:
Error[Lc036]: no block or place matches the pattern "zi section .bss in bsp_spi.o symbols: [lpspi3_config]"
Error[Lc036]: no block or place matches the pattern "rw data section .data in bsp_fonts.o symbols: [Array_ACConst]" Error[Lc036]: no block or place matches the pattern "rw data section .data in bsp_fonts.o symbols: [gImage_font1_d5]" .
.
.
.
等等101个错误。 1. 以下是我的ICF的配置 - ** ###################################################################
*/
define symbol m_interrupts_start = 0x60002000;
define symbol m_interrupts_end = 0x600023FF; define symbol m_text_start = 0x60002400;
define symbol m_text_end = 0x63FFFFFF; /* SDRAM text /
/ SDRAM IVT_TABLE */
define symbol m_ram_interrupts_start = 0x80000000;
define symbol m_ram_interrupts_end = 0x800003FF; /* SDRAM code */
define symbol m_ram_text_start = 0x80000400;
define symbol m_ram_text_end = 0x81CFFFFF; define symbol m_data_start = 0x20000000;
define symbol m_data_end = 0x2001FFFF; define symbol m_data2_start = 0x20200000;
define symbol m_data2_end = 0x2023FFFF; define symbol m_data3_start = 0x81D00000;
define symbol m_data3_end = 0x81DFFFFF; define symbol m_ncache_start = 0x81E00000;
define symbol m_ncache_end = 0x81FFFFFF; define exported symbol m_boot_hdr_conf_start = 0x60000000;
define symbol m_boot_hdr_ivt_start = 0x60001000;
define symbol m_boot_hdr_boot_data_start = 0x60001020;
define symbol m_boot_hdr_dcd_data_start = 0x60001030; /* Sizes */
if (isdefinedsymbol(stack_size)) {
define symbol size_cstack = stack_size;
} else {
define symbol size_cstack = 0x0800;
} if (isdefinedsymbol(heap_size)) {
define symbol size_heap = heap_size;
} else {
define symbol size_heap = 0x0800;
} define exported symbol __VECTOR_TABLE = m_interrupts_start;
define exported symbol __VECTOR_RAM = m_ram_interrupts_start;
define exported symbol __RAM_VECTOR_TABLE_SIZE = 0x0; define memory mem with size = 4G;
define region TEXT_region = mem:[from m_interrupts_start to m_interrupts_end]; //FLAHS中代码存放位置
| mem:[from m_text_start to m_text_end]; define region SDRAM_TEXT_region = mem:[from m_ram_interrupts_start to m_ram_interrupts_end] //SDRAM中代码存放位置
| mem:[from m_ram_text_start to m_ram_text_end]; define region DATA_region = mem:[from m_data_start to m_data_end];
define region DATA2_region = mem:[from m_data2_start to m_data2_end];
define region DATA3_region = mem:[from m_data3_start to m_data3_end-size_cstack];
define region CSTACK_region = mem:[from m_data3_end-size_cstack+1 to m_data3_end];
define region NCACHE_region = mem:[from m_ncache_start to m_ncache_end]; define block CSTACK with alignment = 8, size = size_cstack { };
define block HEAP with alignment = 8, size = size_heap { };
define block RW { first readwrite, section m_usb_dma_init_data };
define block ZI with alignment = 32 { first zi, section m_usb_dma_noninit_data };
define block NCACHE_VAR with size = 0x200000 , alignment = 0x100000 { section NonCacheable , section NonCacheable.init }; /readonly --- copy code to RAM/
/except boot code /
initialize by copy{ readonly, readwrite, section .textrw }
except{
readonly section .intvec,
readonly object system_MIMXRT1052.o,
readonly object startup_MIMXRT1052.o, section .boot_hdr.conf, section .boot_hdr.ivt, section .boot_hdr.boot_data, section .boot_hdr.dcd_data }; do not initialize { section .noinit }; place at address mem: m_interrupts_start { readonly section .intvec }; /* RAM vector table*/
place at address mem: m_ram_interrupts_start { section .intvec_RAM }; place at address mem:m_boot_hdr_conf_start { section .boot_hdr.conf };
place at address mem:m_boot_hdr_ivt_start { section .boot_hdr.ivt };
place at address mem:m_boot_hdr_boot_data_start { readonly section .boot_hdr.boot_data };
place at address mem:m_boot_hdr_dcd_data_start { readonly section .boot_hdr.dcd_data }; keep{ section .boot_hdr.conf, section .boot_hdr.ivt, section .boot_hdr.boot_data, section .boot_hdr.dcd_data }; /* code load addr*/
place in TEXT_region { readonly }; /* code execute addr & RW data*/
place in SDRAM_TEXT_region { block RW };
place in DATA3_region { block ZI };
place in DATA3_region { last block HEAP };
place in CSTACK_region { block CSTACK };
place in NCACHE_region { block NCACHE_VAR }; 2. 我的程序的代码量: 224 663 bytes of readonly code memory 866 211 bytes of readonly data memory 7 990 982 bytes of readwrite data memory 3.我的几点理解: 1.代码复制到SDRAM中运行是不是就把代码当做RW类型来处理了。 2.我根据程序的代码量设置了RW ZI 的大小 分别是: /* SDRAM code */ define symbol m_ram_text_start = 0x80000400; define symbol m_ram_text_end = 0x81CFFFFF; 。。。 define symbol m_data3_start = 0x81D00000; define symbol m_data3_end = 0x81DFFFFF; 但最终编译还是出问题,所以请教下。。。
|