4
votes

Using an STM32H753, I have boot code in bank 1, sector 0 (0x08000000) that detects and jumps to application code in bank 2, sector 0 (0x08100000). In the application code I am trying to erase and rewrite bank 1 sector 0, but the MCU locks up (with no fault handler output) when I set FLASHH7_CR_START too soon after reset.

The application code is quite sophisticated and enables many features of the chip, but neither bank swapping nor FLASH CRC. The fault handler is known to work.

Things I have tried:

  • busy wait 50-100ms from reset before erasing; succeeds
  • redirect erase/rewrite to bank 1, sector 5; succeeds (without busy wait)
  • application code leaves caches disabled; still fails
  • compare FLASHH7 register bank at reset and 100ms later; no change
  • check errors in SR and clear any detected with CCR; no errors found
  • check WRP and PRAR registers; no protection set
  • check errata rev6 (19 Jun 2019); no relevant issues

The boot code does not enable any interrupts or caches and the application code writes to VTOR.

It seems there is something else time-sensitive about erasing the STM32H7 boot sector (or recently executed sector). What am I missing?

1
IMO it is a very fresh micro and rather complex as well. I would be surprised if there are no errors in the silicon. Did you check the errata? Report to the STM0___________
@P__J__ thanks, I'd already reviewed errata rev6 (now noted above) hence avoiding bank swap and CRCPhilMY
All interrupt handlers are in RAM ?Guillaume Petitjean
@GuillaumePetitjean no they're in bank 2 flashPhilMY
Did you try to copy the flash erasing code to RAM ?Guillaume Petitjean

1 Answers

2
votes

Posting as an answer because of the image.

As I suspected. Probably silicon bug

enter image description here

this from the errata pages. Check your uC model (which you actually hide :) )and download errata for your one.