- The PNB in FLASH_CR wasn't cleared before every erase operation
and the new value was just stacked on top. After a couple of erase
the PNB written was overlapping with old ones failing to erase the
correct page.
- Before, HSI was enabled as the default case when it is only
used for stm32f0 and stm32f1. It is now implemented explicitly
for those platforms, and only those.
Moving the while loop in a separate function ensures no ordering
optimizations is applied silently by gcc.
This commit fixes the flashpage not working on iotlab-m3.
- improve debug messages
- fix missing space before comment
- use a comment instead of debug message (the same message is displayed by the function called after)