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,
I believe I have found an error in driverlib memcfg file MemCfg_getInitStatus() function.
Suppose I'm initializing all the RAM sections I call MemCfg_initSections and pass 0xFFFFFFFFU and in the switch case within the function before writing to the INIT registers the function first clears MSB using MEMCFG_SECT_NUM_MASK.
case MEMCFG_SECT_TYPE_MASK:
//
// Initialize all sections.
//
HWREG(MEMCFG_BASE + MEMCFG_O_DXINIT) |= MEMCFG_SECT_NUM_MASK &
MEMCFG_SECT_DX_ALL;
HWREG(MEMCFG_BASE + MEMCFG_O_LSXINIT) |= MEMCFG_SECT_NUM_MASK &
MEMCFG_SECT_LSX_ALL;
HWREG(MEMCFG_BASE + MEMCFG_O_GSXINIT) |= MEMCFG_SECT_NUM_MASK &
MEMCFG_SECT_GSX_ALL;
HWREG(MEMCFG_BASE + MEMCFG_O_MSGXINIT) |= MEMCFG_SECT_NUM_MASK &
MEMCFG_SECT_MSGX_ALL;
But when checking the status using the MemCfg_getInitStatus() function the comparison is done directly without the mask
case MEMCFG_SECT_TYPE_MASK:
//
// Return the overall status.
//
if((HWREG(MEMCFG_BASE + MEMCFG_O_DXINITDONE) ==
MEMCFG_SECT_DX_ALL) &&
(HWREG(MEMCFG_BASE + MEMCFG_O_LSXINITDONE) ==
MEMCFG_SECT_LSX_ALL) &&
(HWREG(MEMCFG_BASE + MEMCFG_O_GSXINITDONE) ==
MEMCFG_SECT_GSX_ALL) &&
(HWREG(MEMCFG_BASE + MEMCFG_O_MSGXINITDONE) ==
MEMCFG_SECT_MSGX_ALL))
{
status = MEMCFG_SECT_NUM_MASK;
}
else
{
status = 0U;
}
I believe here also we need to mask out the MSB for comparison if not this will always go to else statements.
Could you please clarify this?
Regards,
Harsha
Harsha,
Your query has been forwarded to an expert, you will get a response soon.
Best Regards
Siddharth
HI Harsha,
Thank you for reporting this. You are correct, we need to use the mask out the initial bits.
I will create a ticket on this issue, to get it updated in the next C2000ware release
Regards,
Veena
Hi Veena,
Thanks for confirming, just one question how do I update this in my driverlib? Oddly I'm able to go to the .c file in one project but I cant in another I always land in .h file.
For now I'm just skipping the MemCfg_getInitStatus() step .
Regards,
Harsha
If you are using driverlib.lib, CCS may not navigate to the .c file. You can do one thing: Add the updated memcfg.c file to your CCS project. The file is available inside driverlib folder.
I believe it is okay to have the function defined in a .c file in the project and in the .lib file. The compiler will pick the one in the .c file.
Regards,
Veena