FRDM-K28F pflash sample fails in own project

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

FRDM-K28F pflash sample fails in own project

822 Views
abaur
Contributor I

Hi all,

I am trying to implement a bootloader and therefore want to erase and reprogram flash areas. I ran the frdmk28f_pflash sample and it worked as expected. If I take the same code out of the main method and add it to my own project, the call to FLASH_Erase fails, because callFtfxRunCommand sets the FTFx_FSTAT_ACCERR_MASK flag in the FTFx->FSTAT register.

I tried to find out what the difference are there (preprocessor defines or differences in linker script). I couldn't find anything that seems to be the reason for this different behaviour.

Could anyone please point me in the right direction what I am doing wrong here?

Any help is highly appreciated. Many thanks in advance.

Labels (1)
0 Kudos
1 Reply

574 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Aaron Baur,

    Two points you need to note:

1. Put the flash launch commander function in the RAM

2. Before you do the flash operation, please disable the global interrupt, after you finish the flash operation, you can enable it again.

Please try it on your side.

Wish it helps you!

If you still have question about it, please kindly let me know.


Have a great day,
Kerry

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos