野火电子论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 10342|回复: 4

关于代码在SDRAM中运行问题请教

[复制链接]
发表于 2018-12-1 15:04:08 | 显示全部楼层 |阅读模式
我根据火哥关于代码在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;
但最终编译还是出问题,所以请教下。。。

回复

使用道具 举报

发表于 2018-12-3 08:47:10 | 显示全部楼层
这个配置好复杂 ,建议还是先用火哥的配置 文件
回复 支持 反对

使用道具 举报

 楼主| 发表于 2018-12-3 09:16:25 | 显示全部楼层
巢易白 发表于 2018-12-3 08:47
这个配置好复杂 ,建议还是先用火哥的配置 文件

用的就是火哥的配置文件。已解决。谢谢!
回复 支持 反对

使用道具 举报

发表于 2018-12-13 08:14:51 | 显示全部楼层
xiaobakang 发表于 2018-12-3 09:16
用的就是火哥的配置文件。已解决。谢谢!

请问,如何解决的
回复 支持 反对

使用道具 举报

 楼主| 发表于 2018-12-13 13:31:17 | 显示全部楼层
GUISUANZI 发表于 2018-12-13 08:14
请问,如何解决的

SDRAM_TEXT_region区域定义的有点小,我的程序加载了很多图片。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

联系站长|手机版|野火电子官网|野火淘宝店铺|野火电子论坛 ( 粤ICP备14069197号 ) 大学生ARM嵌入式2群

GMT+8, 2024-11-25 04:18 , Processed in 0.029727 second(s), 23 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表