Author Topic: STM32, Visual Studio Code and STM32CubeMX  (Read 14769 times)

0 Members and 1 Guest are viewing this topic.

Offline panossTopic starter

  • Frequent Contributor
  • **
  • Posts: 325
  • Country: gr
Re: STM32, Visual Studio Code and STM32CubeMX
« Reply #50 on: May 25, 2019, 07:23:59 am »
Which is the OpenOCD 's directory?
I found an openocd.js (probably this is not the executable, right?) at: C:\Users\Panto\.vscode\extensions\marus25.cortex-debug-0.2.6\out\src
I put it in the PATH variable, but I get the same error.

(aslo in the same folder, among other files, there is one named 'gdb.js')
« Last Edit: May 25, 2019, 07:27:10 am by panoss »
 

Offline Freddie Chopin

  • Regular Contributor
  • *
  • Posts: 71
  • Country: pl
Re: STM32, Visual Studio Code and STM32CubeMX
« Reply #51 on: May 25, 2019, 07:31:59 am »
Well, if you did not install/extract OpenOCD in your system, then you definitely don't have it. It doesn't come with vscode as well as it doesn't come with the toolchain. You can get OpenOCD for Windows from my personal webpage at http://www.freddiechopin.info/pl/download/category/4-openocd . Just extract it anywhere you want and add .../bin or .../bin-x64 folder to your system's PATH variable (just as you did with the compiler executables).
 
The following users thanked this post: panoss

Offline panossTopic starter

  • Frequent Contributor
  • **
  • Posts: 325
  • Country: gr
Re: STM32, Visual Studio Code and STM32CubeMX
« Reply #52 on: May 25, 2019, 07:43:50 am »
I did as you said (I put the extracted folder in C:\Program Files), put it in the PATH, run it (debug).
A message appeared asking me to give permission for OpenOCD.exe to run. This means it found the OpenOCD.exe.
But then again the same error message!
'Failed to launch OpenOCD GDB server. Timeout'!!

(I see no GDB.exe or something similar in folder openocd-0.10.0)
« Last Edit: May 25, 2019, 07:47:33 am by panoss »
 

Offline Freddie Chopin

  • Regular Contributor
  • *
  • Posts: 71
  • Country: pl
Re: STM32, Visual Studio Code and STM32CubeMX
« Reply #53 on: May 25, 2019, 07:57:54 am »
Try running this in your terminal to see the exact error message (or there's a tab somewhere in vscode which has the output of OpenOCD - go to Output tab [near Terminal, Problems and so on], from the combobox select Adapter Output). Do you have the debugger connected? Is it properly detected by your system? Did you install any drivers for it? Is it visible in Devices Manager? Did you give the permission for OpenOCD to run? Did you try running the session again?

Why do you expect GDB to be part of OpenOCD when it is a part of the toolchain and already present in your system.

Don't get me wrong, but it really appears that you are doing everything without any thinking at all... Using vscode for MCU development is definitely possible, but there are a couple of rough edges here and there - maybe not significantly more than in Eclipse, but Eclipse is well known and covered by million tutorials, while in vscode this is all new - so it is not something I would recommend for a total beginner.
« Last Edit: May 25, 2019, 08:01:16 am by Freddie Chopin »
 

Offline panossTopic starter

  • Frequent Contributor
  • **
  • Posts: 325
  • Country: gr
Re: STM32, Visual Studio Code and STM32CubeMX
« Reply #54 on: May 25, 2019, 08:16:15 am »
Try running this in your terminal to see the exact error message (or there's a tab somewhere in vscode which has the output of OpenOCD - go to Output tab [near Terminal, Problems and so on], from the combobox select Adapter Output).
This is what I get:
Quote
Open On-Chip Debugger 0.10.0
Licensed under GNU GPL v2
For bug reports, read
   http://openocd.org/doc/doxygen/bugs.html
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
adapter speed: 1000 kHz
adapter_nsrst_delay: 100
none separate
srst_only separate srst_nogate srst_open_drain connect_deassert_srst
Info : Unable to match requested speed 1000 kHz, using 950 kHz
Info : Unable to match requested speed 1000 kHz, using 950 kHz
Info : clock speed 950 kHz
Error: open failed
in procedure 'init'
in procedure 'ocd_bouncer'



Do you have the debugger connected? Is it properly detected by your system? Did you install any drivers for it? Is it visible in Devices Manager? Did you give the permission for OpenOCD to run? Did you try running the session again?
I have not the debugger yet, as I 've already mentioned I' m waiting for it to come.

Why do you expect GDB to be part of OpenOCD when it is a part of the toolchain and already present in your system.

Don't get me wrong, but it really appears that you are doing everything without any thinking at all... Using vscode for MCU development is definitely possible, but there are a couple of rough edges here and there - maybe not significantly more than in Eclipse, but Eclipse is well known and covered by million tutorials, while in vscode this is all new - so it is not something I would recommend for a total beginner.
I don't get you wrong, don't worry. You are right.
I should not have tried VS Code. I thought it was just another way, I did not expect it to be something so hard.
I thought in 5 minutes I would have finished! ;D

So, please tell me what would you suggest for me to use?
I would like to avoid something 'heavy' as my pc is not very 'strong'.
So should I go for something like eclipse + some plugins?
« Last Edit: May 25, 2019, 08:18:31 am by panoss »
 

Offline Freddie Chopin

  • Regular Contributor
  • *
  • Posts: 71
  • Country: pl
Re: STM32, Visual Studio Code and STM32CubeMX
« Reply #55 on: May 25, 2019, 08:23:25 am »
Quote
I have not the debugger yet, as I 've already mentioned I' m waiting for it to come.
Then what you see is perfectly fine and expected. OpenOCD will not start without the debugger and GDB will not start without OpenOCD. Until you get your debugger it will not work no matter what you try. Once you connect it, everything should be fine.

Quote
I should not have tried VS Code. I thought it was just another way, I did not expect it to be something so hard.
I thought in 5 minutes I would have finished!

So, please tell me what would you suggest for me to use?
I would like to avoid something 'heavy' as my pc is not very 'strong'.
So should I go for something like eclipse + some plugins?
If you like vscode, you can leave it - at this stage you have everything set-up (at least it seems so) and working. If you want something which can be done in 5 minutes your only option is some vendor-supplied IDE like STM32CubeIDE or Atollic. Or you can go with Eclipse (which is heavy when compared to vscode), but this is not very different from vscode in the regard of potential problems - the only advantage is that there are much more resources about Eclipse than you can find about vscode.
 

Offline panossTopic starter

  • Frequent Contributor
  • **
  • Posts: 325
  • Country: gr
Re: STM32, Visual Studio Code and STM32CubeMX
« Reply #56 on: May 25, 2019, 08:26:35 am »
Eclipse (which is heavy when compared to vscode)
This is the main reason I chose VS Code, because it 's 'light'.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf