Arduino_Core_STM32 icon indicating copy to clipboard operation
Arduino_Core_STM32 copied to clipboard

J-Link support when using STM32CubeProgrammer

Open jamesy0ung opened this issue 1 year ago • 5 comments

STM32CubeProgrammer has support for J-Link probes, however the Arduino core only allows it to use SWD with ST-Link, DFU or UART

I'd like to be able to upload using a J-Link probe from the Arduino IDE. Thank you!

Screenshot 2024-07-18 170617

jamesy0ung avatar Jul 18 '24 07:07 jamesy0ung

Hi @jamesy0ung Feel free to contribute and provide a PR.

fpistm avatar Jul 18 '24 07:07 fpistm

I haven't done any work on Arduino cores before, but I got the STM32CubeProgrammer CLI working by using the following flag. -c port=JLINK ap=0

I tried to modify boards.txt to add support but I can't see it in the Arduino IDE as a programmer


GenF1.menu.upload_method.jlinkMethod=STM32CubeProgrammer (J-Link)
GenF1.menu.upload_method.jlinkMethod.upload.protocol=swd
GenF1.menu.upload_method.jlinkMethod.upload.options=-c port=JLINK ap=0
GenF1.menu.upload_method.jlinkMethod.upload.tool=stm32CubeProg

Is there anything I'm missing?

jamesy0ung avatar Jul 18 '24 12:07 jamesy0ung

I would recommend to check the script: https://github.com/stm32duino/Arduino_Tools/blob/main/stm32CubeProg.sh

And simply add a new interface (protocol): jlink then in the script simply call it with correct option. About the fact it is not in the menu, this is an Arduino IDE issue. You have to delete the cache.

Path:

  • Linux: $HOME/.config/arduino-ide/
  • Windows: C:\Users\<login>\AppData\Roaming\arduino-ide

fpistm avatar Jul 18 '24 12:07 fpistm

I've opened 2 PR's

One adds a case to the flashing script, and the other adds support under the STM32F1, I'll look into adding J-Link programmer support for other boards, but I don't have any other hardware to test with

jamesy0ung avatar Jul 18 '24 13:07 jamesy0ung

Thanks @jamesy0ung for the PR's. I will try on my side and see if it is OK for other series. I never used J-Link so have to ramp-up.

fpistm avatar Jul 18 '24 14:07 fpistm

Guys Any New Info? I Wanna Use Jlink Flasher And There's No Straight Option

Amir1387aht2 avatar Sep 29 '24 20:09 Amir1387aht2