Problems with UART with interrupts and FLASH on S08mm32

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Problems with UART with interrupts and FLASH on S08mm32

1,652件の閲覧回数
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!

タグ(3)
0 件の賞賛
返信
3 返答(返信)

1,424件の閲覧回数
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 件の賞賛
返信

1,424件の閲覧回数
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 件の賞賛
返信

1,424件の閲覧回数
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 件の賞賛
返信