Loading...
 

Zephyr project on STM32

   Zephyr Workbench, a VSCode extension to manage Zephyr on STM32.
It enables users to easily create, develop, and debug Zephyr applications.
Main features:
  • Install host dependencies.
  • Import toolchain and SDK.
  • Create, configure, build and manage apps.
  • Debug STM32.
You can directly download it from the VSCode marketplace
For more details, visit the Zephyr Workbench

System Workbench for STM32


Failure to launch

I am targeting the STM32F407VGTx on the STM32F4Discovery board
This project was created as a new C++ project but it refuses to launch the debugger.
I am using a good USB cable - whats remains to do?

Tunisia
could you please attach openocd log, to identify the problem

Thx, I am looking for it.... Do you have any idea where I might find it?....

EDIT, Window->Show view->Error log->(double click most recent entry at top of list)

eclipse.buildId=4.4.2.M20150204-1700
java.version=1.8.0_40
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_GB
Framework arguments: -product org.eclipse.epp.package.cpp.product
Command-line arguments: -os win32 -ws win32 -arch x86 -product org.eclipse.epp.package.cpp.product

org.eclipse.cdt.dsf.gdb
Error
Wed Apr 13 15:40:59 BST 2016
Error in final launch sequence

org.eclipse.core.runtime.CoreException: Failed to execute MI command:
-target-select remote localhost:3333

Error message from debugger back end:
Remote communication error. Target disconnected.: No error.
at org.eclipse.cdt.dsf.concurrent.Query.get(Query.java:115)
at org.eclipse.cdt.dsf.gdb.launching.GdbLaunchDelegate.launchDebugSession(GdbLaunchDelegate.java:235)
at org.eclipse.cdt.dsf.gdb.launching.GdbLaunchDelegate.launchDebugger(GdbLaunchDelegate.java:109)
at org.eclipse.cdt.dsf.gdb.launching.GdbLaunchDelegate.launch(GdbLaunchDelegate.java:97)
at fr.ac6.mcu.debug.launching.MCUGDBJtagDSFLaunchConfigurationDelegate.launch(MCUGDBJtagDSFLaunchConfigurationDelegate.java:101)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:885)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:739)
at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:1039)
at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1256)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Caused by: java.lang.Exception: Remote communication error. Target disconnected.: No error.
at org.eclipse.cdt.dsf.mi.service.command.AbstractMIControl$RxThread.processMIOutput(AbstractMIControl.java:926)
at org.eclipse.cdt.dsf.mi.service.command.AbstractMIControl$RxThread.run(AbstractMIControl.java:755)


EDIT more...

Open On-Chip Debugger 0.10.0-dev-00267-g884c33c (2016-03-16-12:22)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Info : auto-selecting first available session transport “hla_swd”. To override use ‘transport select ‘.
adapter speed: 300 kHz
adapter_nsrst_delay: 100
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
srst_only separate srst_nogate srst_open_drain connect_assert_srst
srst_only separate srst_nogate srst_open_drain connect_assert_srst
Info : Unable to match requested speed 300 kHz, using 240 kHz
Info : Unable to match requested speed 300 kHz, using 240 kHz
Info : clock speed 240 kHz
Info : STLINK v2 JTAG v14 API v2 SWIM v0 VID 0x0483 PID 0x3748
Info : using stlink api v2
Info : Target voltage: 2.891838
Info : stm32l1.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : accepting ‘gdb’ connection on tcp/3333
adapter speed: 300 kHz
stm32l1.cpu: target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x080054b0 msp: 0x20020000
STM32L: Enabling HSI
adapter speed: 2000 kHz
Warn : Cannot identify target as a STM32L family.
Error: auto_probe failed
Error: Connect failed. Consider setting up a gdb-attach event for the target to prepare target for GDB connect, or use ‘gdb_memory_map disable’.
Error: attempted ‘gdb’ connection rejected



My new project target was setup as a STM32F4DISCOVERY boards, MCU STM32F407VGTx and it shows that setting in the Target Tab
Why does it insist I am targeting an STM32L Series?

I have posted the log by editing the previous post.
Why does OpenOCD insist the target is an STM32L series - should be STM32F4 ?
(I will check the .cfg file if I can locate it...)

SOLVED IT

see attached picture.
Somehow the debugger was using
. (o) Use Default Script
and using script:
. stm32f4discovery.cfg
which seems fine but it is better to use
. (o) Manual Spec (NOT (o) Use default script)
. Debug device: ST-LinkV2
. Debug Interface: SWD
..since the ST-LinkV2 interface is provided on the F4Discovery board!! And it works. Thanks for looking.


Make sure you have the ST-LINK V2 software installed.

When you attach it you should get a new removable drive (like a USB Flash drive) added to your system.

In the device manager you should get a “Universal Serial Bus Devices” -> “STMicroelectronics STLink dongle” device.

You should also get a “Ports (COM & LPT)” -> “STMicroelectronics STLink Virtual COM Port” device.

The “ST Visual Programmer” should recognize it and be able to read from it.

-Matt


Tunisia

Instead you have to check your debug configuration :
Menu > Run > Debug Configuration > select your config
in Main (TAB) make sure that the correct Project is selected
in Debugger (TAB) make sure that stm32f4discovery.cfg (or stm32f407g_disc1.cfg) is selected as default script
if not you have to check your project target (project properties > C/C++ Build > Settings > Target (TAB))

Edit:
Sorry I have answered without refreshing the browser, so I haven’t remarqued that your issue is solved.

Regards,
Tarek

Thank you all for your help - VERY much appreciated.

Bob


Analysis:
when
(o) Use defult script
is used (see picture in post #5) there are at least 2 stm32f4discovery.cfg files in AC6 that could be used - they are different;

C:\Ac6\SystemWorkbench\plugins\fr.ac6.mcu.debug_1.8.0.201603291114\resources\openocd\scripts\board
containing;
source [[find interface/stlink-v2.cfg]]
transport select hla_swd
source [[find target/stm32f4x.cfg]]
reset_config srst_only

C:\Ac6\SystemWorkbench\plugins\fr.ac6.mcu.debug_1.8.0.201603291114\resources\openocd\scripts\st_board
containing;
source [[find interface/stlink-v2.cfg]]
source [[find target/stm32f4x_stlink.cfg]]
# use hardware reset, connect under reset
reset_config srst_only srst_nogate

it is NOT possible to see or control which is used from the dialog - since the browse button is grey.
the openocd console output/log also does not seem to show which is used.


 

Newest Forum Posts

  1. SPI on Nucleo_STMH533RE by royjamil, 2025-05-04 20:13
  2. SPI on Nucleo_STMH533RE by higginsa1, 2025-03-25 07:37
  3. SPI on Nucleo_STMH533RE by royjamil, 2025-03-23 11:31
  4. SPI on Nucleo_STMH533RE by higginsa1, 2025-03-23 09:33
  5. Configuring DMA for ADC in SW? by sam.hodgson, 2025-03-04 12:58
  6. Build a project in "release" mode by info@creosrl.it, 2025-02-20 18:12
  7. Build a project in "release" mode by info@creosrl.it, 2025-02-20 17:05
  8. Build a project in "release" mode by tang, 2025-02-20 10:36
  9. Build a project in "release" mode by info@creosrl.it, 2025-02-19 17:35
  10. Fail to debug in Win 11 C/C++ by mortenlund, 2024-12-26 20:27

Last-Modified Blogs