[En-Nut-Discussion] Writing code to FLASH in Ethernut 3

scostas scostas at det.uvigo.es
Mon Apr 24 16:33:48 CEST 2006


Harald Kipp wrote:

Hi!

> One is, that only part of the flash will be erased in
> at91-upl.jom.

> You can call
>   jtagomat -v BATCH at91-erase.jom
> to erase the complete chip.


It worked! The problem was that the uploader only erased the first 16Kbytes.

You should add the lines:

    NOTE Erasing Flash
    FLASH 0x10000000 0x10000000
    ONERR ErrorExit
    FLASH 0x10000000 0x10002000
    ONERR ErrorExit
    FLASH 0x10000000 0x10004000
    ONERR ErrorExit
    FLASH 0x10000000 0x10006000
    ONERR ErrorExit
    FLASH 0x10000000 0x10008000
    ONERR ErrorExit
    FLASH 0x10000000 0x1000A000
    ONERR ErrorExit
    FLASH 0x10000000 0x1000C000
    ONERR ErrorExit
    FLASH 0x10000000 0x1000E000
    ONERR ErrorExit
    FLASH 0x10000000 0x10010000
    ONERR ErrorExit
    FLASH 0x10000000 0x10020000
    ONERR ErrorExit
    FLASH 0x10000000 0x10030000
    ONERR ErrorExit
    NOTE Flasher running and flashing $IMAGE
    FLASH 0x10000000 0x10000000 $IMAGE

    NOTE $IMAGE flashed, resetting target
    RESET
    QUIT

to ensure that all the first 256Kbytes are erased.

Thank you!



More information about the En-Nut-Discussion mailing list