Unable to erase flash HC08

From: js1180 (spastula_at_comcast.net)
Date: 01/28/05

  • Next message: Mike Fields: "Re: water well depth"
    Date: Thu, 27 Jan 2005 21:12:35 -0500
    
    

    I am unable to erase flash pages on an HC08QT4. I follow the application
    note on the topic, AN2346, by having the flash program copy itself to RAM
    and run from there.

    The chip is running mono8 and Metrowerks is the IDE. The erase gets lost on
    the 'write to any address in the flash page' part of the erase routine,
    which is coded as 'sta ,x'. Seems simple enough, but doesn't work.
    Metrowerks shows an error message of 'unable to go into background mode'
    instead of 'stepped' when I single step though. Just running it sends it off
    into the weeds (doesn't recover) and going back after reset shows the flash
    was not erased.

    I also tried using a store A to an address, skipping the instruction,
    stepping through, running the code without the IDE then going back to check.
    I am stuck. Read everything I could find, no help.

    There is an erase routine in ROM but I have the chipset with the error that
    erases your reset vector if the ROM routine is called. Plan A was to code my
    own flash erase routine following the application notes. Plan B is get help
    from this group. Plan C is buy a new board without the chipset error and
    call a correct ROM routine. I just hate spending money though, especially
    when it's my own money.

    I am able to write to flash calling the ROM routine. Stepping through sends
    the processor into the weeds again, but the flash is programmed.

    I disable interrupts on the calling of the RAM routine, I could try leaving
    interrupts enabled but that's probably not a good idea. The mono8 uses SWI's
    so maybe the interrupt disable is preventing it from working correctly, but
    running without the mono8/IDE should have worked correctly.

    Any ideas???


  • Next message: Mike Fields: "Re: water well depth"

    Relevant Pages

    • Re: o_sync in vfat driver
      ... flash disks are not stupid as you assume. ... It takes about a second to erase a 64k physical sector. ... device eth0 entered promiscuous mode ... movb $0xaa, 0x555 ...
      (Linux-Kernel)
    • Re: document ext3 requirements
      ... +stay on the disk. ... An inherent problem with using flash as a normal block device is that the ... flash erase size is bigger than most filesystem sector sizes. ...
      (Linux-Kernel)
    • Re: Reiser4 status: benchmarked vs. V3 (and ext3)
      ... > Don't confuse block size with erase size. ... that if an IO request size does not equal to flash ... > However since you said that one can plug in a different block allocation ... Plugin-based architecture is used in reiser4, ...
      (Linux-Kernel)
    • Re: Confused about Flash
      ... Apparently I can't do normal reads during erase, ... so I can't run the code out of the same flash I'm erasing. ... that perform the standardized programming algorithms. ... command code writes followed by an address+data word write. ...
      (sci.electronics.design)
    • Re: Confused about Flash
      ... If I write a secret combination of words to a secret list of addresses ... Apparently I can't do normal reads during erase, ... During erase or program, I again can't execute code out of flash, so ... I'll have to relocate the flash erase and write routines into CPU ram ...
      (sci.electronics.design)