Flash driver problem with kea 128

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

Flash driver problem with kea 128

743件の閲覧回数
manjunathkm
Contributor III

Dear All,

 

I am using KEA 128 microcontroller with s32 studio IDE. But i am facing problem with FLASH driver when i run continuously without step by step debugging.

 

I have configured bus clock frequency to 20MHZ, and FTMRE_FCLKDIV is configured to 0x13.

When i do step by step debug, I am able to erase and write any number of bytes but if i run at one shot, even the Erase is not working, instead hitting reset handler.

 

I have also attached my project for your reference.

 

Can somebody help me to find out the issue.

 

Regards,

Manjunath

Original Attachment has been moved to: FlashTest.zip

3 返答(返信)

540件の閲覧回数
manjunathkm
Contributor III

I found this working. I was not monitoring the status register for the operation complete, then after it is working fine.

Thanks,

Manjunath

540件の閲覧回数
vignesh_vb_7
Contributor IV

Hi Manjunath,

                       I think you are not checking MGBUSY Flag(Memory controller busy flag) in status register FTMRE_FSTAT, before starting to send a new flash command.

Is that right?

0 件の賞賛

540件の閲覧回数
manjunathkm
Contributor III

Hi Vignesh,

After I added the below part of the code, and its been called on every flash operaiton, it started working fine.

void FLASH_LaunchCMD(uint8_t bWaitComplete)
{
MCM->PLACR |= MCM_PLACR_ESFC_MASK; /* enable stalling flash controller when flash is busy */

FTMRE->FSTAT = 0x80;
if(bWaitComplete)
{
// Wait till command is completed
while (!(FTMRE->FSTAT & FTMRE_FSTAT_CCIF_MASK));
}
}

0 件の賞賛