AnsweredAssumed Answered

Can't erase Flash sector on KL25Z,but ERROR_OK'

Question asked by Diego Colombo on Mar 24, 2014
Latest reply on Apr 28, 2014 by Perla Andrea Moncada Fajardo

Hi,i'm trying to erase a Flash sector on FRDM-KL25Z Freedom board using IntFlahs Bean.From the data sheet: Program Flash Memory Features  • Sector size of 1 Kbyte


I've prepared 3 sectors in Flash for store my code data,and i'have limited the code area to 64KB,then i've initialized some bytes in the 3 sectors

unsigned char __attribute__((section (".ParametersSection1"))) ParametersFlash1[512]={'S','e','c','1'};
unsigned char __attribute__((section (".ParametersSection2"))) ParametersFlash2[512]={'S','e','c','2'};
unsigned char __attribute__((section (".ParametersSection3"))) ParametersFlash3[512]={'S','e','c','3'};

i can verify that after programming the characters do appear in the memory modules

then i inserted the IntFlash Bean,naming it MyFlash,and in a point  of my code i call




I expect to see the sector  0x18000 - 0x183FF erased and full of  0xFF 0xFF...but it remains unchanged .

Probably it is not so simple and something is missing or i am completely wrong.

All the example i found are using a bean cold "Flash" instead of "IntFlash"

Can i have your help?





from ProcessorExpert.ld file(prepared with PE,then i disabled the linker code generation)


  m_interrupts (RX) : ORIGIN = 0x00000000, LENGTH = 0x000000C0

  m_text      (RX) : ORIGIN = 0x00000410, LENGTH = 0x00010000

  m_data      (RW) : ORIGIN = 0x1FFFF000, LENGTH = 0x00004000

  Parameters_sector1 (RWX) : ORIGIN = 0x00018000, LENGTH = 0x00000400

  Parameters_sector2 (RWX) : ORIGIN = 0x00018400, LENGTH = 0x00000400

  Parameters_sector3 (RWX) : ORIGIN = 0x00018800, LENGTH = 0x00000400

  m_cfmprotrom  (RX) : ORIGIN = 0x00000400, LENGTH = 0x00000010




  /* placing my named section at given address: */

  .my_block1 0x18000 :


    KEEP(*(.ParametersSection1)) /* keep my variable even if not referenced */

  } > Parameters_sector1


  /* placing my named section at given address: */

  .my_block2 0x18400 :


    KEEP(*(.ParametersSection2)) /* keep my variable even if not referenced */

  } > Parameters_sector2


  /* placing my named section at given address: */

  .my_block3 0x18800 :


    KEEP(*(.ParametersSection3)) /* keep my variable even if not referenced */

  } > Parameters_sector3