

- #GPIO PINS ON NUCLEO F401RE INSTALL#
- #GPIO PINS ON NUCLEO F401RE UPDATE#
- #GPIO PINS ON NUCLEO F401RE SOFTWARE#
- #GPIO PINS ON NUCLEO F401RE CODE#

The second approach is more application-driven and provides a high-level API that targets several families of a device. The first approach is trait driven so to speak where the embedded-hal is used as a foundation. From what I figure, right now there seem to be two approaches for developing HALs. 📝 At the time of writing this post, it came to my attention that there is an additional HAL that targets STM32 device families (the stm32-hal). The example here is a bit more advanced version of blinky. We'll see how we can configure GPIO, read inputs, and manipulate output at the HAL. I this post, I will be starting out with the GPIO peripheral.

I will be exclusively working at the HAL level (the stm32f4xx_hal in particular). Reflecting on my experience, in this post, and the upcoming series of posts, I will be working with the STM32F401 microcontroller to present and walk through examples for different peripherals. It used to happen that for certain methods where proper descriptions were missing, I would either find myself experimenting to understand or looked at similar HALs to figure out how they work. Secondly, the HAL documentation was hard to navigate at first, and in some cases, it was not as complete as I would have expected.

Through leveraging the language features, the HAL is constructed in a way that incorporates techniques to ensure the safe operation of embedded devices. Firstly, the HAL probably is more involved in using certain features of Rust like generics and traits. After some time and work with the HAL, I feel that there were two main contributors to that experience. Interestingly enough, when I set out to work with embedded Rust, I found that dealing with the PAC was easier for me to achieve what I want. Board crates, although sit at the highest layer, are more specific to a particular development board. The HAL, on the other hand, probably allows for less control over fine details in a particular microcontroller but is much more portable. The PAC is much closer to the register level and allows for much control but at the cost of portability. Finally, at the highest layer sits the board layer crate (more detail in the Embedded Rust Book). On top of the PAC sits the hardware abstraction layer (HAL), accessed via the HAL crate. Peripheral access layer features can be accessed via the peripheral access crate (PAC). In embedded development with Rust, the layers in which an individual can program a microcontroller include the peripheral access layer. Select the board selector tab and choose the Nucleo F401RE board.This blog post is the first one of a multi-part series of posts where I explore various peripherals in the STM32f401RE microcontroller using embedded Rust at the HAL level.
#GPIO PINS ON NUCLEO F401RE SOFTWARE#
Open CubeMX software and click on "New Project".Ģ) Once done, you will be prompted to select the board setup similar to the image shown below. Once everything is downloaded and set-up, it's time to have some fun with the board.ġ) Let us try to setup our board initialization with CubeMX to generate our project files. The MCP23017 (I2C io extender) setup and schematics are discussed in my previous blog, maybe you should examine it first.
#GPIO PINS ON NUCLEO F401RE UPDATE#
And while you are on that page, download also the firmware update to fix some important issues with the board.
#GPIO PINS ON NUCLEO F401RE INSTALL#
Install the needed Nucleo drivers at this link. EWARM is the one I currently have for now. I currently own an Embedded Workbench for ARM tool chain, technically the CubeMX software can generate targets for other tool chain. There is also an online ide at mbed, but I currently do not use it since I work offline most of the time. It will also generate a template project for your compiler tool chain.
#GPIO PINS ON NUCLEO F401RE CODE#
We will use the CubeMX software to generate an initialization code for our nucleo F401RE board. You will find the link to the download at the end of the page. Download STM32CubeMX from STMicroelectronics here. To accomplish this experiment, we need the following tools: So it's a very simple setup, we output an 8 bit counter value to the leds and loop.
