This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Erasing Flash memory

I am having trouble getting a 16K block erase of Flash to work.  As soon as I write to the FMC register, an exception handler is triggered.  I have verifiied:

1) The bank to which I am writing differs from the bank from which I am executing code

2) The bank in question is set for R/W access

3) The key value of 0xA442 is properly written to the FMC register (and has not been overwritten by use of the KEY bit in the BOOTCFG register)

I am using a TM4C129XNDZAD micro and debugging with a j-link debugger in an IAR Embedded Workbench environment.

Any suggestions would be greatly appreciated.

- Todd

  • Hello Todd,

    On the TM4C129 devices Bank-0 and 1 are paired and so are Bank-2 and 3 in the same order. So you can execute code from one pair and erase the flash in another pair, or execute code from a sector in one pair and erase the flash in the same pair but another sector.

    The question is: Where is the erase code located and to which bank are you erasing?

    Regards
    Amit