IAR INIT_EXPORT 开始的地址比结束的还大

发布于 2020-07-09 18:53:19
\ | /
- RT -     Thread Operating System
 / | \     4.0.3 build Jul  9 2020
 2006 - 2020 Copyright by rt-thread team
__rt_init_rti_board_end:0x5ed90 __rt_init_rti_end: 0x27cdc
RT-Thread for nrf52840 started.{{project.map(uploading...)}}
advertising_start.....

查看更多

关注者
0
被浏览
311
armink
armink 2020-07-09

之前加过一个自定义的 .version 段,好像也没出问题

/*###ICF### Section handled by ICF editor, don't touch! ****/
/*-Editor annotation file-*/
/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */
/*-Specials-*/
define symbol __ICFEDIT_intvec_start__ = 0x08000000;
/* 软件及硬件版本号存放地址 */
define symbol __ICFEDIT_version_start__ = __ICFEDIT_intvec_start__ + 512;
/*-Memory Regions-*/
define symbol __ICFEDIT_region_ROM_start__ = __ICFEDIT_intvec_start__;
define symbol __ICFEDIT_region_ROM_end__   = 0x080FFFFF;
define symbol __ICFEDIT_region_RAM_start__ = 0x20000000;
define symbol __ICFEDIT_region_RAM_end__   = 0x2001FFFF;
/*-Sizes-*/
define symbol __ICFEDIT_size_cstack__ = 0x2000;
define symbol __ICFEDIT_size_heap__   = 0x2000;
/**** End of ICF editor section. ###ICF###*/

define symbol __region_RAM1_start__ = 0x10000000;
define symbol __region_RAM1_end__   = 0x1000FFFF;

define memory mem with size = 4G;
define region ROM_region   = mem:[from __ICFEDIT_region_ROM_start__   to __ICFEDIT_region_ROM_end__];
define region RAM_region   = mem:[from __ICFEDIT_region_RAM_start__   to __ICFEDIT_region_RAM_end__];
define region RAM1_region  = mem:[from __region_RAM1_start__   to __region_RAM1_end__];

define block CSTACK    with alignment = 8, size = __ICFEDIT_size_cstack__   { };
define block HEAP      with alignment = 8, size = __ICFEDIT_size_heap__     { };

initialize by copy { readwrite };
do not initialize  { section .noinit };

place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec };

place in ROM_region   { readonly };
place in RAM_region   { block CSTACK, last block HEAP, section .sram};
place in RAM1_region  { readwrite };

/* armink add for version storage */
keep { section .version };
place at address mem:__ICFEDIT_version_start__ { readonly section .version };

/* armink add for finsh */
keep { section FSymTab };
keep { section VSymTab };
keep { section .rti_fn* };
3 个回答
hzhmcu
hzhmcu 2020-07-09
.rodata                 const       0x2'7c3c     0x2c  pkt_tilt.o [1]
  .rodata                 const       0x2'7c68     0x2c  pkt_tilt.o [1]
  .rodata                 const       0x2'7c94     0x2c  rt_nrf_hal_spi.o [1]
  .rti_fn.6               const       0x2'7cc0      0x4  inf_ble.o [1]
  .rti_fn.6               const       0x2'7cc4      0x4  inf_gsm.o [1]
  .rti_fn.6               const       0x2'7cc8      0x4  inf_usb_hid.o [1]
  .rti_fn.6               const       0x2'7ccc      0x4  inf_wdt.o [1]
  .rti_fn.6               const       0x2'7cd0      0x4  pkt_time_event.o [1]
  .rti_fn.6               const       0x2'7cd4      0x4  pkt_work.syswork.o [1]
  .rti_fn.6               const       0x2'7cd8      0x4  shell.o [1]
  .rti_fn.6.end           const       0x2'7cdc      0x4  components.o [1]
  .text                   ro code     0x2'7ce0      0x2  iar_startup_nrf52840.o [1]
  .rodata                 const       0x2'7ce2      0x1  dev_config.read.o [1]
  .rodata                 const       0x2'7ce3      0x1  nrf_drv_power.o [1]
  .rodata                 const       0x2'7ce4      0x1  protor.s.blebase.o [1]
  .rodata                 const       0x2'7ce5      0x1  protor.s.control.o [1]
  .rodata                 const       0x2'7ce6      0x1  protor.s.debug.o [1]
  .rodata                 const       0x2'7ce7      0x1  protor.s.factory.o [1]
  .rodata                 const       0x2'7ce8      0x1  protor.s.record.o [1]
  .rodata                 const       0x2'7ce9      0x1  protor.s.service.o [1]
  .rodata                 const       0x2'7cea      0x0  zero_init3.o [4]
  .rodata                 const       0x2'7cea      0x0  lz77_init_single.o [4]
                                    - 0x2'7cea   0x1aea

Absolute sections:                                 0x2c
  .rodata                 const       0x2'8000     0x2c  app_fw_info.o [1]
                                    - 0x2'802c     0x2c

"P1", part 2 of 2:                              0x370a0
  .text                   ro code     0x2'802c   0x39fc  sms_protocol.o [1]
  .text                   ro code     0x2'ba28   0x25d8  dev_config.write.o [1]

增加了一个绝对section.导致的。有没有解决办法呢。这绝对地址是一定要的

aozima
aozima 2020-07-09
拒绝白嫖,拒绝键盘侠!

应该是在链接脚本中想办法,指定这块放到text段附近。

撰写答案

请登录后再发布答案,点击登录

发布
问题

分享
好友

手机
浏览

扫码手机浏览