AnsweredAssumed Answered

Hard Fault in FLASH_ReadAccess64Cmd(ENABLE)

Question asked by palmer.david on Feb 28, 2013
Latest reply on Feb 28, 2013 by Clive One
I am getting a Hard Fault in FLASH_ReadAccess64Cmd(ENABLE). The line is
FLASH->ACR |= FLASH_ACR_ACC64;

When I cold boot, it seems to work fine, but if I reset in the debugger it can't seem to get by this function.

The code that runs AFTER this messes with the clock and flash settings a lot, so the clock/pwr/flash may be in an unknown state prior to the reset.

The sequence of setup function calls is

RCC_DeInit();
RCC->CR |= RCC_CR_HSION;
while ((RCC->CR & RCC_CR_HSIRDY)==0);
RCC->CFGR &= (uint32_t)0x88FFC00C;
RCC->CR &= (uint32_t)0xEEFEFFFE;
RCC->CR &= (uint32_t)0xFFFBFFFF;
RCC->CFGR &= (uint32_t)0xFF02FFFF;
RCC->CIR = 0x00000000;
FLASH_ReadAccess64Cmd(ENABLE);

Nothing runs before this. Power (3.3V) is stable.

Ideas?

Outcomes