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.

MSPM0G3519-Q1: MSPM0G3519-Q1, MCAL_MSPM0_00.02.05.00: MemMap sections

Part Number: MSPM0G3519-Q1

Hello TI team,

we are using MCAL_MSPM0_00.02.05.00 and found several constants/variables that are mapped to wrong MemMap section:

Cdd_I2c_Cfg.c: 
CONST(uint32,CDD_I2C_CONST)CddI2cHwUnitBaseAddr[CDD_I2C_HW_UNITS_MAX] is a const, but mapped to VAR_INIT_32 section.

Can_Cfg.c:
const struct Can_ControllerStruct_PC *CanConfigSet_CanController_List_PC[CAN_NUM_CONTROLLER] is a const, but mapped to CFG_DATA_INIT.
const struct Can_MailboxStruct_PC *CanConfigSet_CanHardwareObject_List_PC[CAN_NUM_MAILBOXES] is a const, but mapped to CFG_DATA_INIT.

Can_Mcan.c:
static const uint8 Can_McanDataSize[16] = {0U,  1U,  2U,  3U,

                                        4U, 5U,  6U, 7U,
                                        8U, 12U, 16U, 20U,
                                        24U, 32U, 48U, 64U};
is a const, but mapped to VAR_INIT_8.
 
mcan.c:
static const uint32 Can_DataSize[16]  = {0,  1,  2,  3,  4,  5,  6, 7, 8,
                                        12, 16, 20, 24, 32, 48, 64}; and
static const uint32 Can_MsgObjSize[8] = {4, 5, 6, 7, 8, 10, 14, 18};
are const, but mapped to VAR_INIT_32.
 
Best regards
Markus
  • Hi,  

    Could you please check the 0.9 version Mcal?

    Same access link of 2.05.

    We have notice this issue before, can please check the latest package.

  • I checked already the static files from version 0.9.

    Can_Mcan.c: Same as in 0.2.5.

    mcan.c: Same as in 0.2.5.

    The generated files I can check once I have integrated the version 0.9. Please check it on your side as well.

  • OK, thanks for your feedback.

    I need some times to check your list when compile them.

  • By compiling the 00.09.00.00 example:

    cdd_i2c_app and can_app

    I found below address of your reported variable:

    Cdd_I2c_Cfg.c: 
    CONST(uint32,CDD_I2C_CONST)CddI2cHwUnitBaseAddr[CDD_I2C_HW_UNITS_MAX] is a const, but mapped to VAR_INIT_32 section.

    0000851c  CddI2cHwUnitBaseAddr   

    Can_Cfg.c:
    const struct Can_ControllerStruct_PC *CanConfigSet_CanController_List_PC[CAN_NUM_CONTROLLER] is a const, but mapped to CFG_DATA_INIT.
    const struct Can_MailboxStruct_PC *CanConfigSet_CanHardwareObject_List_PC[CAN_NUM_MAILBOXES] is a const, but mapped to CFG_DATA_INIT.

    20206c98  CanConfigSet_CanController_List_PC     

    20206ca0  CanConfigSet_CanHardwareObject_List_PC   

    Can_Mcan.c:
    static const uint8 Can_McanDataSize[16] = {0U,  1U,  2U,  3U,

                                            4U, 5U,  6U, 7U,
                                            8U, 12U, 16U, 20U,
                                            24U, 32U, 48U, 64U};
    is a const, but mapped to VAR_INIT_8.

                      0000f0d9    00000010     can.aem0plus : Can_Mcan.oem0plus (.rodata.Can_McanDataSize)

    mcan.c:
    static const uint32 Can_DataSize[16]  = {0,  1,  2,  3,  4,  5,  6, 7, 8,
                                            12, 16, 20, 24, 32, 48, 64}; and
    static const uint32 Can_MsgObjSize[8] = {4, 5, 6, 7, 8, 10, 14, 18};
    are const, but mapped to VAR_INIT_32.

                      0000ed64    00000040                  : mcan.oem0plus (.rodata.Can_DataSize)

                      0000ef34    00000020     can.aem0plus : mcan.oem0plus (.rodata.Can_MsgObjSize)

    Now, All variables except [CanConfigSet_CanController_List_PC] and [CanConfigSet_CanHardwareObject_List_PC] are in Flash.

    Given the purpose of these two variables, storing them in RAM is appropriate.

  • I think you did not get my point. Let me explain it on one example.

    Here you can see the two constants Can_DataSize and Can_MsgObjSize. These are obviously constants (static const uint32 ...).

    But they are mapped to a section for variables: #define CAN_START_SEC_VAR_INIT_32. Instead the define shall be something like this: #define CAN_START_SEC_CONST_32. Because these are constants and no variables.

  • Haaa...

    Thanks for mention me again.

    Issue confirmed. This should be an source issue.

  • Summary of the variables that not put into correct section:

    1. Can_Mcan.c: Can_McanDataSize

    2. mcan.c: Can_DataSize and Can_MsgObjSize

  • Cdd_I2c_Cfg.c: 
    CONST(uint32,CDD_I2C_CONST)CddI2cHwUnitBaseAddr[CDD_I2C_HW_UNITS_MAX] is a const, but mapped to VAR_INIT_32 section.

    Can_Cfg.c:
    const struct Can_ControllerStruct_PC *CanConfigSet_CanController_List_PC[CAN_NUM_CONTROLLER] is a const, but mapped to CFG_DATA_INIT.
    const struct Can_MailboxStruct_PC *CanConfigSet_CanHardwareObject_List_PC[CAN_NUM_MAILBOXES] is a const, but mapped to CFG_DATA_INIT.

    These constants shall be checked as well. These are in generated files and with MCAL_MSPM0_00.02.05.00 the memory mapping is wrong. I have not checked it with MCAL_MSPM0_00.09.00.00, but it shall be considered for the next release if not already done in MCAL_MSPM0_00.09.00.00.

  • Hi, I check the below item:

    #define CDD_I2C_START_SEC_CFG_CONST_DATA
    CddI2cHwUnitBaseAddr
    #define CDD_I2C_STOP_SEC_CFG_CONST_DATA
    I think there is no issue for CddI2cHwUnitBaseAddr in 00.09.00.00
    And for these two:
    CanConfigSet_CanController_List_PC
    CanConfigSet_CanHardwareObject_List_PC
    Need further check why add const for them.