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.

Fapi_issueProgrammingCommand() FUnction in F021 Flash API



Hello John,

In the

Fapi_issueProgrammingCommand() function, the parameter

pu32StartAddress

is a pointer to 32-Bit DATA.

But in the description of the function, it says that only 1 byte also can be programmed.

Hence,  pu32StartAddress should be a BYTE Pointer.

Can you please confirm whether pu32StartAddres must always be a 32-Bit DATA Pointer?

If yes, then how can 1 Byte at any boundary/alignment be programmedd?

Please help,

Thank you.

Regards

Pashan

 

  • Pashan,

    Although pu32StartAddres is defined as a integer pointer, you can still pass a byte address to it to program a byte location. For example, you can use the following call to program a byte to address 0x03 using the data at address 0x08000500.

    Fapi_issueProgrammingCommand((unsigned int *)0x3,
                                         (unsigned char *)0x08000500,
                                         (unsigned long) 1,
                                         0,
                                         0,
                                         Fapi_DataOnly);

    If you want to use Fapi_AutoEccGeneration option, the data size to be programmed has to be either 8 or 16 bytes because ECC is calculated on 64bit (8 bytes) basis.

    Please let know if the above suggestion works for you.

    Thanks and regards,

    Zhaohong