Aaron Baur

FRDM-K28F pflash sample fails in own project

Discussion created by Aaron Baur on Feb 4, 2019
Latest reply on Mar 3, 2019 by Kerry Zhou

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.