2018-05-03 10:43 AM
I'm trying to program STM32L4-discovery board using the registers of ST32L4 only. I wanted to modify flash latency and see if the register value really changes by using gdb. However, it turned out that the following simple program doesn't make any change in FLASH->ACR and PWR->CR2. Is it normal that you cannot just write to the registers?
1 #include 'main.h'
2 #include 'stm32l4xx.h' 3 4 5 int main(void) 6 { 7 PWR->CR2 = 1U; 8 FLASH->ACR |= 1U <<2; 9 }2018-05-03 10:58 AM
Shouldn't exit main ()
Need to make sure synchronous peripherals have their clock enabled, PWR may also need to be unlocked.
2018-05-03 11:21 AM
What does the boot code do before control is passed to main?