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

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

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

1,425 Views
diegocolombo
Contributor IV

Hi,i'm trying to erase a Flash sector on FRDM-KL25Z Freedom board using IntFlahs Bean.From the data sheet:

27.1.1.1 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

MyFlash_DisableEvent();

temp=MyFlash_EraseSector(0x18000);

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?

Thanks

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

MEMORY {

  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

}

SECTIONS

{

  /* 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

Tags (3)
3 Replies

639 Views
Petr_H
NXP Employee
NXP Employee

Hi,

Could you please provide us a simple project reproducing the problem ?

Please write also more details on what version of CodeWarrior or Procesor Expert Driver suite are you using.

Best regards

Petr Hradsky

Processor Expert Support Team

639 Views
diegocolombo
Contributor IV

Thanks Petr

I apologize for being so late in replying

I should set my account settings so to be warned by email when i receive a reply to a post.

Codewarrior is 10.5,i dont know how to retrieve the PE driver infos

The problem disappeared suddenly,i think it was related to the change of SDA in the demo board.

When i had the problem a J-Link emulator was loaded,then i changed it with Open SDA and everything worked fine.

Maybe some setting in the programming task??

Thanks again

Diego

0 Kudos
Reply

639 Views
perlam_i_au
Senior Contributor I

May be it could be caused because when you have loaded the J-link emulator you did not set connection with J-link instead of defualt OpenSDA.

This is all I can say about it, if you could share more information regard your process to load J-link I will be glad to check in order to determine which could be the problem.


Have a nice day,
Perla Moncada

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

0 Kudos
Reply