ilg-archived / openocd

The GNU MCU Eclipse OpenOCD
http://gnuarmeclipse.github.io/openocd/
GNU General Public License v2.0
234 stars 62 forks source link

flash/nor/stm32h7x: fix flash write enable bug. #43

Closed theNth closed 4 years ago

theNth commented 4 years ago

The bank x internal buffer control bit (PGx) needs to be set to enable write operations before flashing an H7x part. The stm32x_write function does this in its "standard programming" fallback loop and a branch for handling remaining bytes, but never sets PGx prior to calling stm32x_write_block. For some reason, the existing code still succeeds on rev Y silicon, but fails on rev V parts.

This commit sets the PGx bit prior to calling stm32x_write_block.

theNth commented 4 years ago

The corresponding issue may be found here: https://github.com/gnu-mcu-eclipse/openocd/issues/42