2022-01-20 08:41 PM
Hi, I am working on SPC58NG84E7 bootloader. I have Bootloader code(at 0x00FC0000) with which i am using "FlashErase" API to Erase Flash Memory block at 0x00FF0000 with "-Os size" Optimization But its not working. Also, I tried putting breakpoint to the next line after erase, but breakpoint does not hit. Looks like its stuck in the execution.
I tried all other optimizations as well but same result.
Also, without optimization (NONE(-O0)) its working fine.
Same result is for "FlashProgram" API.
What could be the issue here?
Please help me resolve the issue.
Solved! Go to Solution.
2022-01-31 12:18 AM
Hello,
your parameters are good.
Would you please check it could be the same issue than this one :
Flash Erase for SPC58NG84E7 is not working (st.com)
Best Regards,
-Olivier
2022-01-21 12:21 AM
Hello,
it is certainly same cause than this one:
Best Regards,
-Olivier
2022-01-26 08:17 PM
Hi Oliver,
Thanks for your reply. But that issue is different than what i am facing. It didn't work.
I am getting unhandled exception.
Any other suggestions??
Thanks and Regards
Deepesh
2022-01-27 04:33 AM
Hello Deepesh,
I have no over idea with your optimization level issue.
I will forward your concern to the Flash Driver expert and let you know any feedback.
Best Regards,
-Olivier
2022-01-28 05:13 AM
Hello,
how are you selecting your low block to erase at 0xFF_0000 ?
do you use lowBlockSelect 0x200 ? and other select to 0 ?
BRs,
-Olivier
2022-01-30 07:47 PM
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 */
0x80,/* programmable size */
FALSE /* debug mode selection */
};
Below steps to get flash block erased-
#define LOWBLOCKSELECT 0x00000200U (0x00FF0000)
#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);
/* 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 successful */
}
else
{
/* Erase failed */
}
2022-01-31 12:18 AM
Hello,
your parameters are good.
Would you please check it could be the same issue than this one :
Flash Erase for SPC58NG84E7 is not working (st.com)
Best Regards,
-Olivier
2022-01-31 12:26 AM
Could you try this Load in RAM configuration ? (in SPC58xGxx RLA Platfrom->runtime settings)
BRs,
-Olivier
2022-01-31 12:41 AM
Hi Oliver
Yes Its similar to the issue that I am facing currently.
2022-01-31 12:45 AM
Current solution is to put your program in RAM.
I asked for an analysis from R&D.
I will keep you informed.
Best Regards,
-Olivier