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.

F29P329SM-Q1: Some question about FLASH API

Part Number: F29P329SM-Q1

Hi team,

I ask this for my customer.

  1. in our flash api user guide, it says it should call Fapi_getUserConfiguration() to get Flash API configuration, and flash api will use this variable(u32UserFlashConfig) to do more operation

image.png

image.png

but they find even they init this variable to 0, and use this varible in the flash opertaion, the opertion will also successful.

So they want to know what's the function of this variable? 

2. what's more, they have bootloader project and application project, and they want to init flash api before they jump to application from bootloader. Do we have the recommend process to init the flash api?

BRs

Shuqing

  • Hello,

    So they want to know what's the function of this variable? 

    This variable is a bitfield used to tell the Flash API if it is programming the active region or the FOTA region, as well as what core type it is running on. Its default value is 0, which is why the customer's operation is still successful.

    what's more, they have bootloader project and application project, and they want to init flash api before they jump to application from bootloader. Do we have the recommend process to init the flash api?

    The Flash API can be initialized by referring to the programming examples in the F29 SDK (examples/driverlib/single_core/flash) and the F29H85x Flash API User's Guide (Rev. A). As long as the application does not change the CPU frequency, the Flash API does not need to be reinitialized after branching to the application.

    Best,

    Alex

  • Hi Alex,

    after it run the below code in initiation stage, the value of u32UserFlashConfig will change to 16(not 0)

     

    but if we change the u32UserFlashConfig to 0, and use this to do flash operation, the erase/program operation still happen.

    This is not expected, what's the function of u32UserFlashConfig ?

    BRs

    Shuqing

  • Hello,

    Which BANKMODE is the customer's device in? Apologies for the error. The "16" value comes from the FOTAStatus Active_Bank variable.

    This bit is not relevant when using BANKMODEs 0 and 2, which don't support FOTA.

    If in BANKMODE 1 or 3, passing u32UserFlashConfig=0 will program the FOTA region by default, as the bit is not set.

    Best,

    Alex

  • Hi Alex,

    Customer use F29P32 run in BANKMODE0.

    Is u32UserFlashConfig just related to banktype and FOTAStatus?

    Could you tell me all the valid u32UserFlashConfig value and corresponding meaning of these values?

    BRs

    Shuqing

  • Hi Shuqing,

    Is u32UserFlashConfig just related to banktype and FOTAStatus?

    Yes the u32UserFlashConfig is used to get the user configuration.

    u32UserFlashConfig = (uint32_t ) ( (FOTAStatus<<4) | BankType );

    Here FOTAStatus can be can two values, FOTA_Image(value is 0U) and  Active_Bank (value = 1). Banktype can have only one value = C29Bank  (value = 0). So if you are getting u32UserFlashConfig  value as 16, it shows that FOTAStatus is Active_Bank (ie 1<<4). When you make the value as 0 (ie 0<<4), it means FOTAstatus is FOTA image.

     

    Thanks

    Aswin