Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

J-Link support when using STM32CubeProgrammer #2452

Open
jamesy0ung opened this issue Jul 18, 2024 · 5 comments · May be fixed by #2455
Open

J-Link support when using STM32CubeProgrammer #2452

jamesy0ung opened this issue Jul 18, 2024 · 5 comments · May be fixed by #2455
Labels
enhancement New feature or request good first issue Good for newcomers
Milestone

Comments

@jamesy0ung
Copy link

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 jamesy0ung added the enhancement New feature or request label Jul 18, 2024
@fpistm
Copy link
Member

fpistm commented Jul 18, 2024

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

@jamesy0ung
Copy link
Author

jamesy0ung commented Jul 18, 2024

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?

@fpistm
Copy link
Member

fpistm commented Jul 18, 2024

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

@jamesy0ung
Copy link
Author

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

@fpistm fpistm added the good first issue Good for newcomers label Jul 18, 2024
@fpistm
Copy link
Member

fpistm commented Jul 18, 2024

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 fpistm added this to the 2.9.0 milestone Jul 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
Development

Successfully merging a pull request may close this issue.

2 participants