Skip to main content
Visitor II
July 26, 2022
Solved

Can't program hex file from ST-LINK CLI but works on STM32 Link Utility with same parameters ? Keep having 'Can't reset core Unable to Connect to ST-LINK' error

  • July 26, 2022
  • 1 reply
  • 1947 views

(On Nucleo L073RZ devkit with target on SWD) I can easily connect and program a hex file from the stm32 link utility UI but it seems impossible from the CLI. Connection parameters are the same (Mode: Normal, Reset Mode: Software system reset) and the

.\ST-LINK_CLI.exe -c SWD

command works fine, but not

.\ST-LINK_CLI.exe -P C:\LoRaWAN-S76S-US915-V1-6-5.hex 0x08000000 -V

Both outputs are in the following picture. 0693W00000QMBqpQAH.png

    This topic has been closed for replies.
    Best answer by AA.22

    UPDATE:

    Altough I didn't quite see such infoin the CLI documentation, I've found out that the connection command only connects to the target for the duration of the command and close the connection after, making it impossible for the program command to work.

    FIX:

    Just 'pipe' the 2 commands and it should work perfectly:

    .\ST-LINK_CLI.exe -c SWD -P C:\LoRaWAN-S76S-US915-V1-6-5.hex 0x08000000 -V

    1 reply

    AA.22AuthorAnswer
    Visitor II
    July 26, 2022

    UPDATE:

    Altough I didn't quite see such infoin the CLI documentation, I've found out that the connection command only connects to the target for the duration of the command and close the connection after, making it impossible for the program command to work.

    FIX:

    Just 'pipe' the 2 commands and it should work perfectly:

    .\ST-LINK_CLI.exe -c SWD -P C:\LoRaWAN-S76S-US915-V1-6-5.hex 0x08000000 -V