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.

CCS/EK-TM4C1294XL: CCS9.1 debug Hex & ASCII, odd Length

Guru 54788 points
Part Number: EK-TM4C1294XL

Tool/software: Code Composer Studio

Hello,

CCS 9.1 perhaps even earlier versions of debug array values are show both as decimal and hex, is not keeping consistent behavior making very confusing what is what and from where did it come. Was the input from outside world an 'A' or 0x41 that CCS has commandeered both times? I know it was 0x41 before it entered the CCS world but question 'A' since HexToDec() is choking on single pass reads of the array value. 

Also the length of strings is showing values greater than the number of bytes being read. So hex 0x03 is 1 byte with an added terminator '\0' is 2 bytes and not 3 bytes as debug shows. Again if we try to put two characters into ticks for example '23' code analysis and build both show it as an potential porting warning. So is the backslash inside the null terminator ticks being counted as a byte but not allowed to be ported as two characters any other time? Oddly C++ study guide has no information on this subject of NULL terminator other than how it looks '\0' and strlen() adds it to the end of a string..

 

  • BP101 said:
    CCS 9.1 perhaps even earlier versions of debug array values are show both as decimal and hex, is not keeping consistent behavior making very confusing what is what and from where did it come.

    CCS Expressions view defaults to decimal number format but you can set any of the value to a different format like hex by right-clicking on the variable and selecting Number Format. That is likely what happened to some of the array elements.

    BP101 said:
    Also the length of strings is showing values greater than the number of bytes being read.

    I'm not clear what your code is intended to achieve. Are you trying to get the length of a string using strlen? It appears you are not actually passing a string as input.

  • AartiG said:
    CCS Expressions view defaults to decimal number format but you can set any of the value to a different format like hex by right-clicking on the variable and selecting Number Format. That is likely what happened to some of the array elements.

    Yet the input was not decimal integer it was all Hexadecimal, so the CCS debug behavior is incorrect and very questionable. I get we can change individual lines to display though very ambiguous behavior to say the least. And the entire debug single step F5/F6 incorrectly shows 'A' decimal 65 as the stored variable when it should be 0x41 prior to decimal conversion, clearly hexadecimal 0x41 not decimal integers. It's clearly incorrect debug behavior since it defies the word debug by definition and confuses the engineer as to what on Earth is going on here.

    AartiG said:
    I'm not clear what your code is intended to achieve. Are you trying to get the length of a string using strlen? It appears you are not actually passing a string as input.

    The debug byte was hexVal 0x03 and it should have been a NUL terminated binary string hex convert to decimal.  So a byte is obviously still considered a string and '\0' counts as two bytes, not one. This issue was related to CCS editor ghosting code lines, in the final HexToBin output the object was missing but present in the editor when compiled. That was making all the conversions of above posted hex input on left debug view become mangled when stored into parameter variables.