Debug STM32 with VScode

Development environment specific, Arduino, Eclipse, VS2013,Em::Blocks etc
User avatar
RogerClark
Posts: 7693
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Debug STM32 with VScode

Post by RogerClark » Mon Jan 29, 2018 2:39 am

The RobotDyn boards are black.

Whatever makes them black does not easily scrape off

zmemw16
Posts: 1685
Joined: Wed Jul 08, 2015 2:09 pm
Location: St Annes, Lancs,UK

Re: Debug STM32 with VScode

Post by zmemw16 » Mon Jan 29, 2018 5:01 am

there some black pcb pills(?) out there without the RobotDyn marking, with a 1 to 2 factor in their price, hence the question of which :D
srp

User avatar
RogerClark
Posts: 7693
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Debug STM32 with VScode

Post by RogerClark » Mon Jan 29, 2018 8:12 pm

There are Black boards other than the RobotDyn ones, which were available long before the RobotDyn version was available.

I think perhaps 2 different existing Black Pill versions. One with links for Boot0 and Boot1, but the other versions only has a Boot0 jumper.

AFIK, these have the same issue as the Blue Pill, with the wrong USB pull up resistor circuit.

The RobotDyn version has the correct USB pull-up resistor to 3.3V.
RobotDyn were also supposed to be selling a version with the bootloader pre-installed, but they never sent me a follow up email to confirm they are actually doing that.

I will check their website and update this post ...

Update.

Looking on RobotDyn’s website, they seem to be selling a BlackPiol with the bootloader for $2.79 . It looks like it has the headers soldered on, but I am not sure if they are really doing that.

There is another STM32F103C8 listed for $1.99 but the picture is missing, so it’s hard to know if it’s the same as the one with the bootloader, but potentially not assembled and without the bootloader.

They told me in an email, that the bootloader version would be the same price , but I susoect they are charging 80 cents to install the bootloader.
Though possibly the more expensive one has the headers soldered on as well, so the 80.cents may be for both changes.

If they are changing 80 cents, for the bootloader, I better apply for the job of bootloader installed, as STLink can instal the bootloader in less than 30 seconds.
So I could earn $120 an hour plugging in boards and watching STLink upload to them.
In fact, I could run 2 Stlinks at the same time and get my wage up to $240 an hour

:D :D

zmemw16
Posts: 1685
Joined: Wed Jul 08, 2015 2:09 pm
Location: St Annes, Lancs,UK

Re: Debug STM32 with VScode

Post by zmemw16 » Mon Jan 29, 2018 10:13 pm

well i did ask :lol:
srp

caniggia
Posts: 28
Joined: Tue Dec 06, 2016 2:38 pm

Re: Debug STM32 with VScode

Post by caniggia » Thu Feb 08, 2018 12:44 pm

BennehBoy wrote:
Sun Jan 28, 2018 5:07 pm
So this has turned out to be a huge exercise in frustration, looks like due to the board options Maple Mini isn't supported for debugging (no st-link upload method?).

Compilation is tediously slow via vscode, no idea why. I have a 16 core cpu and it's doing literally 'nothing' whilst the build runs.

I really like the editor and context sensitivity, but this right now may not be practicable :(

EDIT - fixed compile times by disabling Windows Real Time protection. Would still like to get debugging working though.
To speed up compile times:

You can add for example:
"output": ".build"
to ".vscode/arduino.json" file.

More on this page:
https://marketplace.visualstudio.com/it ... de-arduino

After first compile it will add ".build" folder to your project folder with all compiled files including .bin, .elf, ...
The next time you compile it will reuse this files and compile times will be much faster.

BR
caniggia

User avatar
BennehBoy
Posts: 503
Joined: Thu Jan 05, 2017 8:21 pm
Location: Yorkshire
Contact:

Re: Debug STM32 with VScode

Post by BennehBoy » Thu Feb 08, 2018 1:43 pm

Hi,

Thanks Caniggia - I already did that, the main problem with build times was actually MS Antimalware, disabling it improved things dramatically.
-------------------------------------
https://github.com/BennehBoy

Phono
Posts: 93
Joined: Tue May 05, 2015 6:08 am
Location: Ermont, France

Re: Debug STM32 with VScode

Post by Phono » Sun Feb 11, 2018 3:05 pm

Hi,
Previous post, edited :
(I have fixed most of the problems I described, so no use to leave them in this thread)

I have installed VSCode today, and I have been using STM32 for Arduino for a while now.
I am on Windows 10.

First I am surprised that the hardware folder should be placed in documents, and moreover within the Sketched folder. Is this a mistake from the authors of the arduino extension?

Next, I am unable to start debugging. I end up with an error message "Unable to start debugging. Aucun processus n'est associé à cet objet."
Since my windows is in french, I get a mixed language message. Basically it means "no process is associated with this object".
What is the problem?

michael_l
Posts: 371
Joined: Mon Aug 24, 2015 6:11 pm

Re: Debug STM32 with VScode

Post by michael_l » Thu Feb 22, 2018 9:20 pm

When starting debug I get a note:

"Debug for board BLACK F407VE/ZE/ZG boards is not supported by now"

Seems I'm missing some configuration but what ?

vitor_boss
Posts: 66
Joined: Wed Apr 19, 2017 9:50 am

Re: Debug STM32 with VScode

Post by vitor_boss » Fri Feb 23, 2018 12:03 am

Here is some changes I've made to work.
Download https://developer.arm.com/open-source/g ... /downloads latest arm GCC
And https://sourceforge.net/projects/openoc ... cd/0.10.0/ openOCD 0.10 that is important because early versions won't work wit F4 chips
launch.json:

Code: Select all

{
    "version": "0.2.0",
    "configurations": [
    
        {
            "name": "Arduino",
            "type": "arduino",
            "request": "launch",
            "program": "${file}",
            "cwd": "${workspaceRoot}",
            "MIMode": "gdb",
            "targetArchitecture": "arm",
            "miDebuggerPath": "D:/VScode/arm-none-eabi-gcc/7.0-2017q4/bin/arm-none-eabi-gdb.exe",
            "debugServerPath": "D:/VScode/openocd/0.10.0/bin/openocd.exe",
            "debugServerArgs": "-f interface/stlink-v2.cfg -f target/stm32f4x.cfg",
            "customLaunchSetupCommands": [
                {
                    "text": "target remote localhost:3333"
                },
                {
                    "text": "file ${file}"
                },
                {
                    "text": "load"
                },
                {
                    "text": "monitor reset halt"
                },
                {
                    "text": "monitor reset init"
                }
            ],
            "stopAtEntry": true,
            "serverStarted": "Info// :// [//w//d//.]*:// hardware",
            "launchCompleteCommand": "exec-continue",
            "filterStderr": true,
            "args": []
        }
    ]
}
For others board you will need a clean "debugServerArgs: arguments

zmemw16
Posts: 1685
Joined: Wed Jul 08, 2015 2:09 pm
Location: St Annes, Lancs,UK

Re: Debug STM32 with VScode

Post by zmemw16 » Fri Feb 23, 2018 1:48 am

and there was me thinking gcc changed major issue less frequently that debian stable :)
srp

Post Reply