Skip to content

Instantly share code, notes, and snippets.

@miek
Forked from g7uvw/gist:8c8627f5ab7b7a367289
Last active December 20, 2015 14:41
Show Gist options
  • Save miek/1f52470531ecb1a81fa8 to your computer and use it in GitHub Desktop.
Save miek/1f52470531ecb1a81fa8 to your computer and use it in GitHub Desktop.
STMF401RE Nucleo issue
#include "stm32f4xx.h"
int main (void)
{
RCC->AHB1RSTR |= RCC_AHB1RSTR_GPIOARST; // Reset GPIOA
RCC->AHB1RSTR = 0; // Exit reset state
RCC->AHB1ENR |= RCC_AHB1ENR_GPIOAEN; // Enable GPIOA clock
GPIOA->MODER |= GPIO_MODER_MODER5_0; // Enable Output on D13
GPIOA->BSRR = GPIO_BSRR_BS_5; // Set D13 High
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment