cancel
Showing results for 
Search instead for 
Did you mean: 

Flash Erase for SPC58NG84E7 is not working

AVM
Associate III

Hello,

I am working on the bootloader, trying to flash only 256 bytes. So, before flashing, erasing the block 0xFF0000. There is already some data in this block. But erase is not happenin, even if FlashErase() returns 0 and FlashCheckStatus() also gives opResult=0. Also when I check memory, it still shows the same data and not erased.

Following below steps to get flash block erased-

#define LOWBLOCKSELECT 0x00000100U

#define MIDBLOCKSELECT 0x00000000U

#define HIGHBLOCKSELECT 0x00000000U

/* Unlock the requested block for Erase operation */
nLargeBlockSelect.firstLargeBlockSelect = 0;
nLargeBlockSelect.secondLargeBlockSelect = 0;
SetLock(&FLSHM_ssdConfig, C55_BLOCK_LOW, UNLOCK_ALL_BLOCKS);
 
irqIsrDisable();
 
/* Erase the requested block */
Return_Val = FlashErase(&FLSHM_ssdConfig, C55_ERASE_MAIN, LOWBLOCKSELECT, MIDBLOCKSELECT, HIGHBLOCKSELECT, nLargeBlockSelect);
if(Return_Val == C55_OK)
{
while(C55_INPROGRESS == FlashCheckStatus(&FLSHM_ssdConfig, 
C55_MODE_OP_ERASE, &opResult, &FLSHM_eraseCtxData))
{}
/* Erase is in progress */
}
else
{
/* Erase failed */
}
 
irqIsrEnable();

Configuration for flash is as follows -

SSD_CONFIG FLSHM_ssdConfig = {
C55_REG_BASE, /* C55 control register base */
MAIN_ARRAY_BASE, /* base of main array */
{ 0, 0, 0 }, /* blocks info of low address space */
{ 0, 0, 0 }, /* blocks info of mid address space */
{ 0, 0, 0 }, /* blocks info of high address space */
0, /* number of blocks in 256K address space */
UTEST_ARRAY_BASE, /* base of UTEST array */
TRUE, /* interface flag indicate main or alternate interface */
256U,/* programmable size */
FALSE /* debug mode selection */
};

0693W00000JNFt8QAH.png 

What could be the issue here?

Regards,

AM

23 REPLIES 23
ODOUV.1
ST Employee

Good morning,

Thank you for your comments.

I asked for support from R&D,

you should have an answer this week.

Best Regards,

-Olivier

AVM
Associate III

Hi Olivier,

Good morning!

Thanks for the update.

One more heads up, as mentioned earlier, this flash erase is part of my bootloader code and I would prefer to execute it from Flash memory itself(instead of Load in RAM).

Awaiting to get this resolved soon.

Warm Regards,

AM

ODOUV.1
ST Employee

Hello,

R&D had no time to provide an analysis for this issue this week.

I hope they could next one.

Best Regards,

-Olivier

Giovanni CUCE
Associate II

hello,

It seems you are using an older version of this SSD (Standard Software Driver). Could you please download the new one (SPC58xEC-FLASH-0.2.2) and let me know? At the moment this new version is available only on TeamSpaces.

I confirm also the max PROGRAMMABLE_SIZE is 0x80.

BR,

Giovanni