We just released a massive open online course on the STM32G0, our first mainstream 90 nm MCU that only needs one power line, thus simplifying PCB designs. The course doesn’t assume any experience with microcontrollers as the video below starts by looking at the installation of STM32CubeMX, STM32CubeProgrammer, the Keil IDE, and the necessary firmware and libraries, such as STM32CubeG0, as well as a terminal emulator. The course uses a NUCLEO-G071RB , but in the vast majority of cases, the concepts will apply to other microcontrollers of the same family. Users who have a different board may also want to check out the Getting Started video we published in January. Finally, the videos couldn’t use our new STM32CubeIDE, our first free ST IDE with STM32CubeMX built-in, but those familiar with our new software will find the Nucleo-G071RB and can start programming it within our unique environment.
MOOC on STM32G0: Starting with a Blinking LED
The MOOC is a great starting point for beginners as one of its first lessons will teach users how to turn an LED on the Nucleo board on or off, the equivalent of “Hello World” for microcontrollers. It’s often the first lab students get to run because it teaches them about pin configurations, and the instructor in the video does help students understand how to find the right pin from a schematic then configure it using STM32CubeMX. The lesson then delves into our hardware abstraction layer (HAL), which enables programmers to toggle the right pin from their code easily. Once students grasp these concepts, they can build upon this foundation to create a vast number of programs, since most of them will follow a similar pattern. The code to add to the main.c file is available in the video’s description to prevent typing errors and facilitate the student’s learning experience.
Configuring UART and Debugging It
Building upon these lessons, the videos go into more complex topics. For instance, the film below covers another fundamental teaching: the configuration of a UART peripheral and the use of the printf C function for debugging purposes. By redirecting the printf output to the UART of the STM32G0, users can display messages on a terminal emulator. Similarly to the blinking light example above, the video first looks at the pin configuration (PA2 and PA3) as well as the clock speed. It also explores the features inherent to Low Power UART and its method to send and receive information, thus offering important background information to students who may be new to this type of application. The video also guides developers to enter the relevant HAL function and configure the protocol within STM32CubeMX.
- Take the MOOC on STM32G0