I have a codewarrior 10.7 / processor expert project for the S08mm32. I am using the processor expert beans for the AsynchroSerial using interrupts (because I need to use the buffer) and the IntFLASH. If I have interrupts enabled on the asynchronous serial, writing and reading from flash hangs.the processor. If I don't have interrupts enabled, writing and reading from flash works, but I can't get the asynchronous serial to work (possibly because I can't poll quick enough to service it). How can I get both to work?
Let me know if there is more information I can offer.
Thanks!
Hello Mike,
I'm afraid that S08 flash is not readable while being programmed, and so
you have to disable interrupts when write/erase flash.
There is a same question with yours, you can have a look: https://community.nxp.com/message/931493
I think you can transmit a block of data ,then flash, then transmit a block data, then ...
Hope it helps
Alice
Thanks for pointing me to the other thread. I feel like I covered the issues described there. For example, here is how I do my flash writes:
void HandleFlashWrite(){
byte bErr;
if((gbWriteFlash==1)&&(gbNumberOfFlashBytes<37)){
__DI(); // Disable interrupts
bErr = IFsh1_SetBlockFlash(&gbFlashData[0],gwFlashAddress, gbNumberOfFlashBytes);
gbWriteFlash = 0;
__EI(); // Enable interrupts
}
}
However, I still end up with my code hung every so often. Is there more than just disabling interrupts during flash writing that I need to take care of?
Thanks,
Mike
Hello Mike,
Maybe the flash command is wrong, maybe something else.
You need debug step into to check where it hung ,then check the reason.
BR
Alice