AnsweredAssumed Answered

Hardfault Systeminit STM32Cube_FW_F0_V1.2.0

Question asked by mpcengineer on Feb 2, 2015
Latest reply on Feb 2, 2015 by Clive One

Using the STM32F0308-DISCO eval board and the STM32Cube_FW_F0_V1.2.0

I am compliling using eclipse and GCC ARM Sourcery tools with openOCD debugger.

The GPIO_IOToggle example compiles, loads and runs in the debugger but I get a hard fault on the first line of the SystemInit function:

void SystemInit(void)
  /* Reset the RCC clock configuration to the default reset state ------------*/
  /* Set HSION bit */
  RCC->CR |= (uint32_t)0x00000001;

The hard fault occurs at the read from the RCC control register. The disassembly is below.

163         RCC->CR |= (uint32_t)0x00000001;
0800020c:   ldr r3, [pc, #116]      ; (0x8000284 <SystemInit+124>)
0800020e:   ldr r2, [pc, #116]      ; (0x8000284 <SystemInit+124>)
08000210:   ldr r2, [r2, #0]    <<<<<<---------    Hardfault here
08000212:   orr.w r2, r2, #1
08000216:   str r2, [r3, #0]

I am using all the latest code from the CUBE firmware.

Anybody got any ideas?????