This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi again,
while debugging some "abort" condition, i ran into some strange disassembler behaviour:
The source states a "b" command for "branch endless", but the window shows some random tokens which don´t really make sense. While stepping into, it shows that the "branch endless" loop is actually executed. So the disassembler seems to be wrong.
I´m using the current version of CCS ...
Thanks
Dominik
Hi Dominik,
I am forwarding your post the CCS support forum, where this question can be addressed.
Best regards,
Hercules Forum Support
A "branch endless" usually branches to itself. It will keep branching forever, and the fact that it executes is not itself an error.
Could you post a screen capture of these "random tokens?"
Thanks for the reply. There is no problem in the "endless jump" itself, the problem is that the executed code ("itself: b itself") is not displayed in the disassembler correctly.
For the screenshot i set a breakpoint within sys_core.asm at the first line - the disassembler window shows some very strang instrcutions....
I have another theory to offer.
Perhaps the range of memory being displayed by the disassembler has been trashed somehow. I suggest you use the View | Memory Browser feature of CCS to inspect memory starting at address 0x00014b50. Look right after a successful load, and then again after hitting this breakpoint. I bet it changed, even though it shouldn't.
Thanks and regards,
-George
Thanks for the reply.... I tried it. I ran a full rebuild and started the debugger. The memory browser looks like this.
After entering the debugger i see the following:
After changing back to the memory browser - nothing changed.
Needless to say that the debugger (correctly) runs an endless loop after the "dataAbort:" handler, despite the "cp" token....
best regards
Dominik
The first instruction of __TI_decompress_rle24 is supposed to be MOVS R2, #0x1, which for R4 thumb mode has opcode 0x0122, as shown in your screenshot. However, the disassembler inside CCS is decoding it as a different instruction. I don't know enough about ARM opcode encodings to take a guess at what's wrong here.
What ARM device are you using, and what command-line options are you using to build the program?
Hi Archaelogist,
I´m using a TMS570 .... build command is "use default build command".
best regards
There is a build window which shows the compiler being invoked to build the program. What command-line options are being passed to the compiler?
No problem:
C:\ti\ccsv5\utils\bin\gmake -k all
'Building file: ../modules/OS/src/OS_thread_TX.c'
'Invoking: ARM Compiler'
"C:/ti/ccsv5/tools/compiler/tms470_4.9.7/bin/cl470" -mv7R4 --code_state=32 --float_support=VFPv3D16 --abi=eabi -g --preinclude="../src/prefix.h" --include_path="C:/ti/ccsv5/tools/compiler/tms470_4.9.7/include" --include_path="../src" --include_path="../modules" --include_path="../modules/bsp/src" --include_path="../modules/cpu_TMS570/src" --include_path="../modules/CommonInclude/src" --include_path="../modules/ThreadX/src" --include_path="../modules/Os/src" --gcc --define=__TMS470__ --define=OS_TST5XXX --define=TX_OS --define=__DEBUG__=1 --define=SW_ERROR_HIST_LOGGER_ACTIVE=1 --diag_warning=225 --display_error_number --enum_type=packed --asm_listing --preproc_with_compile --preproc_dependency="modules/OS/src/OS_thread_TX.pp" --obj_directory="modules/OS/src" "../modules/OS/src/OS_thread_TX.c"
"../modules/OS/src/OS_thread_TX.c", line 142: warning #41-D: expected an identifier
'Finished building: ../modules/OS/src/OS_thread_TX.c'
' '
'Building target: TST-5xxx.out'
'Invoking: ARM Linker'
'Flags: -mv7R4 --code_state=32 --float_support=VFPv3D16 --abi=eabi -g --preinclude="../src/prefix.h" --gcc --define=__TMS470__ --define=OS_TST5XXX --define=TX_OS --define=__DEBUG__=1 --define=SW_ERROR_HIST_LOGGER_ACTIVE=1 --diag_warning=225 --display_error_number --enum_type=packed --asm_listing -z --stack_size=1234 -m"TST-5xxx.map" --heap_size=4321 -i"C:/ti/ccsv5/tools/compiler/tms470_4.9.7/lib" -i"C:/ti/ccsv5/tools/compiler/tms470_4.9.7/include" --reread_libs --warn_sections --display_error_number --rom_model --be32'
"C:/ti/ccsv5/tools/compiler/tms470_4.9.7/bin/cl470" -@"ccsLinker.opt" -o "TST-5xxx.out"
<Linking>
'Finished building target: TST-5xxx.out'
' '
**** Build Finished ****
Thanks, that helps. Please look at the linker-generated map file (TST-5xxx.map) and tell me what RTS library the linker is using. It will have a name like rts<name>.lib
Okay, I've looked at the pristine rtsv7R4_T_be_v3D16_eabi.lib from ARM compiler version 4.9.7, and as expected, the first instruction in __TI_decompress_rle24 is the Thumb 2 instruction "MOVS R2, #0x1", which is 16 bits long. This shows up in raw memory as 2201, just as it does in your snapshot of memory as raw data. The memory at that location is correct, but for some reason the disassembly window gets the instruction wrong. My first thought was that the disassembly window is configued to use the wrong endianness or CPU architecture, but I can't figure out how it could be interpreting it as an "LSL". The standalone disassembler that comes with the compiler (dis470) correctly disassembles it, so this problem seems to be specific to the CCS disassembler. We will likely need to move this thread to the CCS forum for further analysis.
Hi,
thanks very much for the in-depth analysis. Is there anything left for me to do right now to help resolving that issue?
best regards
Dominik
Dominik,
What is the exact version of CCS you are using - is it CCS 5.2.1 or 5.3? I noticed you were using a XDS510 based emulator, and there is one known bug with CCS disassembly view showing instructions in a different endianess type (BE-8 instead of the expected BE-32), which sounds like what you are experiencing. The bug I am referring to is SDSCM00044249 and you can look up some details on it by going to the SDOWP link in my signature.
The bug should be fixed in CCS 5.3, so if you're not already using this version could you please give it a try and let us know if it is resolved? CCS 5.3 can be downloaded and installed from http://processors.wiki.ti.com/index.php/Download_CCS
Thanks for the immediate reply. I´m using 5.2.0.00069
When i run "check for updates" it only tries to update "Spectrum Digital Emulators" to Version 5.2.0.06.
After your comment i looked at the download site and it offers Version 5.3.0 dated Nov 26, 2012 - I´m downloading it right now.
I´ll report tomorrow if the issue has been solved ....
THANK YOUR VERY MUCH!
After i had some trouble updating... it finally worked and the problem is gone. THANKS VERY MUCH!