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.

TMS320F28388D: Possible bug in cm flash driverlib.

Part Number: TMS320F28388D
Other Parts Discussed in Thread: C2000WARE

Hello,

I stumbled upon the following code in flash.h (driverlib/2838x/driverlib_cm).

#ifdef __cplusplus
#pragma CODE_SECTION(".TI.ramfunc");
#endif
static inline void
Flash_setWaitstates(uint32_t ctrlBase, uint16_t waitstates)
{
//
// Check the arguments.
//
ASSERT(Flash_isCtrlBaseValid(ctrlBase));

//
// waitstates is 4 bits wide.
//
ASSERT(waitstates <= 0xFU);
//
// Write flash read wait-state amount to appropriate register.
//
}

It seems to me the actual write to the register is missing here.. When I check version 4.01.000 of c2000 ware. The register is actually written. With the following:

    HWREG(ctrlBase + FLASH_O_FRDCNTL) =
        (HWREG(ctrlBase + FLASH_O_FRDCNTL) &
         ~(uint32_t)FLASH_FRDCNTL_RWAIT_M) |
         ((uint32_t)waitstates << FLASH_FRDCNTL_RWAIT_S);

  • Hello Frank,

    Thanks for sharing this. I see the same, so I am filing this bug to our software team. Hopefully should be fixed in the next C2000Ware release.

    The code statement above should work in place (as a temporary solution).

    Best regards,
    Ibukun