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.

Register addresses differences in sample code and datasheet on C672x

I've noticed that the register address differs library include code and data sheet of C672x.

for example,  in csl_chip.h (for c672x) register address is described like below,

    /** CGFMCASP0 register*/
    CSL_CHIP_REG_CFGMCASP0        = 0x20000018u,

but, in data sheet SPRS370E  'Table 3-1. Device-Level Configuration Registers'

indicates that the address is 0x4000 0018.

Why is this difference happens?

I think that it uses the image address of the register, the code written while not the document prepared well.

currently, it is not documented (hidden) usage of register.

but, I  worry that side effect of it. (now, and in future devices)

I hope that it make clear this difference officially by TI.

 

  • Hiro,

    You should always assume that the datasheet is correct. If there is a discrepancy with any other document, first you should trust the datasheet.

    In this case, both are correct. If you inspect the lines above the CSL_CHIP_REG_CFGMCASP0 enum definition, you will find the following with the comments as shown here:

    csl_chip.h said:

     * This enumeration contains the list of registers that can be manipulated
     * using the CSL_chipReadReg (..) and CSL_chipWriteReg (..) APIs
     
    typedef enum  {

        /** memory mapped registers with their offset from Base Address*/

        ...,
        /** CGFMCASP0 register*/
        CSL_CHIP_REG_CFGMCASP0        = 0x20000018u,

    You can see that the use of the enum CSL_ChipReg member CSL_CHIP_REG_CFGMCASP0 is for the named APIs CSL_chipReadReg and CSL_chipWriteReg to use as an offset. This offset is from the base address that these functions use, which you can see would be 0x2000 0000 as the base for the chip-level registers. The sum of this base plus the enum offset equals the address you found in the datasheet.

    You will be fortunate and will have no negative side-effects from the use of these values as you have found them.