Crates.io | nucleo-h743zi |
lib.rs | nucleo-h743zi |
version | 0.2.1 |
source | src |
created_at | 2019-05-26 12:48:36.039154 |
updated_at | 2023-02-26 21:45:38.040625 |
description | Example programs for nucleo-H743zi and nucleo-H743zi2 boards |
homepage | |
repository | https://github.com/astraw/nucleo-h743zi |
max_upload_size | |
id | 137138 |
size | 3,888,549 |
Example programs for the NUCLEO-H743ZI and NUCLEO-H743ZI2 boards.
This uses the stm32h7xx-hal crate.
Collaboration on this crate is highly welcome as are pull requests!
This repository contains examples and starter material specific to the Nucleo H743ZI and H743ZI2 boards and should work "out of the box" with these specific boards and demonstrates the usage of features on these boards with zero configuration or options.
While there is some redundancy with stm32h7xx-hal, the two projects have different aims. Here, the goal is to provide an easy on-ramp to the usage of these boards without covering all possible features or providing a universally helpful library. For more advanced usage, you are encouraged to take the lessons learned here and directly use the stm32h7xx-hal crate. Of course, as mentioned above, we welcome suggested improvements that fit within the project aim.
To facilitate ease-of-use with both the Nucleo-H743ZI and Nucleo-H743ZI2 boards, the code in this repository should work by default on both boards without modification or configuration.
This project supports knurling-rs, which simplifies developing, testing and debugging on embedded devices.
Feature | NUCLEO-H743ZI | NUCLEO-H743ZI2 | notes |
---|---|---|---|
STLINK | V2-1, Cuttable PCB | V3E, Embedded on PCB | see DB3171, Rev 14 |
Board reference | UM1974 User Manual STM32 Nucleo-144 boards (MB1137) | UM2407 User Manual STM32H7 Nucleo-144 boards (MB1364) | |
User LD2 | Blue, connected to PB7 | Yellow, connected to PE1 | |
Availability | Obsolete | Available |
The code in this repository should work on both boards without modification or configuration.
You will need the following components installed before building the project.
$ rustup target add thumbv7em-none-eabihf
$ rustup component add llvm-tools-preview
$ cargo install cargo-binutils
This will install a new target for the Rust compiler supporting Cortex-M7F and a
cargo plugin to call binutils
directly.
For debugging the program, you can use either probe-rs or a compatible version
of gdb
for your system.
.bin
fileThis method builds a .bin
file containing the compiled firmware. This file is
copied onto the emulated USB mass storage device of the Nucleo and the device is
automatically reset and will boot into the new firmware.
Build with:
cargo build --release --bin blinky
# (Substitute any of the example programs for 'blinky')
Convert to a .bin file:
cargo objcopy --release --bin blinky -- -O binary target/thumbv7em-none-eabihf/release/blinky.bin
cargo objcopy --release --bin serial -- -O binary target/thumbv7em-none-eabihf/release/serial.bin
Flash the device:
cp target/thumbv7em-none-eabihf/release/blinky.bin /path/to/NODE_H743ZI/
cp target/thumbv7em-none-eabihf/release/serial.bin /path/to/NODE_H743ZI/
probe-run
As an alternative to the above method, we use probe-run
from the Knurling
project to flash our firmware and run it. Log and println!
messages using the
defmt
crate will be visible when running. This method is automatically chosen
when typing cargo run
because of the runner
specified in the .cargo/config
file. See below for the probe-run
hardware options. The onboard STLINKv3
hardware is easiest because it is built-in to the NUCLEO-H743ZI2 board.
To see log messages from defmt
messages, compile with the DEFMT_LOG
environment variable set appropriately. (By default, defmt
will show only
error level messages.)
Powershell (Windows)
$Env:DEFMT_LOG="trace"
Bash (Linux/macOS)
export DEFMT_LOG=trace
probe-run
Hardware option A: onboard STLINKv3This is the easiest option and works with only a USB cable to your device. If
probe-run
returns with Error: The firmware on the probe is outdated
, you can
update the STLINKv3 firmware on your Nucleo using a download from
st.com.
probe-run
Hardware option B: Raspberry Pi Pico as a CMSIS-DAP probeDebugging can be performed with a Raspberry Pi Pico board running the DapperMime firmware to function as an inexpensive CMSIS-DAP probe. In this configuration, the STLINKv3 hardware built into the Nucleo will be bypassed.
To setup your Nucleo for this, perform the following steps.
Signal | MIPI-10 debug connector (CN5) on NUCLEO-H743ZI2 | Raspberry Pi Pico |
---|---|---|
SWDIO | Pin 2 | GP3 |
GND | Pin 3 | GND |
SWCLK | Pin 4 | GP2 |
probe-rs-debug
and Visual Studio CodeThis method is recommended as it requires no installation of gdb
or openocd
.
Follow the probe-rs
guide.
openocd
and gdb
Debugging can be performed with openocd
and gdb
. A sample openocd
configuration file is provided.
.cargo/config
file according to the used operating
system and desired debugger.openocd
in the project rootcargo run --bin blinky
or cargo run --bin serial
You can also perform debugging with a GUI using VS Code with the Cortex-Debug extension.
Some configuration files were provided in the .vscode
folder.