This document provides an overview of training materials for an embedded starter kit focused on bare metal programming of LEDs and buttons. The goals are to create firmware to control LEDs and read button presses, learn about the hardware operation of LEDs and buttons, and learn GPIO input/output and interrupt basics. It introduces GPIO configuration as digital I/O with pull-up/down resistors or analog, covers GPIO pin functionality, and discusses using interrupts to address the delay issues of polling button states in a main loop. The practice section has the learner set up a project to control an LED based on a button press via polling initially, then refactors to use interrupts to eliminate delays.
2. Contents
Assignments and Goals
Theory
Practice
Individual task
28.09.2020 17:07 Bare Metal Training 02 2
3. Assignments and Goals
Create firmware that works with LEDs and
buttons
Learn LED and button HW background
(how its working)
Learn GPIO I/O basics
Learn GPIO_EXTI interrupts
28.09.2020 17:07 Bare Metal Training 02 3
7. General-purpose I/Os (GPIO)
GPIO pin can be configured as
Input/Output pin with/without
pull up/down resistors (digital)
ADC/DAC pin (analog)
Alternative function
28.09.2020 17:07 Bare Metal Training 02 7
15. Practice
Create new Keil Project
(see Pract_01 for details)
Set HW settings (with CubeMX)
PA15 GPIO_Input (SW2)
PD15 GPIO_Output (LED6 Blue)
Complete main while loop with code
provided
28.09.2020 17:07 Bare Metal Training 02 15
18. Add source code
Modify source code with
snippets from following file
Compile
Flash
Press SWT2 button to test
FW
What main disadvantage of
this solution?
28.09.2020 17:22 Bare Metal Training 02 18
22. Modify source code
Modify source code with
snippets from following file
Compile
Flash
Press SWT2 button to test
FW
Issue disappeared?
28.09.2020 17:32 Bare Metal Training 02 22
23. Main loop + IRQ timeline
28.09.2020 17:44 Bare Metal Training 02 23
Interrupts
24. Individual task
LED blink frequency change using switches
Blinking LED number change using switches
28.09.2020 17:44 Bare Metal Training 02 24