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.

F28M35 - C28 error using Flash API F021

Hello,

I have a problem when trying to write a flash bank row in two different calls to Fapi_issueProgrammingCommand function.

Please find below an example that shows first words of flash sector J:

_____address|___0___1____2____3___4___5____6____7
    D:00108000| 8F00 901A 0006 761F 0247 920E 0006 8F00 
    D:00108008| 9034 0006 8F00 904A 0006 8F00 902A FFFF 

In that case I've just:

  1. Written the first row (0x108000-0x108007) successfully.
  2. Written the first 7 words of 2nd row (0x108008-0x10800E) successfully.
  3. Tried to write last word of 2nd row (0x10800F)

The writing in 3rd step doesn't work. In particular, I get oReturnCheck=Fapi_Status_Success but the word remains still set to 0xFFFF

        oReturnCheck = Fapi_issueProgrammingCommand((uint32 *)u32Index,buffer+i,
                                                                                                           min(8-writeOffset, bSizeRes), //length is calculated in order to not overflow the row
                                                                                                           0,
                                                                                                           0,
                                                                                                           Fapi_AutoEccGeneration);
and when reading FMSTAT register trough 
oFlashStatus = Fapi_getFsmStatus();
i get 0x30 as result, that should mean INVDAT | CSTAT
So, what I'm asking if different parts of a  flash row can be written separately.
Maybe that all ECC bits are already programmed even during first writing?
Thanks in advance.
Lorenzo.
  • Lorenzo,

    You are correct in saying that ECC got programmed when data is programmed in addresses 0x10800C to 0x10800E assuming that data at 0x10800F is 0xFFFF.  This is because of the reason that ECC is calculated for every 64-bits (aligned on a 64-bit memory boundary).  When you program data in to Flash main array along with ECC (here you are using Fapi_AutoEccGeneration), you have to program either 64-bits (aligned on a 64-bit memory boundary) or 128 bits (aligned on a 128-bit memory boundary) using Fapi_issueProgrammingCommand command.  Unprovided data in a 64-bit slice or 128-bit slice will be treated as 0xFFFF.

    Reason INVDAT got set is because when you try to program the address 0x10800F, you are trying to change some bits in the ECC value which are already programmed as 0s.  Your observation is correct that Fapi_issueProgrammingCommand returns success for this.  Fapi_issueProgrammingCommand's return status will not reflect the errors resulted from the program operation.  It only returns the errors that occur while setting up the FSM for the program operation.  Users have to use the Fapi_getFsmStatus() function to check for the errors resulted from program operation.

    Thanks and regards,
    Vamsi