Page 3 of 5

Re: Arduino IDE 2 & Debug feature

Posted: Fri Feb 17, 2023 3:20 pm
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 😉

Re: Arduino IDE 2 & Debug feature

Posted: Fri Feb 17, 2023 3:29 pm
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 6793 times

Re: Arduino IDE 2 & Debug feature

Posted: Fri Feb 17, 2023 5:49 pm
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

Re: Arduino IDE 2 & Debug feature

Posted: Sat Feb 18, 2023 10:43 am
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.

Re: Arduino IDE 2 & Debug feature

Posted: Sat Feb 18, 2023 12:22 pm
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?

Re: Arduino IDE 2 & Debug feature

Posted: Sat Feb 18, 2023 12:34 pm
by fpiSTM
We will investigate that. Anyway as stated it seems debug support is not easily customizable.

Re: Arduino IDE 2 & Debug feature

Posted: Sat Feb 18, 2023 5:22 pm
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 6626 times

Re: Arduino IDE 2 & Debug feature

Posted: Sun Feb 19, 2023 9:28 am
by Vassilis
@fpiSTM I am confused. I really don't know what you are trying to do. Can you please explain your thoughts?

Re: Arduino IDE 2 & Debug feature

Posted: Sun Feb 19, 2023 11:01 am
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.

Re: Arduino IDE 2 & Debug feature

Posted: Sun Feb 19, 2023 1:20 pm
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 6667 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 6667 times

I have tried it on Linux Mint 20.2 and it works too