KL26Z board - pflash example and IRQ.

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

KL26Z board - pflash example and IRQ.

1,550 Views
grochal7
Contributor III

Hello,

I have problem with using pflash example and my timer IRQ.

If I initialize and start my timer (pit or lptmr) sth goes wrong. I cant erase flash memory.

Can I use any IRQ and erase flash?

Any solutions?

Regards!

Labels (1)
5 Replies

943 Views
grochal7
Contributor III

Hello,

I'm still looking for the solution. 

Does anybody have any code with irq and flash? Or with relocating IRQ into RAM?

I try change it for my applications.

Regards!

0 Kudos
Reply

943 Views
danielchen
NXP TechSupport
NXP TechSupport

Hi Tomasz:

If an interrupt occurs during a flash erase / program operation, the read while write restriction will be violated if the interrupt service routine code is located in the same flash block as the erase operation is occurring on. so you can disable / enable interrupts before / after the flash command operation. If interrupts are disabled, any interrupt that occurs during the flash operation will be pending when interrupts are re-enabled.

Regards

Daniel

943 Views
grochal7
Contributor III

Hi Daniel,

Thanks for Your response!

Ok i understand it.

But what if i need my irq and cant disable/enable interrupts before/after flash operation?

Is there any solutions?

0 Kudos
Reply

943 Views
danielchen
NXP TechSupport
NXP TechSupport

Hi Tomasz:

I would suggest you refer to the AN4695, this application note discuss important considerations and guidelines for implementing in-software flash programming on Kinetis and Coldfire.

https://www.nxp.com/docs/en/application-note/AN4695.pdf?fsrch=1&sr=1&pageNum=1 

I hope it helps


Have a great day,
Daniel

943 Views
grochal7
Contributor III

Hi Daniel,

I found this:

pastedImage_1.png

So I have to relocate my ISR into RAM.

I found this question:
How to relocate interrupt vector table in MCUXpresso 
there is (I thought) the solution.

I use FRDM KL26Z.

My default settings:

pastedImage_4.png

I set:
pastedImage_12.png

I added in startup file:

pastedImage_16.png

And this in pflash.c file:

pastedImage_8.png

Now i got the same like before. Resets like this:

pastedImage_15.png

What is wrong now? Is there something more?

Regards!

0 Kudos
Reply