stlink: 'st-info --probe' returns 'unknown device', works with STMCubeProgrammer

  • Programmer/board type:
    • Manufacturer: STMicroelectronics
    • Product: STLINK-V3
    • Serial: 002100423438511734313939
  • Operating system an version: Ubuntu 20.04.3 LTS
  • stlink tools version and/or git commit hash: st-flash 1.6.1-96-gbf41f14 and st-flash 1.7.0
  • stlink commandline tool name: st-info, st-flash
  • Target chip (and board, if applicable): STM32H743ZIT6U - Nucleo-H743ZI2

Commandline output: I get a error while flashing a binary.

/usr/bin/st-flash --reset --format=binary write foo.bin 0x8000000 <

st-flash 1.7.0
2021-09-02T07:49:24 INFO usb.c: Unable to match requested speed 1800 kHz, using 1000 kHz
2021-09-02T07:49:24 WARN common.c: Invalid flash type, please check device declaration
Failed to connect to target
The terminal process "bash '-c', '/usr/bin/st-flash --reset --format=binary write foo.bin 0x8000000'" failed to launch (exit code: 255).

Same error with the st-flash version 1.6.1. If I’m right the flash type is determined via the chip id. st-info 1.6.1

st-info --probe
Found 1 stlink programmers
 serial:     303032313030343233343338353131373334333133393339
 hla-serial: "\x30\x30\x32\x31\x30\x30\x34\x32\x33\x34\x33\x38\x35\x31\x31\x37\x33\x34\x33\x31\x33\x39\x33\x39"
 flash:      0 (pagesize: 0)
 sram:       0
 chipid:     0x0000
 descr:      unknown device

st-info 1.7.0

/usr/bin/st-info --probe
Found 1 stlink programmers
  version:    V0
  serial:     002100423438511734313939
  flash:      0 (pagesize: 0)
  sram:       24
  chipid:     0x0000
  descr:      unknown device

If I run the STM32CubeProgrammer instead I can connect and flash without any issues. Stlink Firmwareversion: V3J5M2 (updated as suggested in contributing.md)

Device: STM32H7xx Type: MCU Device ID: 0x450 Rev: V Flash Size: 2 MB CPU: Cortex M7 Bootloaderversion: 0x90

Therefore I guess the hardware is fine. I’ve tried another board H7 board as well, same issues. I’ve checked the procedure with my hardware on a colleagues setup and everything worked fine. (1.6.1 and 1.7.0, Ubuntu20 as well) The chip id is returned as expected. Flashing works as expected. Do I miss something? Is there additional driver or some setting I’ve forgot?

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 2
  • Comments: 20 (12 by maintainers)

Most upvoted comments

I’m getting the same thing, with 1.7.0 (on Debian Linux sid). I’m using a RobotDyn ST32 MINI Black Pill. STM32CubeProgrammer reports this as an STM32F101/F102/F103, device ID 0x410, Rev X, Cortex-M3. st-info --probe says this:

$ st-info --probe 
Found 1 stlink programmers
  version:    V2J40S7
  serial:     352605012A12354D314B4E00
  flash:      0 (pagesize: 0)
  sram:       0
  chipid:     0x0000
  descr:      unknown device

I have tested using a Nucleo H7 A3ZI-Q When using the dev branch (note ./, run from /bin in dev branch with sha: d053470):

~/Desktop/stlink/bin  develop
❯ ./st-info --probe
/usr/share//stlink/chips: No such file or directory
Found 1 stlink programmers
  version:    V3J10
  serial:     004F003E3038510734333935
  flash:      0 (pagesize: 0)
  sram:       0
  chipid:     0x480

However it seems the 1.7.0 release is working just fine. ( have installed 1.7.0)

~/Desktop/stlink/bin  develop
❯ st-info --probe
Found 1 stlink programmers
  version:    V3J10
  serial:     004F003E3038510734333935
  flash:      2097152 (pagesize: 8192)
  sram:       131072
  chipid:     0x0480
  descr:      H7Ax/H7Bx

@lucasdietrich Thanks for the input. However the comparison with older versions does not help here due to larger refactoring work and restructuring in the library recently. One would clearly need to review the current state in the develop branch.