Hi all,
I'm building my own external tool to flash the MPC5775K with the help of this application note https://www.nxp.com/docs/en/application-note/AN4365.pdf
Most of the things work, but I still have one major issue/problem when using the FlashProgram/FlashCheckStatus function:
When I'm flashing just the programmable size of 0x80 with FlashProgram the process works fine. But if i try to flash the size 0x400 it doesn't work like it should. It's just flashing the size of 0x100 and the return value of the FlashCheckStatus is 0x00000000 instead of C55_INPROGRESS. When I check the CtxData after the FlashCheckStatus it is returning 0xF9C100 (F9C000 is dest address) and also the size is now 0x300, so it stored the correct data there.
I wrote the SRAM start address of the FlashProgramm Driver into pReqCompletionFn of CONTEXT_DATA. Do I have to do anything else?
(When using the CheckStatus function with FlashErase it is working fine and returns C55_INPROGRESS)
This is my code of the Flash Part if it's helping:
/* write address of Flash Program to ctxData->pReqCompletionFn to enable multiple programming of programmable size*/
WriteWord(C55_pReqCompletionFn, C55_Addr_FlashProgram);
returnCode = FlashProgram(&ssdConfig, FALSE, 0x00F9C000, 1024, data2program, &ctxData);
if (returnCode == C55_OK)
{
//Wait until the operation finishes
Would be really grateful for any kind of help there. :smileyhappy:
Regards and thanks in advance
Hi,
I think I found a solution for my problem. If I change this part of my code:
//Wait until the operation finishes
while ((returnCode = FlashCheckStatus(&ssdConfig, C55_MODE_OP_PROGRAM, &opResult, &ctxData)) == C55_INPROGRESS);
to this:
//Wait until the operation finishes
while ((returnCode = FlashCheckStatus(&ssdConfig, C55_MODE_OP_PROGRAM, &opResult, &ctxData)) != C55_DONE);
everything works as expected and I can write multiple programmable size to flash.
After seven cycles of FlashCheck with return code 0x00000000 (=C55_OK) the eight FlashCheckStatus call returns C55_DONE.
-> First 0x80 program with FlashProgram, then seven 0x80 program with FLashCheckstatus equals 0x400 bytes of programmed data.
It would make sense, because the FlashCheckStatus is using the FlashProgram function when there is still data to be programmed (at least as far as i understood this function from manual) and this function has the return value C55_DONE.
Is this possible at all? Because I found nothing about this alternative return value of FlashCheckStatus in the manual for the C55 drivers and also the demo code delivered with the drivers is using the first code line and therefore shouldn't work for multiple programmable size?
Looking forward to your opinion about this
Regards