Cart New Account Login

HomeAbout usProductsSupportForumsBlogCustomer Service

Please accept the use of cookies on our site

At PEmicro we use web browser cookies in order to provide you with an enhanced experience and in order to be able to do things like shopping cart processing and identify you when you login to our website.

Click here to accept

search inside this forum
search inside all forums
need to perform "real" Mass Erase on Kinetis
Renè M. Jan 19, 2015 at 04:58 AM (04:58 hours)
Staff: Takao Y.

  • Good morning,
    I need to perform a real mass erase to kinetis MK22dx256.
    I must erase also the IFR registers (I need to change the flash partition registers).
    I'm currently using the flash programming algorithm: freescale_k22dx256m5_pflash_dflash_eeprom.arp
    How can I modify this file in order to obtain a complete mass erase of the device?
    Thanks in advance,


  • Greetings,

    Could you tell me which software you are using? Are you using Codewarrior or KDS, or P&E software, or other? This is important because this involves both algorithm and software implementation to do a mass erase correctly.

    Also, if you could detail us more information like which P&E interface you are using and its revision that would be helpful as well.

    Takao Yamada

  • Good morning,
    I'm using Progacmp ( with multilink universal.
    Thanks alot,

  • Greetings,

    The algorithm you have mentioned does a mass erase when you execute any erase commands.

    Have you taken a look at the "PA" command for Partitioning? When you load the algorithm, look for this command. Set up the EE and Dflash partition, then use the EM command afterwards to execute the partition.

    Could you tell me where I can find the IFR register? I cannot find it in the reference manual.

    Takao Yamada

  • Greetings,
    in the algorithm: "freescale_k22dx256m5_pflash_dflash_eeprom.arp" part of the code is:

    DO_MASS_ERASE_AND_RESET ;Perform MDM Mass erase
    ;PRESERVE_PARTITION ;Preserve Partition through erase
    WRITE_LONG=00FF003F/4001F000/ ;Disable Master0..2 prefetching
    WRITE_LONG=30020000/4001F004/ ;Disable Cache and Prefetching on Flash Bank 0
    WRITE_LONG=30020000/4001F008/ ;Disable Cache and Prefetching on Flash Bank 1
    WRITE_LONG=FFFFFFFF/40020010/ ;All PFlash protection off
    WRITE_WORD=FFFF/40020016/ ;All DFlash and EEPROM protection off

    as you can see, I have put a semicolon on PRESERVE_PARTITION.

    WITHOUT semicolon the EM command DO NOT ERASE the partition Bytes.
    WITH semicolon the EM command ERASES also the partition Bytes.

    Is it correct?

  • Greetings,

    Yes, you can also put a semicolon on the preserve partition line as well. But the danger with this is it will now always mass erase and you will have to partition the flash each time.

    My method was to load the algorithm without any change and to use the PA command that shows up in PROG software. This is where you specify the EEPROM and DFlash partition bits and erase the flash to execute it.

    Takao Yamada

  • Excellent, now everything is clear.
    Thanks a lot,

Add comment

   Want to comment? Please login or create a new PEMicro account.

© 2018 P&E Microcomputer Systems Inc.
Website Terms of Use and Sales Agreement