Hi Diogo,
I was trying to reproduce this but I'm still unable to do it, can you let me know which example are you using?
Also, as you mention this function (SYSMPU_Enable(SYSMPU, false);) disable the memory protection unit so I think this is not the reason for it. One thing I could recommend is to check if you change the flash configuration, this can be find in the startup code in the following section:
__attribute__ ((used,section(".FlashConfig"))) const struct {
unsigned int word1;
unsigned int word2;
unsigned int word3;
unsigned int word4;
} Flash_Config = {0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFE};
Best Regards,
Alexis Andalon