Hi!
I found a bug in stm32h503xx.h (version 2023)
The SNB field has too many bits:
#define FLASH_CR_SNB_Msk (0x7FUL << FLASH_CR_SNB_Pos)
Correct is only three according to the reference manual (8 pages of 8K flash), therefore it should be
#define FLASH_CR_SNB_Msk (0x07UL << FLASH_CR_SNB_Pos)
With kind regards,
Jochen