Skip to main content

STM32 Nucleo

Board

Documentation

Software - Void Linux

  1. Install software
    xi stlink
  2. Set up udev rules (as root)
    #/etc/udev/rules.d/stm32nucleo.rules
    SUBSYSTEM!="usb|usb_device", ACTION!="add", GOTO="stm32nucleo_end"
    ATTRS{idVendor}=="0483", ATTRS{idProduct}=="374b", SYMLINK+="stm32-%k", MODE="660", GROUP="input"
    LABEL="stm32nucleo_end"

  3. Connect device
  4. Probe for the device st-info --probe; should print something like this:
    Found 1 stlink programmers
      version:    V2J33S25
      serial:     066FFF5155xxxxxxxxxxxxx
      flash:      65536 (pagesize: 2048)
      sram:       40960
      chipid:     0x439
      dev-type:   STM32F301_F302_F318
  5. Read boot or flash area
    st-flash read /tmp/boot.bin 0x0 0x10000 # flash if booting from flash
    st-flash read /tmp/flash.bin 0x8000000 0x10000 # flash

Debugging

  1. Install tools
     xi cross-arm-none-eabi cross-arm-none-eabi-gdb

  2. UsingĀ  GDB
    1. Connect to device
      st-util
    2. Run GDB
      arm-none-eabi-gdb -ex 'target extended-remote localhost:4242'

Using OpenOCD

  1. Install
    xi openocd
  2. Run server
    openocd -f interface/stlink.cfg -f target/stm32f3x.cfg
  3. It should print something like
    Info : STLINK V2J33M25 (API v2) VID:PID 0483:374B
    Info : Target voltage: 3.238345
    Info : [stm32f3x.cpu] Cortex-M4 r0p1 processor detected
    Info : [stm32f3x.cpu] target has 6 breakpoints, 4 watchpoints

Rust

Tools:

rustup target add thumbv7em-none-eabihf