论坛大神么
STM32H7系列芯片,想将部分代码放到ITCM中执行。修改了分散加载文件如下:
[C] 纯文本查看 复制代码 ; *************************************************************
; *************************************************************
; *** Scatter-Loading Description File generated by uVision ***
; *************************************************************
LR_IROM1 0x08020000 0x001E0000 ; load region size_region
{
ER_IROM1 0x08020000 0x001E0000 { ; load address = execution address
*.o (RESET, +First)
*(InRoot$$Sections)
.ANY (+RO)
.ANY (+XO)
}
; backup_buffer_section
RW_STL_TM_RAM 0x20000000 0x20 { ; place STL RAM TM backup buffer outside tested subsets (i.e. beginning of the RAM)
*(backup_buffer_section)
}
; 128KB DTCM
DTCM_RAM 0x20000020 0x1FFE0 { ; place STL RAM TM backup buffer outside tested subsets (i.e. beginning of the RAM)
*(.dtcm_data*) ; 匹配.dtcm_data开头的自定义段
.ANY (+RW +ZI)
}
; 64KB ITCM
ITCM_ROM 0x00000000 0x00010000 {
*(.itcm_code*) ; 匹配.itcm_code开头的自定义段
}
RW_STL_CPU_TM12 0x24000020 0x20 { ; place STL CPU TM12 data in DCache Set n? relative cacheable RAM area
*(stl_cpu_tm12_section)
}
; 512KB AXI SRAM
AXI_SRAM 0x24000040 0x7FFC0 {
.ANY (+RW +ZI)
}
; 288KB SRAM1+SRAM2+SRAM3
;RW_IRAM3 0x30000000 0x00048000 {
; *(.RAM_D2)
;}
; 64KB SRAM4
;RW_IRAM4 0x38000000 0x00010000 {
; *(.RAM_D3)
;}
}
然后在代码中使用:
__attribute__((section(".itcm_code"))) void RingBufferInit(void)将RingBufferInit函数放在ITCM中。
想请问一下通过查看.map文件是否生效检索到如下字段:
Adding Veneers to the image
Adding TT veneer (10 bytes, Long) for call to '__2printf' from ringbuffer.o(.itcm_code).
Adding TT veneer (10 bytes, Long) for call to 'RingBufferInit' from init.o(.text).
2 Veneer(s) (total 20 bytes) added to the image.
为什么会是从1开始,不应该从0么?
|