首次发布在这里、是 TI 全球的全新产品。 我正在使用 TDA3XEVM、并且使用最新的 CCS 版本为其中一个 ARM Cortex M4创建测试项目。 首先、我想让 Timer1中断工作。
我使用的链接器命令文件如下所示:
.if __TI_EABI_ASSEMBLER
.asg c_intIRQ, C_INTIRQ
.else
.asg _c_intIRQ, C_INTIRQ
.endif
.global _c_int00
.global _int_handler
;.global C_INTIRQ
;.global tim1_int
.sect ".intvecs"
B _c_int00 ; reset interrupt
.word 0 ; undefined instruction interrupt
.word 0 ; software interrupt
.word 0 ; abort (prefetch) interrupt
.word 0 ; abort (data) interrupt
.word 0 ; reserved
B _int_handler ; IRQ interrupt
;B tim1_int ; FIQ interrupt
以下是处理程序 FWiw:
__interrupt void int_handler(void)
{
int i = 0;
i = 9;
if(i == 10)
{
i = 9;
}
}
我在*。map 文件中生成了此文件:
******************************************************************************
TI ARM Linker PC v20.2.5
******************************************************************************
>> Linked Mon Nov 1 11:44:22 2021
OUTPUT FILE NAME: <test-cortex-m-arm.out>
ENTRY POINT SYMBOL: "_c_int00" address: 00002915
MEMORY CONFIGURATION
name origin length used unused attr fill
---------------------- -------- --------- -------- -------- ---- --------
P_MEM 00000020 20000000 00003bf5 1fffc40b RWIX
D_MEM 20000020 20000000 0000a3b0 1fff5c50 RWIX
SEGMENT ALLOCATION MAP
run origin load origin length init length attrs members
---------- ----------- ---------- ----------- ----- -------
00000020 00000020 00002b65 00002b65 r-x
00000020 00000020 00002a64 00002a64 r-x .text
00002a84 00002a84 00000101 00000101 r-- .const
00002b88 00002b88 00001000 00001000 rw-
00002b88 00002b88 00001000 00001000 rw- .args
00003b88 00003b88 00000090 00000090 r--
00003b88 00003b88 00000090 00000090 r-- .cinit
20000020 20000020 0000a3b0 00000000 rw-
20000020 20000020 00008000 00000000 rw- .stack
20008020 20008020 00002000 00000000 rw- .sysmem
2000a020 2000a020 000001e8 00000000 rw- .data
2000a208 2000a208 000001c8 00000000 rw- .bss
SECTION ALLOCATION MAP
output attributes/
section page origin length input sections
-------- ---- ---------- ---------- ----------------
.text 0 00000020 00002a64
00000020 00000a4e rtsv7M4_T_le_eabi.lib : _printfi.c.obj (.text:__TI_printfi)
00000a6e 00000002 : _lock.c.obj (.text:_nop)
00000a70 00000268 : _printfi.c.obj (.text:_pconv_a)
00000cd8 000001cc : _printfi.c.obj (.text:_pconv_g)
00000ea4 000001b6 : fd_add_t2.asm.obj (.text)
0000105a 00000002 : div0.asm.obj (.text)
0000105c 0000013c : _printfi.c.obj (.text:_pconv_e)
00001198 00000136 : fd_div_t2.asm.obj (.text)
000012ce 00000002 --HOLE-- [fill = 0]
000012d0 00000120 : _printfi.c.obj (.text:fcvt)
000013f0 00000114 : fputs.c.obj (.text:fputs)
00001504 00000100 : memory.c.obj (.text:aligned_alloc)
00001604 000000fc : fd_mul_t2.asm.obj (.text)
00001700 000000e4 : memory.c.obj (.text:free)
000017e4 000000dc : setvbuf.c.obj (.text:setvbuf)
000018c0 000000d0 : s_scalbn.c.obj (.text:scalbn)
00001990 000000b4 hello.obj (.text)
00001a44 000000b1 rtsv7M4_T_le_eabi.lib : _printfi.c.obj (.text:_ltostr)
00001af5 00000001 --HOLE-- [fill = 0]
00001af6 0000009c : memcpy_t2.asm.obj (.text)
00001b92 00000096 : ull_div_t2.asm.obj (.text)
00001c28 0000008c : fputc.c.obj (.text:fputc)
00001cb4 00000086 : fd_cmp_t2.asm.obj (.text:__aeabi_cdcmple)
00001d3a 00000086 : fd_cmp_t2.asm.obj (.text:__aeabi_cdrcmple)
00001dc0 0000007a : memset_t2.asm.obj (.text)
00001e3a 00000002 --HOLE-- [fill = 0]
00001e3c 00000074 : fclose.c.obj (.text:__TI_closefile)
00001eb0 00000070 : memory.c.obj (.text:split)
00001f20 0000006e : _printfi.c.obj (.text:_mcpy)
00001f8e 00000002 --HOLE-- [fill = 0]
00001f90 0000006c : hostrename.c.obj (.text:HOSTrename)
00001ffc 00000068 : hostlseek.c.obj (.text:HOSTlseek)
00002064 00000068 : copy_decompress_lzss.c.obj (.text:decompress:lzss:__TI_decompress_lzss)
000020cc 00000068 : printf.c.obj (.text:printf)
00002134 00000064 : fseek.c.obj (.text:fseek)
00002198 00000062 : _io_perm.c.obj (.text:__TI_wrt_ok)
000021fa 00000002 --HOLE-- [fill = 0]
000021fc 00000060 : hostopen.c.obj (.text:HOSTopen)
0000225c 0000005c : close.c.obj (.text:close)
000022b8 0000005c : s_frexp.c.obj (.text:frexp)
00002314 00000058 : hostread.c.obj (.text:HOSTread)
0000236c 00000058 : hostwrite.c.obj (.text:HOSTwrite)
000023c4 00000056 : _printfi.c.obj (.text:_pconv_f)
0000241a 00000054 : _ltoa.c.obj (.text:__TI_ltoa)
0000246e 00000052 : _printfi.c.obj (.text:_ecpy)
000024c0 0000004c : fflush.c.obj (.text:__TI_doflush)
0000250c 0000004c : atoi.c.obj (.text:atoi)
00002558 00000048 : exit.c.obj (.text:exit)
000025a0 00000048 : fd_toi_t2.asm.obj (.text)
000025e8 00000044 : hostclose.c.obj (.text:HOSTclose)
0000262c 00000044 : hostunlink.c.obj (.text:HOSTunlink)
00002670 00000044 : autoinit.c.obj (.text:__TI_auto_init_nobinit_nopinit:__TI_auto_init_nobinit_nopinit)
000026b4 00000044 : getdevice.c.obj (.text:getdevice)
000026f8 0000003e : _printfi.c.obj (.text:_fcpy)
00002736 00000002 --HOLE-- [fill = 0]
00002738 00000038 : trgmsg.c.obj (.text:__TI_writemsg)
00002770 00000036 : strncpy.c.obj (.text:strncpy)
000027a6 00000002 --HOLE-- [fill = 0]
000027a8 00000034 : fopen.c.obj (.text:__TI_cleanup)
000027dc 00000034 : trgmsg.c.obj (.text:__TI_readmsg)
00002810 00000030 : getdevice.c.obj (.text:finddevice)
00002840 0000002e : i_tofd_t2.asm.obj (.text)
0000286e 00000002 --HOLE-- [fill = 0]
00002870 0000002c : unlink.c.obj (.text:unlink)
0000289c 00000028 : memory.c.obj (.text:free_list_insert)
000028c4 00000028 : lseek.c.obj (.text:lseek)
000028ec 00000028 : write.c.obj (.text:write)
00002914 00000024 : boot_cortex_m.c.obj (.text:_c_int00:_c_int00)
00002938 00000020 : memchr.c.obj (.text:memchr)
00002958 0000001c : copy_zero_init.c.obj (.text:decompress:ZI:__TI_zero_init_nomemset:__TI_zero_init_nomemset)
00002974 0000001c : memory.c.obj (.text:free_list_remove)
00002990 0000001c : memccpy.c.obj (.text:memccpy)
000029ac 0000001a hello.obj (.text:retain)
000029c6 00000002 --HOLE-- [fill = 0]
000029c8 00000018 rtsv7M4_T_le_eabi.lib : args_main.c.obj (.text:_args_main)
000029e0 00000018 : strcmp.c.obj (.text:strcmp)
000029f8 00000016 : strchr.c.obj (.text:strchr)
00002a0e 00000014 : strcpy.c.obj (.text:strcpy)
00002a22 00000014 : strlen.c.obj (.text:strlen)
00002a36 00000012 : wcslen.c.obj (.text:wcslen)
00002a48 0000000e : copy_decompress_none.c.obj (.text:decompress:none:__TI_decompress_none)
00002a56 0000000c : s_copysign.c.obj (.text:copysign)
00002a62 00000002 --HOLE-- [fill = 0]
00002a64 00000008 : errno.c.obj (.text:__aeabi_errno_addr)
00002a6c 00000008 : memory.c.obj (.text:malloc)
00002a74 00000004 : printf.c.obj (.text:_outc)
00002a78 00000004 : printf.c.obj (.text:_outs)
00002a7c 00000004 : pre_init.c.obj (.text:_system_pre_init)
00002a80 00000004 : exit.c.obj (.text:abort:abort)
.const 0 00002a84 00000101
00002a84 00000101 rtsv7M4_T_le_eabi.lib : ctype.c.obj (.const:.string:_ctypes_)
.cinit 0 00003b88 00000090
00003b88 0000006c (.cinit..data.load) [load image, compression = lzss]
00003bf4 0000000c (__TI_handler_table)
00003c00 00000008 (.cinit..bss.load) [load image, compression = zero_init]
00003c08 00000010 (__TI_cinit_table)
.stack 0 20000020 00008000 UNINITIALIZED
20000020 00000004 rtsv7M4_T_le_eabi.lib : boot_cortex_m.c.obj (.stack)
20000024 00007ffc --HOLE--
.sysmem 0 20008020 00002000 UNINITIALIZED
20008020 00000010 rtsv7M4_T_le_eabi.lib : memory.c.obj (.sysmem)
20008030 00001ff0 --HOLE--
.data 0 2000a020 000001e8 UNINITIALIZED
2000a020 000000f0 rtsv7M4_T_le_eabi.lib : defs.c.obj (.data:_ftable)
2000a110 00000078 : host_device.c.obj (.data:_device)
2000a188 00000050 : host_device.c.obj (.data:_stream)
2000a1d8 00000010 : defs.c.obj (.data)
2000a1e8 0000000c : exit.c.obj (.data:$O1$$)
2000a1f4 00000008 : _lock.c.obj (.data:$O1$$)
2000a1fc 00000008 : memory.c.obj (.data:$O1$$)
2000a204 00000004 : errno.c.obj (.data)
.bss 0 2000a208 000001c8 UNINITIALIZED
2000a208 00000120 rtsv7M4_T_le_eabi.lib : trgmsg.c.obj (.bss:_CIOBUF_)
2000a328 000000a0 (.common:__TI_tmpnams)
2000a3c8 00000008 (.common:parmbuf)
__llvm_prf_cnts
* 0 20000020 00000000 UNINITIALIZED
.binit 0 00000020 00000000
.args 0 00002b88 00001000
00002b88 00001000 --HOLE-- [fill = 0]
MODULE SUMMARY
Module code ro data rw data
------ ---- ------- -------
.\
hello.obj 206 0 0
+--+----------------------------+-------+---------+---------+
Total: 206 0 0
C:\ti\ccs1040\ccs\tools\compiler\ti-cgt-arm_20.2.5.LTS\lib\rtsv7M4_T_le_eabi.lib
_printfi.c.obj 4835 0 0
memory.c.obj 672 0 8
fd_add_t2.asm.obj 438 0 0
defs.c.obj 0 0 416
trgmsg.c.obj 108 0 288
fd_div_t2.asm.obj 310 0 0
fputs.c.obj 276 0 0
fd_cmp_t2.asm.obj 268 0 0
ctype.c.obj 0 257 0
fd_mul_t2.asm.obj 252 0 0
setvbuf.c.obj 220 0 0
s_scalbn.c.obj 208 0 0
host_device.c.obj 0 0 200
memcpy_t2.asm.obj 156 0 0
ull_div_t2.asm.obj 150 0 0
fputc.c.obj 140 0 0
memset_t2.asm.obj 122 0 0
fclose.c.obj 116 0 0
getdevice.c.obj 116 0 0
printf.c.obj 112 0 0
hostrename.c.obj 108 0 0
copy_decompress_lzss.c.obj 104 0 0
hostlseek.c.obj 104 0 0
hostopen.c.obj 96 0 8
fseek.c.obj 100 0 0
_io_perm.c.obj 98 0 0
close.c.obj 92 0 0
s_frexp.c.obj 92 0 0
exit.c.obj 76 0 12
hostread.c.obj 88 0 0
hostwrite.c.obj 88 0 0
_ltoa.c.obj 84 0 0
atoi.c.obj 76 0 0
fflush.c.obj 76 0 0
fd_toi_t2.asm.obj 72 0 0
autoinit.c.obj 68 0 0
hostclose.c.obj 68 0 0
hostunlink.c.obj 68 0 0
strncpy.c.obj 54 0 0
fopen.c.obj 52 0 0
i_tofd_t2.asm.obj 46 0 0
unlink.c.obj 44 0 0
lseek.c.obj 40 0 0
write.c.obj 40 0 0
boot_cortex_m.c.obj 36 0 0
memchr.c.obj 32 0 0
copy_zero_init.c.obj 28 0 0
memccpy.c.obj 28 0 0
args_main.c.obj 24 0 0
strcmp.c.obj 24 0 0
strchr.c.obj 22 0 0
strcpy.c.obj 20 0 0
strlen.c.obj 20 0 0
wcslen.c.obj 18 0 0
copy_decompress_none.c.obj 14 0 0
errno.c.obj 8 0 4
s_copysign.c.obj 12 0 0
_lock.c.obj 2 0 8
pre_init.c.obj 4 0 0
div0.asm.obj 2 0 0
+--+----------------------------+-------+---------+---------+
Total: 10627 257 944
Heap: 0 0 8192
Stack: 0 0 32768
Linker Generated: 0 144 0
+--+----------------------------+-------+---------+---------+
Grand Total: 10833 401 41904
LINKER GENERATED COPY TABLES
__TI_cinit_table @ 00003c08 records: 2, size/record: 8, table size: 16
.data: load addr=00003b88, load size=0000006c bytes, run addr=2000a020, run size=000001e8 bytes, compression=lzss
.bss: load addr=00003c00, load size=00000008 bytes, run addr=2000a208, run size=000001c8 bytes, compression=zero_init
LINKER GENERATED HANDLER TABLE
__TI_handler_table @ 00003bf4 records: 3, size/record: 4, table size: 12
index: 0, handler: __TI_zero_init
index: 1, handler: __TI_decompress_lzss
index: 2, handler: __TI_decompress_none
GLOBAL SYMBOLS: SORTED ALPHABETICALLY BY Name
address name
------- ----
00002a81 C$$EXIT
00002767 C$$IO$$
000025e9 HOSTclose
00001ffd HOSTlseek
000021fd HOSTopen
00002315 HOSTread
00001f91 HOSTrename
0000262d HOSTunlink
0000236d HOSTwrite
2000a208 __CIOBUF_
20008020 __STACK_END
00008000 __STACK_SIZE
00002000 __SYSMEM_SIZE
00003c08 __TI_CINIT_Base
00003c18 __TI_CINIT_Limit
00003bf4 __TI_Handler_Table_Base
00003c00 __TI_Handler_Table_Limit
00002671 __TI_auto_init_nobinit_nopinit
000027a9 __TI_cleanup
2000a1e8 __TI_cleanup_ptr
00001e3d __TI_closefile
00002065 __TI_decompress_lzss
00002a49 __TI_decompress_none
000024c1 __TI_doflush
2000a1ec __TI_dtors_ptr
2000a1f0 __TI_enable_exit_profile_output
2000a1d8 __TI_ft_end
0000241b __TI_ltoa
ffffffff __TI_pprof_out_hndl
00000021 __TI_printfi
ffffffff __TI_prof_data_size
ffffffff __TI_prof_data_start
000027dd __TI_readmsg
00003b88 __TI_static_base__
2000a328 __TI_tmpnams
00002739 __TI_writemsg
00002199 __TI_wrt_ok
00002959 __TI_zero_init_nomemset
00001cb5 __aeabi_cdcmpeq
00001cb5 __aeabi_cdcmple
00001d3b __aeabi_cdrcmple
000025a1 __aeabi_d2iz
00000eaf __aeabi_dadd
00001199 __aeabi_ddiv
00001605 __aeabi_dmul
00000ea5 __aeabi_dsub
00002a65 __aeabi_errno_addr
00002841 __aeabi_i2d
0000105b __aeabi_idiv0
0000105b __aeabi_ldiv0
00001dc1 __aeabi_memclr
00001dc1 __aeabi_memclr4
00001dc1 __aeabi_memclr8
00001af7 __aeabi_memcpy
00001af7 __aeabi_memcpy4
00001af7 __aeabi_memcpy8
00001dc3 __aeabi_memset
00001dc3 __aeabi_memset4
00001dc3 __aeabi_memset8
2000a1e4 __aeabi_stderr
2000a1dc __aeabi_stdin
2000a1e0 __aeabi_stdout
00001b93 __aeabi_uldivmod
ffffffff __binit__
00002b88 __c_args__
UNDEFED __mpu_init
20000020 __stack
20000020 __start___llvm_prf_cnts
20000020 __stop___llvm_prf_cnts
000029c9 _args_main
00002915 _c_int00
00002a84 _ctypes_
2000a110 _device
2000a020 _ftable
2000a1f4 _lock
00000a6f _nop
2000a188 _stream
20008020 _sys_memory
UNDEFED _system_post_cinit
00002a7d _system_pre_init
2000a1f8 _unlock
00002a81 abort
00001505 aligned_alloc
0000250d atoi
ffffffff binit
0000225d close
00002a57 copysign
00002a57 copysignl
2000a204 errno
00002559 exit
00002811 finddevice
00001c29 fputc
000013f1 fputs
00001701 free
000022b9 frexp
000022b9 frexpl
00002135 fseek
000026b5 getdevice
000029ad int_handler
000018c1 ldexp
000018c1 ldexpl
000028c5 lseek
00001991 main
00002a6d malloc
00001505 memalign
00002991 memccpy
00002939 memchr
00001af7 memcpy
00001dc9 memset
2000a3c8 parmbuf
000020cd printf
00001c29 putc
00002871 remove
000018c1 scalbn
000018c1 scalbnl
000017e5 setvbuf
000029f9 strchr
000029e1 strcmp
00002a0f strcpy
00002a23 strlen
00002771 strncpy
00002871 unlink
00002a37 wcslen
000028ed write
GLOBAL SYMBOLS: SORTED BY Symbol Address
address name
------- ----
00000021 __TI_printfi
00000a6f _nop
00000ea5 __aeabi_dsub
00000eaf __aeabi_dadd
0000105b __aeabi_idiv0
0000105b __aeabi_ldiv0
00001199 __aeabi_ddiv
000013f1 fputs
00001505 aligned_alloc
00001505 memalign
00001605 __aeabi_dmul
00001701 free
000017e5 setvbuf
000018c1 ldexp
000018c1 ldexpl
000018c1 scalbn
000018c1 scalbnl
00001991 main
00001af7 __aeabi_memcpy
00001af7 __aeabi_memcpy4
00001af7 __aeabi_memcpy8
00001af7 memcpy
00001b93 __aeabi_uldivmod
00001c29 fputc
00001c29 putc
00001cb5 __aeabi_cdcmpeq
00001cb5 __aeabi_cdcmple
00001d3b __aeabi_cdrcmple
00001dc1 __aeabi_memclr
00001dc1 __aeabi_memclr4
00001dc1 __aeabi_memclr8
00001dc3 __aeabi_memset
00001dc3 __aeabi_memset4
00001dc3 __aeabi_memset8
00001dc9 memset
00001e3d __TI_closefile
00001f91 HOSTrename
00001ffd HOSTlseek
00002000 __SYSMEM_SIZE
00002065 __TI_decompress_lzss
000020cd printf
00002135 fseek
00002199 __TI_wrt_ok
000021fd HOSTopen
0000225d close
000022b9 frexp
000022b9 frexpl
00002315 HOSTread
0000236d HOSTwrite
0000241b __TI_ltoa
000024c1 __TI_doflush
0000250d atoi
00002559 exit
000025a1 __aeabi_d2iz
000025e9 HOSTclose
0000262d HOSTunlink
00002671 __TI_auto_init_nobinit_nopinit
000026b5 getdevice
00002739 __TI_writemsg
00002767 C$$IO$$
00002771 strncpy
000027a9 __TI_cleanup
000027dd __TI_readmsg
00002811 finddevice
00002841 __aeabi_i2d
00002871 remove
00002871 unlink
000028c5 lseek
000028ed write
00002915 _c_int00
00002939 memchr
00002959 __TI_zero_init_nomemset
00002991 memccpy
000029ad int_handler
000029c9 _args_main
000029e1 strcmp
000029f9 strchr
00002a0f strcpy
00002a23 strlen
00002a37 wcslen
00002a49 __TI_decompress_none
00002a57 copysign
00002a57 copysignl
00002a65 __aeabi_errno_addr
00002a6d malloc
00002a7d _system_pre_init
00002a81 C$$EXIT
00002a81 abort
00002a84 _ctypes_
00002b88 __c_args__
00003b88 __TI_static_base__
00003bf4 __TI_Handler_Table_Base
00003c00 __TI_Handler_Table_Limit
00003c08 __TI_CINIT_Base
00003c18 __TI_CINIT_Limit
00008000 __STACK_SIZE
20000020 __stack
20000020 __start___llvm_prf_cnts
20000020 __stop___llvm_prf_cnts
20008020 __STACK_END
20008020 _sys_memory
2000a020 _ftable
2000a110 _device
2000a188 _stream
2000a1d8 __TI_ft_end
2000a1dc __aeabi_stdin
2000a1e0 __aeabi_stdout
2000a1e4 __aeabi_stderr
2000a1e8 __TI_cleanup_ptr
2000a1ec __TI_dtors_ptr
2000a1f0 __TI_enable_exit_profile_output
2000a1f4 _lock
2000a1f8 _unlock
2000a204 errno
2000a208 __CIOBUF_
2000a328 __TI_tmpnams
2000a3c8 parmbuf
ffffffff __TI_pprof_out_hndl
ffffffff __TI_prof_data_size
ffffffff __TI_prof_data_start
ffffffff __binit__
ffffffff binit
UNDEFED __mpu_init
UNDEFED _system_post_cinit
[124 symbols]
我无法看到".intvecs"段在*。map 文件中的位置。 我正在使用编译器目录中的默认链接器命令文件- lnk.cmd。 我可以在这里找到:
C:\ti\ccs1040\ccs\tools\compiler\ti-cgt-arm_20.2.5.LTS \lib
另外、不确定在哪里可以查找信息、以了解某些处理程序需要放置在矢量表中的哪个位置。
因此、对于这种使用 CCS 及其工具的 TI 方案而言、这是一项非常新的工作。 希望通过创建一个简单的计时器中断例程(如微控制器类型的 C 应用)来更深入地了解这一点。