I've flashed the following code to my shiny new STM32F0DISCOVERY board. The comments explain what I thought it would do.
RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOA, ENABLE);
// Place PIN 4 (DAC out) into analog mode
GPIOA->MODER=0b11<<8;
RCC_AHBPeriphClockCmd(RCC_APB1Periph_DAC, ENABLE);
// Default DAC settings are fine.
DAC->CR = 0;
DAC->CR = 1;
Unfortunately after flashing this code openocd can no longer talk to the board or recognize that it is an stm32f0 (but it can still connect to the onboard ST/LINK if the reset button is held down). I thought I might be able to hold BOOT0 high and boot from the internal serial bootloader, but that doesn't seem to allow SWD flashing either. The rest of the short program just uses GPIO B and C and the timer.
Should I expect that code to brick the chip or did I just get unlucky?
RCC_AHBPeriphClockCmd()
used incorrectly to try to enable an APB1 peripheral. \$\endgroup\$