Цитата(Hexel @ Jun 8 2018, 22:01)

Отключать прерывания нахрен до завершения - топорно, но должно работать)
В STM запись в EEPROM и так приостанавливает работу выполнение кода на аппаратном уровне. Так что критические секции будут бесполезны.
Цитата
When the code is executing from the Flash program memory, the instruction must be read
from it, this is not possible during a write operation on any memory block of the same bank.
In such case the program execution stalls during the EEPROM data write.
Stalling happens at the Busmatrix interconnection and blocks the data recipient until the
data is available.
The stall does not disrupt the sequence of operation. What happens is that the CPU core
keeps waiting for the instruction fetch. Also, the stall only affects the CPU core. Processes
independent from the core, such as DMA or peripherals may continue to work as long as
they avoid accessing the NVM bank.
Подробности как решить вашу задачу см. тут:
AN4808.