Skip to content

Could not find upload tool when using STM32 core #80

Closed
@evgenykochetkov

Description

@evgenykochetkov

Summary

Trying to use https://github.com/stm32duino/Arduino_Core_STM32 with arduino-cli, but get Upload tool 'stlink_upload' not found. error during upload process. With Arduino IDE everything works fine.

Steps to reproduce

arduino-cli 0.3.1-alpha.preview on macOS

/Users/user/arduino_cli_stm_bugreport with folders sketchbook, arduino_data and a .cli-config.yml file which looks like this:

proxy_type: auto
sketchbook_path: /Users/user/arduino_cli_stm_bugreport/sketchbook
arduino_data: /Users/user/arduino_cli_stm_bugreport/arduino_data
board_manager:
  additional_urls:
    - https://github.com/stm32duino/BoardManagerFiles/raw/master/STM32/package_stm_index.json

It installs and compiles fine:

arduino-cli --config-file .cli-config.yml core update-index
arduino-cli --config-file .cli-config.yml core install STM32:stm32
arduino-cli --config-file .cli-config.yml sketch new helloStm
arduino-cli --config-file .cli-config.yml compile --fqbn STM32:stm32:Nucleo_64:opt=o3std,pnum=NUCLEO_F401RE,upload_method=STLink ./sketchbook/helloStm

but upload fails:

arduino-cli --config-file .cli-config.yml upload --fqbn STM32:stm32:Nucleo_64:opt=o3std,pnum=NUCLEO_F401RE,upload_method=STLink --port /dev/tty.usbmodem14103 -t ./sketchbook/helloStm
Upload tool 'stlink_upload' not found.

Here are the relevant sections from boards.txt

# Upload menu
Nucleo_64.menu.upload_method.MassStorage=Mass Storage
Nucleo_64.menu.upload_method.MassStorage.upload.protocol=
Nucleo_64.menu.upload_method.MassStorage.upload.tool=massStorageCopy

Nucleo_64.menu.upload_method.STLink=STLink
Nucleo_64.menu.upload_method.STLink.upload.protocol=STLink
Nucleo_64.menu.upload_method.STLink.upload.tool=stlink_upload

and from platform.txt

# ST-Link upload
tools.stlink_upload.cmd=stlink_upload
tools.stlink_upload.cmd.windows=stlink_upload.bat
tools.stlink_upload.path.windows={runtime.tools.STM32Tools.path}/tools/win
tools.stlink_upload.path.macosx={runtime.tools.STM32Tools.path}/tools/macosx
tools.stlink_upload.path.linux={runtime.tools.STM32Tools.path}/tools/linux
tools.stlink_upload.path.linux64={runtime.tools.STM32Tools.path}/tools/linux64
tools.stlink_upload.upload.params.verbose=-d
tools.stlink_upload.upload.params.quiet=
tools.stlink_upload.upload.pattern="{path}/{cmd}" {serial.port.file} {upload.altID} {upload.usbID} "{build.path}/{build.project_name}.bin"

The tool itself seems to be right where it needs to:

ls ./arduino_data/packages/STM32/tools/STM32Tools/1.1.0/tools/macosx
dfu-util              massStorageCopyMacOsX src                   stlink_upload         upload-reset
maple_upload          serial_upload         stlink                stm32flash            upload_router

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions