KV46F256 flash write acces pb when interrupt activated

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

KV46F256 flash write acces pb when interrupt activated

Jump to solution
887 Views
merigotbertrand
Contributor III

Hello Everyone

I've a problem: I am using KV46F256VLL16 on MCUXPRESSO environment

I have to store periodically some parameters in Flash memory.

In a first step, when I disable the interrupt the writing in flash goes well (Erase / VerifyErase / Program / VerifyProgram sequence)

I would like to keep my interrupt activated during the writing.

I build a RAM_vector section as described in the forum

where I already moved interrupt section from FLASH to RAM first => (I always need to inactivate interrupt to make it working well - interrupt running well in RAM )

Secondly, I moved the code of interrupt from FLASH to RAM also => (same result - code running well in RAM but access to flash write not possible with interrupt activated)

(I use read carefully the AN4695 / AN4507)

I still get a boot when I try to pass a flash write command when interrupt are activated - any idea ?

Regards.

1 Solution
814 Views
mjbcswitzerland
Specialist V

Hi

Step through the interrupt(s) that are executed during flashing operations to ensure that no flash access is being performed by them.

- Beware that if they access consts these probably are in Flash and so need to be declared as initialsed variables instead
- You may find that the code calls library routines (eg. for arithmetic operations or even for memory initialisation in subroutines) and these will also need to be located to SRAM or the code modified in order to avoid the use of such calls (eg. GCC sometimes calls memset() to initialise a buffer declared as unsigned char ucBuffer[10] = {0};)

Regards

Mark

Complete Kinetis solutions for professional needs, training and support:http://www.utasker.com/kinetis.html
uTasker: supporting >1'000 registered Kinetis users get products faster and cheaper to market
Request Free emergency remote desk-top consulting at http://www.utasker.com/services.html

View solution in original post

1 Reply
815 Views
mjbcswitzerland
Specialist V

Hi

Step through the interrupt(s) that are executed during flashing operations to ensure that no flash access is being performed by them.

- Beware that if they access consts these probably are in Flash and so need to be declared as initialsed variables instead
- You may find that the code calls library routines (eg. for arithmetic operations or even for memory initialisation in subroutines) and these will also need to be located to SRAM or the code modified in order to avoid the use of such calls (eg. GCC sometimes calls memset() to initialise a buffer declared as unsigned char ucBuffer[10] = {0};)

Regards

Mark

Complete Kinetis solutions for professional needs, training and support:http://www.utasker.com/kinetis.html
uTasker: supporting >1'000 registered Kinetis users get products faster and cheaper to market
Request Free emergency remote desk-top consulting at http://www.utasker.com/services.html