2015-09-10 07:47 AM
Hi,
I am trying to read the Flash protection registers using something like the following:
#define FLASHPR_BASE 0x8010DFB0
#define FLASH_NVWPR ((volatile uint32_t*)(FLASHPR_BASE + 0))
#define FLASH_NVAPR0 ((volatile uint32_t*)(FLASHPR_BASE + 8))
#define FLASH_NVAPR1 ((volatile uint32_t*)(FLASHPR_BASE + 12))
uint32_t readStatusValue()
{
return *FLASH_NVAPR1; // Crashes
}
As indicated, line 8 breaks. I did read in the Flash Programming manual that the (read only) LOCK bit needs to be clear before attempting to read these registers, butI don't know how to clear that.
Any ideas?
Thanks!