Arduino IDE 2 & Debug feature

Development environment specific, Arduino, Eclipse, VS2013, Em::Blocks etc
User avatar
fpiSTM
Posts: 1738
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: Arduino IDE 2 & Debug feature

Post by fpiSTM »

I have to test a standard install. I've modified my arduino cli yams to make it portable but I think it is not compatible with debug. If true then I will submit an issue to arduno.
Anyway PR from @Vassilis is welcome 😉
User avatar
Vassilis
Posts: 23
Joined: Wed Dec 18, 2019 3:04 pm
Location: Thessaloniki, Greece
Contact:

Re: Arduino IDE 2 & Debug feature

Post by Vassilis »

PR was sent

https://github.com/stm32duino/Arduino_C ... /pull/1952
I have added the STM32F103 (Bluepill) to the debug support list

Of course, thanks to @luca_stm32, on the debug configuration !
Arduino_IDE_Debugging_F103.jpg
Arduino_IDE_Debugging_F103.jpg (87.49 KiB) Viewed 4571 times
Vassilis Serasidis
https://www.serasidis.gr
User avatar
fpiSTM
Posts: 1738
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: Arduino IDE 2 & Debug feature

Post by fpiSTM »

Thank you all.
As suspected, it seems the debug support is somehow "hardcoded" with the Arduino IDE 2.
Using default location to store installed package and it works. Moreover some variables expansions doesn't work.
I will submit an issue to Arduino IDE.

Here a new json file (available on dev branch) which add openocd link to install within the STM32 core:
https://github.com/stm32duino/BoardMana ... index.json

And here a commit to support it:
https://github.com/stm32duino/Arduino_C ... enocd_ide2
luca_stm32
Posts: 19
Joined: Tue Feb 18, 2020 3:37 pm

Re: Arduino IDE 2 & Debug feature

Post by luca_stm32 »

What I noticed last eveving is that with Stlink 2.1 (chinese clone) and Arduino IDE 2.0.3 I can program the sketch on the target, but (with OpenOCD 10.0) I can't debug. In order to use debugger, I need to use Stlink 2 (chinese clone).

Great job the inclusion of OpenOCD on STM32 tools: maybe with OpenOCD 12 it could be possible debug also with Stlink 2.1.
luca_stm32
Posts: 19
Joined: Tue Feb 18, 2020 3:37 pm

Re: Arduino IDE 2 & Debug feature

Post by luca_stm32 »

I found that under STM32Programmer folder there is a folder with all SVD files for STM32 micros: is there a way to load SVD correct file automatically using platform.tx or board.txt?
User avatar
fpiSTM
Posts: 1738
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: Arduino IDE 2 & Debug feature

Post by fpiSTM »

We will investigate that. Anyway as stated it seems debug support is not easily customizable.
umejopa
Posts: 9
Joined: Sat Oct 16, 2021 7:37 pm
Location: Stockholm

Re: Arduino IDE 2 & Debug feature

Post by umejopa »

Thanks it work for me W10 2.0.3 on F103 and ST-link2 :D
And on F303 Blackpill and Olimex F3
Bild1.jpg
Bild1.jpg (40.89 KiB) Viewed 4404 times
Last edited by umejopa on Tue Feb 21, 2023 4:53 pm, edited 1 time in total.
User avatar
Vassilis
Posts: 23
Joined: Wed Dec 18, 2019 3:04 pm
Location: Thessaloniki, Greece
Contact:

Re: Arduino IDE 2 & Debug feature

Post by Vassilis »

@fpiSTM I am confused. I really don't know what you are trying to do. Can you please explain your thoughts?
Vassilis Serasidis
https://www.serasidis.gr
User avatar
fpiSTM
Posts: 1738
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: Arduino IDE 2 & Debug feature

Post by fpiSTM »

@Vassilis
When we tried the first time, the core was installed in a different location than the default one. Like if we had the portable feature of the legacy 1.8.x.
Because we have a lot arduino installed so for 2.0 IDE we changed the default directories defined in the arduino-cli.yaml.
But in this case the debug do not work as it claims about unknown fqbn even if build is ok.
The second issue is the build variables expansions which is not working as expected. It will allows to define directly for each variant the correct config files but the variables (recipes) are not expanded properly.
User avatar
Vassilis
Posts: 23
Joined: Wed Dec 18, 2019 3:04 pm
Location: Thessaloniki, Greece
Contact:

Re: Arduino IDE 2 & Debug feature

Post by Vassilis »

The only problem I had with setting up xpack-openocd-0.12.0-1 (Core 2.4.0, Win10 and Linux Mint 20.2, IDE 2.0.3) was that I was getting the following error when trying to click the debug button:
Failed to launch OpenOCD GDB Server: Error: spawn C:\Users\<USER>\AppData\Local\Arduino15\packages\STMicroelectronics\tools\xpack-openocd-0.12.0-1\openocd/bin/openocd ENOENT
I solved this by creating a folder named 0.12.0-1 inside the xpack-openocd-0.12.0-1 folder and moved all the files to it. Then I renamed the folder xpack-openocd-0.12.0-1 to xpack-openocd.
So, the final file path is the following:
01.jpg
01.jpg (33.27 KiB) Viewed 4445 times


openocd_scripts files can be stored in the scripts folder, according to your chosen platform.txt debug paths:

Code: Select all

debug.server.openocd.path={runtime.tools.xpack-openocd-0.12.0-1.path}/bin/openocd
debug.server.openocd.scripts_dir={runtime.tools.xpack-openocd-0.12.0-1.path}/openocd/scripts
debug.server.openocd.script={debug.server.openocd.scripts_dir}/{build.openocdscript}
02.jpg
02.jpg (21.34 KiB) Viewed 4445 times

I have tried it on Linux Mint 20.2 and it works too
Vassilis Serasidis
https://www.serasidis.gr
Post Reply

Return to “IDE's”