2. Contents
Assignments and Goals
Theory
Practice
Individual task
19.10.2021 14:03 Bare Metal – Training 01 2
3. Assignments and Goals
• Create “Hello World” firmware for GLESK
(LED blinking)
• Learn GLESK HW basics
• Learn how to create, build, flash and debug
firmware using Keil IDE
19.10.2021 14:03 Bare Metal – Training 01 3
24. Individual task
• Add more LEDs to the project
(PD14, PD13, PD12)
• Implement custom blinking sequence
with 4 LEDs
(each group receive personal variant)
• Go through the code step-by-step with help
of debugger
19.10.2021 14:03 Bare Metal – Training 01 24
Editor's Notes
Analyze schematics together with the students.
Open Kiel IDE and create new project.
Create folder for project. Go inside it.
Type name of the project and press Save button.
Select target microcontroller – STM32F407VGTx.
Select basic components for the project (see picture for details).
Open CubeMX Framework to configure microcontroller settings.
Configure pin PD15 as GPIO Output.
And press Generate Code button.
Close CubeMX.
Include new files to the project (just press OK button).
Open Main.c file and find main function inside it.
Modify while loop with following code.
Build application (press F7 button).
Fix “stm32f4xx_hal_exti.h” file missing error.
It is happens sometimes.
Check that build completed with 0 errors or warnings.
If errors are present – fix them.
Open options window for project.
Select ST-Link programmer.
Download code to flash memory (F8 button).
Press “RESET” button on the Discovery (black one). Blue LED should blink.
First program is ready!!! Congratulations!
Show step-by-step code execution (live session).
Go inside source code tree.
Explain what is all about.
Teacher should provide task for each group and control the result.
Something like: blink 2 times red, one time – blue and green simultaneously, 3 times – all leds (in a cycle).