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.

TPS65987EVM: Unable to udate Region 0 Offset (AOFF0) and Region 1 Offset (AOFF1) on SPI ROM

Part Number: TPS65987EVM

Hello Team,

I am struggling to update Region pointer oFFSET address in SPI Flash attached onboard with TPS65987EVM

I am preparing a program to flash SPI as it is our requirement in fresh production board where we are going to flash SPI ROM from Host I2C via TPS65987.

As you can see the image I am trying to update Region Pointer address and offset.

But the same procedure which I am using to update address 0x00 and 0x1000 is not working for address 0xFFC and 0x1FFC

Due to this I am not able to point the Configuration stream address.

I have tried flashing in 64Bytes in sinle go by update Bit[60] Bit[61] Bit[62] and Bit[63] -> not working

I have tried to write 4096Bytes 4KB using loop after passing Regionpointer address location i.e. 0x00 and 0x1000 but it also didn't work.

Let me know if there is any constraint to update Region pointer offset or any special procedure required?

Look mycode snippet

None of the Methid are working

#######################################################################################

Method 1

#######################################################################################

bool addressUpdate()
{
bool result = 0;
//Writing full array of 4096 bytes For region 0
i2cDataFLemIn[0] = rgnPntr1Loc[0]; //rgnPntr1Loc[2] = {0x0, 0x1000};
i2cDataFLemIn[1] = rgnPntr1Loc[0] >>8;
i2cDataFLemIn[2] = rgnPntr1Loc[0] >>16;
i2cDataFLemIn[3] = rgnPntr1Loc[0] >>24;
i2cDataFLemIn[4] = 1;
fourCCerror = fourCC_Command(FLem, (uint8_t *)&i2cDataFLemIn);
DelayInMilliseconds(1000); //Wait for 1 seconds to read UART Stream in Putty terminal

// Set Address 0x00
fourCCerror = fourCC_Command(FLad, (uint8_t *)&rgnPntr1Loc[0]);
DelayInMilliseconds(1000); //Wait for 1 seconds to read UART Stream in Putty terminal
count8bit = 0;
bytesCount = 0;

for (count32bit = 0; count32bit < 64; count32bit++)
{
initCountUpDwn64((bool *) &count8bit, &bytesCount);
//Write DATA in 64 Bytes chunks
fourCCerror = fourCC_Command(FLwd, (uint8_t *)&i2cFlashData);
bytesCount = 64 * (count32bit+1);

count8bit += 1;
if (count8bit == 63)
{
UARTprintf("4kByte Block Written\n");
count8bit = 0;
}
}

/////////////////////////////////////////////////////////
//Region Pointers address completed for Region0

But offset is not update
/////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////
//Region Pointers address update start for Region1
/////////////////////////////////////////////////////////
Same code as above
#######################################################################################
#######################################################################################


#######################################################################################

Method 2

#######################################################################################

//Another method used to write only 64 bytes at time
i2cDataFLemIn[0] = rgnPntr2Loc[0]; //rgnPntr2Loc[2] = {(0x1000-0x40), (0x2000-0x40)};
i2cDataFLemIn[1] = rgnPntr2Loc[0] >>8;
i2cDataFLemIn[2] = rgnPntr2Loc[0] >>16;
i2cDataFLemIn[3] = rgnPntr2Loc[0] >>24;
i2cDataFLemIn[4] = 1;
//Erase Region0/1 Pointers in Data by Erasing 1 4kByte sector;
fourCCerror = fourCC_Command(FLem, (uint8_t *)&i2cDataFLemIn);
DelayInMilliseconds(1000); 

//Set location 0xFC0
fourCCerror = fourCC_Command(FLad, (uint8_t *)&rgnPntr2Loc[0]);
init64ByteDataFF();
i2cFlashData[60] = 0x00;
i2cFlashData[61] = 0x00;
i2cFlashData[62] = 0x00;
i2cFlashData[63] = 0x00;

fourCCerror = fourCC_Command(FLwd, (uint8_t *)&i2cFlashData);
DelayInMilliseconds(1000); //Wait for 1 seconds to read UART Stream in Putty terminal
#######################################################################################

No success, unable to update 0xffc, 0xffd, 0xffe, 0xff

and also not able to update SPI ROM location

0x1ffc, 0x1ffd, 0x1ffe, 0x1ff
#######################################################################################

  • Attachng log file to understanding flow01-29-March-2022.txt

  • Hello,

    Our team member will get back to you soon.

    Regards,

    Tommy

  • Hello Tommy,

    I think I found the issue. But looking for solution how to over come.

    I found that when I am passing 64 Bytes of data to INData and run FLwd, it is only wrirting 32 Bytes in the SPI flash memory. Rest 32Bytes get missed.

    As per procedure i run 

    - FLem

    - FLad

    Input INData with 64Bytes

    - FLwd.

    Now when I observe my SPI memory it shows only 32Bytes of data

    Actual Array passed to INData

    Now after reading flash I get only this

    Find the log for the same

    =============================================================
    PatchHeaderErr (Bit 0): 0
    DeadBatteryFlag (Bit 2): 0
    SpiFlashPresent (Bit 3): 1
    Region0 Attempted (Bit 4): 1
    Region1 Attempted (Bit 5): 1
    Region0Invalid (Bit 6): 1
    Region1Invalid (Bit 7): 1
    Region0FlashErr (Bit 8): 0
    Region1FlashErr (Bit 9): 0
    PatchDownloadErr (Bit 10): 0
    Region0CrcFail (Bit 12): 0
    Region1CrcFail (Bit 13): 0
    CustomerOtpInvalid (Bit 14): 0
    IIC Read Regadrs = 0x28
    Byte[0]=0x0b Byte[1]=0x10
    ^K^P
    Data written on Regadrs = 0x28
    Byte[0] = 0x0b Byte[1] = 0x10
    Byte[0] = ^K Byte[1] = ^P

    RegionP0 Start
    RegionP0 Start point
    FLem 0=0x00 1=0x20 2=0x00 3=0x00 4=0x01
    Data written on Regadrs = 0x09
    Byte[0] = 0x00 Byte[1] = 0x20 Byte[2] = 0x00 Byte[3] = 0x00 Byte[4] = 0x01
    Byte[0] = ^@ Byte[1] = Byte[2] = ^@ Byte[3] = ^@ Byte[4] = ^A
    Data written on Regadrs = 0x08
    Byte[0] = 0x46 Byte[1] = 0x4c Byte[2] = 0x65 Byte[3] = 0x6d
    Byte[0] = F Byte[1] = L Byte[2] = e Byte[3] = m
    IIC Read Regadrs = 0x08
    Byte[0]=0x46 Byte[1]=0x4c Byte[2]=0x65 Byte[3]=0x6d
    FLem
    IIC Read Regadrs = 0x08
    Byte[0]=0x46 Byte[1]=0x4c Byte[2]=0x65 Byte[3]=0x6d
    FLem
    .......

    IIC Read Regadrs = 0x08
    Byte[0]=0x46 Byte[1]=0x4c Byte[2]=0x65 Byte[3]=0x6d
    FLem
    IIC Read Regadrs = 0x08
    Byte[0]=0x00 Byte[1]=0x00 Byte[2]=0x00 Byte[3]=0x00

    IIC Read Regadrs = 0x09
    Byte[0]=0x00 Byte[1]=0x20 Byte[2]=0x00 Byte[3]=0x00 //0x2000

    Data written on Regadrs = 0x09
    Byte[0] = 0x00 Byte[1] = 0x20 Byte[2] = 0x00 Byte[3] = 0x00
    Byte[0] = ^@ Byte[1] = Byte[2] = ^@ Byte[3] = ^@
    Data written on Regadrs = 0x08
    Byte[0] = 0x46 Byte[1] = 0x4c Byte[2] = 0x61 Byte[3] = 0x64
    Byte[0] = F Byte[1] = L Byte[2] = a Byte[3] = d
    IIC Read Regadrs = 0x08
    Byte[0]=0x46 Byte[1]=0x4c Byte[2]=0x61 Byte[3]=0x64
    FLad
    IIC Read Regadrs = 0x08
    Byte[0]=0x00 Byte[1]=0x00 Byte[2]=0x00 Byte[3]=0x00

    IIC Read Regadrs = 0x09
    Byte[0]=0x00 Byte[1]=0x20 Byte[2]=0x00 Byte[3]=0x00


    Data written on Regadrs = 0x09
    Byte[0] = 0x48 Byte[1] = 0x65 Byte[2] = 0x6c Byte[3] = 0x6c Byte[4] = 0x6f Byte[5] = 0x20 Byte[6] = 0x74 Byte[7] = 0x68 Byte[8] = 0x69 Byte[9] = 0x73 Byte[10] = 0x20 Byte[11] = 0x69 Byte[12] = 0x73 Byte[13] = 0x20 Byte[14] = 0x5f Byte[15] = 0x31 Byte[16] = 0x57 Byte[17] = 0x68 Byte[18] = 0x6f Byte[19] = 0x20 Byte[20] = 0x61 Byte[21] = 0x72 Byte[22] = 0x65 Byte[23] = 0x20 Byte[24] = 0x79 Byte[25] = 0x6f Byte[26] = 0x75 Byte[27] = 0x20 Byte[28] = 0x77 Byte[29] = 0x68 Byte[30] = 0x61 Byte[31] = 0x74 Byte[32] = 0x49 Byte[33] = 0x20 Byte[34] = 0x61 Byte[35] = 0x6d Byte[36] = 0x20 Byte[37] = 0x47 Byte[38] = 0x69 Byte[39] = 0x72 Byte[40] = 0x69 Byte[41] = 0x73 Byte[42] = 0x68 Byte[43] = 0x20 Byte[44] = 0x70 Byte[45] = 0x6c Byte[46] = 0x61 Byte[47] = 0x79 Byte[48] = 0x66 Byte[49] = 0x6f Byte[50] = 0x72 Byte[51] = 0x20 Byte[52] = 0x56 Byte[53] = 0x50 Byte[54] = 0x4c Byte[55] = 0x2c Byte[56] = 0x20 Byte[57] = 0x6d Byte[58] = 0x61 Byte[59] = 0x74 Byte[60] = 0x63 Byte[61] = 0x68 Byte[62] = 0x20 Byte[63] = 0x77

    Data written on Regadrs = 0x08
    Byte[0] = 0x46 Byte[1] = 0x4c Byte[2] = 0x77 Byte[3] = 0x64
    Byte[0] = F Byte[1] = L Byte[2] = w Byte[3] = d
    IIC Read Regadrs = 0x08
    Byte[0]=0x46 Byte[1]=0x4c Byte[2]=0x77 Byte[3]=0x64
    FLwd
    IIC Read Regadrs = 0x08
    Byte[0]=0x00 Byte[1]=0x00 Byte[2]=0x00 Byte[3]=0x00

    IIC Read Regadrs = 0x09
    Byte[0]=0x00 Byte[1]=0x65 Byte[2]=0x6c Byte[3]=0x6c

    Data written on Regadrs = 0x09
    Byte[0] = 0x00 Byte[1] = 0x00 Byte[2] = 0x00 Byte[3] = 0x00
    Data written on Regadrs = 0x08
    Byte[0] = 0x47 Byte[1] = 0x41 Byte[2] = 0x49 Byte[3] = 0x44
    Byte[0] = G Byte[1] = A Byte[2] = I Byte[3] = D
    IIC Read Regadrs = 0x08
    Byte[0]=0x47 Byte[1]=0x41 Byte[2]=0x49 Byte[3]=0x44
    GAID

    =============================================================

    Thanks

    Girish

  • Hi,

    After adjusting Indata[] fill loop to only fetch 32Bytes from array while rest of the process is same I am able to update region pointers and location + configurartion data.

    Only I have to run loop 2 times for the actual size of configuaration data.

    Thanks

    Girish