****************************************************************************** TI ARM Linker PC v5.1.1 ****************************************************************************** >> Linked Fri Jul 25 16:55:40 2014 OUTPUT FILE NAME: <SampleProject.out> ENTRY POINT SYMBOL: "_c_int00" address: 00000415 MEMORY CONFIGURATION name origin length used unused attr fill ---------------------- -------- --------- -------- -------- ---- -------- FLASH 00000000 00100000 00000550 000ffab0 R X SRAM 20000000 00040000 00000814 0003f7ec RW X SEGMENT ALLOCATION MAP run origin load origin length init length attrs members ---------- ----------- ---------- ----------- ----- ------- 00000000 00000000 00000550 00000550 r-x 00000000 00000000 00000208 00000208 r-- .intvecs 00000208 00000208 00000328 00000328 r-x .text 00000530 00000530 00000020 00000020 r-- .cinit 20000000 20000000 00000814 00000000 rw- 20000000 20000000 00000800 00000000 rw- .stack 20000800 20000800 00000014 00000000 rw- .data SECTION ALLOCATION MAP output attributes/ section page origin length input sections -------- ---- ---------- ---------- ---------------- .intvecs 0 00000000 00000208 00000000 00000208 tm4c129dncpdt_startup_ccs.obj (.intvecs) .init_array * 0 00000000 00000000 UNINITIALIZED .text 0 00000208 00000328 00000208 0000009c rtsv7M4_T_le_v4SPD16_eabi.lib : memcpy_t2.obj (.text) 000002a4 00000094 : auto_init.obj (.text) 00000338 0000007c main.obj (.text) 000003b4 0000005e rtsv7M4_T_le_v4SPD16_eabi.lib : copy_decompress_rle.obj (.text) 00000412 00000002 --HOLE-- [fill = 0] 00000414 00000048 : boot.obj (.text) 0000045c 00000044 : cpy_tbl.obj (.text) 000004a0 00000044 : exit.obj (.text) 000004e4 00000018 : args_main.obj (.text) 000004fc 00000014 : _lock.obj (.text) 00000510 0000000e : copy_decompress_none.obj (.text:decompress:none) 0000051e 0000000c tm4c129dncpdt_startup_ccs.obj (.text) 0000052a 00000006 rtsv7M4_T_le_v4SPD16_eabi.lib : copy_decompress_rle.obj (.text:decompress:rle24) .cinit 0 00000530 00000020 00000530 0000000f (.cinit..data.load) [load image, compression = rle] 0000053f 00000001 --HOLE-- [fill = 0] 00000540 00000008 (__TI_handler_table) 00000548 00000008 (__TI_cinit_table) .stack 0 20000000 00000800 UNINITIALIZED 20000000 00000800 --HOLE-- .data 0 20000800 00000014 UNINITIALIZED 20000800 00000008 rtsv7M4_T_le_v4SPD16_eabi.lib : _lock.obj (.data) 20000808 00000008 : exit.obj (.data) 20000810 00000004 : stkdepth_vars.obj (.data) LINKER GENERATED COPY TABLES __TI_cinit_table @ 00000548 records: 1, size/record: 8, table size: 8 .data: load addr=00000530, load size=0000000f bytes, run addr=20000800, run size=00000014 bytes, compression=rle LINKER GENERATED HANDLER TABLE __TI_handler_table @ 00000540 records: 2, size/record: 4, table size: 8 index: 0, handler: __TI_decompress_rle24 index: 1, handler: __TI_decompress_none GLOBAL SYMBOLS: SORTED ALPHABETICALLY BY Name address name -------- ---- 000004a1 C$$EXIT 0000051f ResetISR UNDEFED SHT$$INIT_ARRAY$$Base UNDEFED SHT$$INIT_ARRAY$$Limit 20000800 __STACK_END 00000800 __STACK_SIZE 20000200 __STACK_TOP 00000548 __TI_CINIT_Base 00000550 __TI_CINIT_Limit 00000540 __TI_Handler_Table_Base 00000548 __TI_Handler_Table_Limit 00000001 __TI_args_main 000002a5 __TI_auto_init 20000808 __TI_cleanup_ptr 00000511 __TI_decompress_none 0000052b __TI_decompress_rle24 2000080c __TI_dtors_ptr 00000000 __TI_static_base__ 00000209 __aeabi_memcpy 00000209 __aeabi_memcpy4 00000209 __aeabi_memcpy8 ffffffff __binit__ ffffffff __c_args__ 20000000 __stack 000004e5 _args_main 00000415 _c_int00 20000800 _lock 0000050b _nop 00000503 _register_lock 000004fd _register_unlock 20000804 _unlock 000004a5 abort ffffffff binit 0000045d copy_in 000004ad exit 00000000 g_pfnVectors 00000339 main 20000810 main_func_sp 00000209 memcpy GLOBAL SYMBOLS: SORTED BY Symbol Address address name -------- ---- 00000000 __TI_static_base__ 00000000 g_pfnVectors 00000001 __TI_args_main 00000209 __aeabi_memcpy 00000209 __aeabi_memcpy4 00000209 __aeabi_memcpy8 00000209 memcpy 000002a5 __TI_auto_init 00000339 main 00000415 _c_int00 0000045d copy_in 000004a1 C$$EXIT 000004a5 abort 000004ad exit 000004e5 _args_main 000004fd _register_unlock 00000503 _register_lock 0000050b _nop 00000511 __TI_decompress_none 0000051f ResetISR 0000052b __TI_decompress_rle24 00000540 __TI_Handler_Table_Base 00000548 __TI_CINIT_Base 00000548 __TI_Handler_Table_Limit 00000550 __TI_CINIT_Limit 00000800 __STACK_SIZE 20000000 __stack 20000200 __STACK_TOP 20000800 __STACK_END 20000800 _lock 20000804 _unlock 20000808 __TI_cleanup_ptr 2000080c __TI_dtors_ptr 20000810 main_func_sp ffffffff __binit__ ffffffff __c_args__ ffffffff binit UNDEFED SHT$$INIT_ARRAY$$Base UNDEFED SHT$$INIT_ARRAY$$Limit [39 symbols]
I am using TM4C129DNCPDT board along with XDS200 USB Emulator. I am writing a boot image verfier program which gets executed after the ROM boot loader code. This program after verification jumps to another memoy location in flash memory and tries execute binary of image of my applicaiton present there. I am writing the binary of my application to flash memory using UNIFLASH. I am creatin the binary of my applicaiton by compiling the application project on Code Composer Studio. I am writing this binary at locatoin 0x4004 in flash memory. I am using TIRTOS and tivaware driverlib also.
1) when i run a debug session on my boot verifier program and jumps on memory location 0x4004, it doesn't show the application code at that location, but it takes a offset of 0x338 locations and shows the application code from location 0x433c.
2) I also tried to debug my application project(from which i created binary of application and written to flash) independently, in that case also the main code looks to start from the 0x338 location which was suppose to start from memory location 0x0. In this case the debugger lands to the location 0x338(where main starts) skipping the previous instructions which also makes sense.
3) As per the map file of the project what i could understand that before actual start of the application code some intvecs and driverlib code gets also written as it gets used in the application code, which also i think makes sense.
But Now what my problem is : When i jump to the location 0x4004 in case 1) above it starts executing the non-application code present at that location and after executing some instructions it goes into FaultIsr function and Hangs up in an infinite loop and my applicaiton code doesn't get executed at all. Instead of jumping on to the location 0x4004 i also tried to jump to
a) 0x420C( 0x4004 + 0x208(as MAP file shows in itial 0x208 location for some intvecs)) and
b) 0x42A8(0x4004 + 0x2a4 (as Map file shows this memory location also before start of main))
But in both of the above cases also the code hangs up in some infinite loop and my application code doesn't get executed at all.
But, if i jump to 0x433c where my application code is present, it works perfectly fine for me. But the problem here is : As here i know that the offset from where i wrote the application binary is 0x338 locations which won't be the case everytime and if there is any upgrade in my boot image it will definitely have some different offset which won't be known to my boot image verifier program. So, in that case the location from where the actual application codeis present will be unknown to my boot image verifier program and i will misbehave.
I am looking for a solution on this problem.
I am attaching the Map file of my sample application code in a text file format. Please find it in the attachments.
Also i am putting below snapshots to get some idea for different scenarios i mentioned above.
1) Address location 0x4004 showing non-application code
2) Location 0x433c showing my applicaiton code present there.
3) When i debug my appllication project code independently, the debugger landing on the main code at location 0x338 as mentioned in above point 2)
Please suggest some solution as this is completely surprising behaviour.
Thanks in advance.