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.

Compiler/TMS570LS0714: how to assign the Const with detail address.

Part Number: TMS570LS0714
Other Parts Discussed in Thread: TEST2

Tool/software: TI C/C++ Compiler

Hi Champ,

If customer  define a const like below,

const uint16_t test1 = 0x1234;

and used this const  in the code like below way.

uint16_t test2;

test2 = test1;

But after build, we cannot found test1 in .const section in the map file.

My customer need to do calibration  and need the const with detail address.

Could you advise the way?

Thanks!

 

  • With TI compiler v20.2.1 I found that declaring test1 as volatile makes it's address appear in the map file.

    I.e. in the code:

    const volatile uint16_t test1 = 0x1234;

    And in the map file:

    GLOBAL SYMBOLS: SORTED BY Symbol Address 
    
    address   name                          
    -------   ----   
    
    00000120  test2                         
    00000124  test1                         

  • Hi Chester,

    May i know for old version compiler, any workaround?

    Does it means start from v20.2.1 the const with address will be supported>

  • Huihuang Chen said:
    May i know for old version compiler, any workaround?

    I don't have the details to check if the behaviour has changed over compiler versions.

    Looking with some other compiler versions:

    • v18.1.5 still shows test1 in the map file when used const volatile uint16_t
    • v16.9.9 still shows test1 in the map file when used const volatile uint16_t

    Perhaps you can ask George Mock for a more definitive answer.