Can't enter into debug mode after writing to the STM32L073 EEPROM memory; mass erase solves it.
Hi,
I'm using the internal EEPROM bank 0 for the STM32L073 chip located at 0x08080000 (as per the user manual).

After writing my data (less than 1K; and bank 0 has 3K capacity) and trying to enter into debug mode, system refuses to do so:

(BTW: such log file isn't created: tmp/STM...log)
In order to bring the chip back from this brick mode I need to apply a mass erase operation using the STM32CubeProgrammer:

And then I can enter into the debug mode again:

The code for writing into the EEPROM is:
#define EEPROM_BASE_ADDR 0x08080000
bool write_( uint16_t data_address, const uint8_t* buffer, uint16_t len )
{
HAL_StatusTypeDef ret_val = HAL_OK;
HAL_FLASHEx_DATAEEPROM_Unlock();
for( uint16_t i = 0; i < len and ret_val == HAL_OK; ++buffer, ++i )
{
ret_val = HAL_FLASHEx_DATAEEPROM_Program(
FLASH_TYPEPROGRAMDATA_BYTE,
(uint32_t)(EEPROM_BASE_ADDR + data_address + i),
static_cast<uint32_t>(*buffer) );
}
HAL_FLASHEx_DATAEEPROM_Lock();
return ret_val == HAL_OK;
}Data seems to be written correctly at the specified address offset (`data_address`, which is zero ). I can see it (through the RAM memory debug pane) and the expected values are written into RAM variables with the expected values.
My first guess is that the new data is invading some critical flash memory portion, but with such small values (< 1K) I don't see how).
Any ideas? Thank you in advanced!
