Problems with UART with interrupts and FLASH on S08mm32

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Problems with UART with interrupts and FLASH on S08mm32

728 Views
Spikey_Mikey
Contributor II

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?

pastedImage_1.png

pastedImage_2.png

pastedImage_3.png

Let me know if there is more information I can offer.

Thanks!

0 Kudos
3 Replies

500 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

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

0 Kudos

500 Views
Spikey_Mikey
Contributor II

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

0 Kudos

500 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

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

0 Kudos