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.

TMS320F2800156-Q1: Flash erase and write without Fapi_initializeAPI() function

Part Number: TMS320F2800156-Q1

Hi

I'm using F280015x 's FlashAPI lib for bootloader development.

I find that without Fapi_initializeAPI() function before flash erase and write, the flash operation will be successful  with no error.

It differs with the statement in the <Reference Guide TMS320F280013x/15x Flash API Version 2.00.10.00>. [$3.1.1 This function is required to initialize the Flash API before any other Flash API operation is performed. This function must also be called if the System frequency or RWAIT is changed.]

Does the Fapi_initializeAPI have the default setting para. when we don't perform this function?

Like the address and frequency? [By device setting ,we use 100MHz]

(void) Fapi_initializeAPI(FlashTech_CPU0_BASE_ADDRESS,
                                      DEVICE_SYSCLK_FREQ/1000000U)

Regards

Arrow

  • This is an important initialization API and it may just so happen that your operations work out without using this API, but we recommend using it.

    This API

    - writes Flash trims (but I checked and found that this is also done in Flash_initModule() which is done in device_init() prior to Fapi_initializeAPI())

    - checks whether the right Flash read wait-states are correctly set based on the SYSCLK value (this is done by Flash_setWaitstates() in Flash_initModule())

    - configures KDIV and CFGCMD.WAITSTATE based on the input SYSCLK frequency

    Thanks,

    Sira

  • Hi, Sira

    1. Do you mean that there are some same functions between Fapi_initializeAPI() and Flash_initModule()?

    2. By the way , does normal program have the same configuration for KDIV  and CFGCMD.WAITSTATE without Fapi_initializeAPI()?

    - configures KDIV and CFGCMD.WAITSTATE based on the input SYSCLK frequency

    3. So dou you think  it is needed or not to use Fapi_initializeAPI()  if  we set Flash_initModule() first ? For now , we are confused with the discription between the manual showing and what we tested.

    Regards

    Arrow

  • Hello Arrow,

    1. Yes, the flash trims are locked and committed and the flash waitstates are set in both Flash_initModule and Fapi_initializeAPI.

    2. No, the Fapi_initializeAPI must configure these registers according to your SYSCLK frequency.

    3. You call Flash_initModule first, followed by Fapi_initializeAPI.

    For proper Flash API usage examples, you can reference the flash programming examples for this device.

    Best,
    Alex