Close

Heckin around w STM32

will-carlsonWill Carlson wrote 12/09/2023 at 22:05 • 2 min read • Like

https://github.com/cpq/bare-metal-programming-guide

Got a Nucleo STM32F446RE development board. Set up STM32CubeIDE. Successfully created a project and made an LED blink (LD2).

Next, created a new project - well, technically 8 or so in the process - that ran FreeRTOS. After a bit I was able to make the same LED blink/toggle via tasks and delays. Will need to revisit that to review the details there, like exact names of those functions and why an LED toggle function needs two arguments to operate it.

I ran into some difficulty as I wanted a barebones FreeRTOS project. With STM they try to set up a project with a wrapper 'interface' called CMSIS. So, I wanted to eliminate that step and I was able to do so, deleting that source code and removing it from the build/includes path in the IDE. The issue was there are some basic drivers for the stm32f4xx.h that are integrated with CMSIS. So, I had to leave those drivers there as they are essential, but I am able to use plain FreeRTOS anyway. There was a helpful tutorial page that showed how to remove all references in src code to CMSIS headers. https://jaywang.info/using-native-freertos-in-stm32-microcontrollers/

Next step: learn FreeRTOS basics and start to think of something interesting to do.

Decided to ditch getting freertos working without any trace of CMSIS. I am just placing an infinite while loop before hitting any oskernelstart or other calls in main, and created freertos tasks for LED blinking, button press interrupt (had to be configured), and printing messages and states through USART tot he console.

Like

Discussions