STM32 flash memory write issue
Flash sector 11 might not available on the E type, only on the G type. As it is the last sector.
Sectors are truncated from the higher addresses when selecting lower size parts.
See chapter "Part numbering" in the datasheet.


  Any tips?


Remove the flash lock/unlock between the erase and write. Some of the older ST parts require this to be one session.

Flash unlock is not required to read it.