My first C project for an STM32F407 DISCOVERY board with a 32-bit Arm Cortex-M4 processor. Main functionality: turning on a LED.
The focus is on the file main.c which contains the practice I did during an embedded systems course for complete beginners (in C).
The commits are thought as stages of the progress, so with each commit there is a small improvement or change of how the board works.
-
Hard-coded memory addresses and manipulating registers using bitwise operations and masks (no bit shifting). link to commit
Registers used:
- RCC_AHB1ENR for clock enable
- GPIOx_MODER for mode
- GPIOx_ODR for data output
-
Implementation of bit shifting. link to commit
-
Implementation of loop and delays to toggle LED. link to commit
-
LED toggle based on input reading. The input read checks if there is current or not. link to commit
Register added:
- GPIOx_IDR for input
STM32CubeIDE