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


STM32F103 USB CDC Device stops working in debug state

I have an application I’m developing on a STM32F103RCT6 derived from STM CubeMX (STM32Cube_FW_F1_V1.6.0 )
It includes a CDC Transmit function that periodically sends data to the PC.

I want to debug code unrelated to the CDC function.
When I enter debug the transmissions stop Doesn’t seem to need to hit a break point to do this.
If I resume program execution, nothing comes out of the USB anymore the host computer states the USB has a problem, the port is closed and can’t be reopened.

I still have to figure out exactly where the F103 code ends up.
If I power cycle the F103 it starts emitting again, but dgb drops out.

Can a STink V2 and a CDC virtual com port co exist on the same computer?
Computer is a windows 10 with the “windows inbox driver” for CDC and the SW4STM32 driver for the STlink.

Is there anything I need to do in the Debug Configuration to stop USB falling over when entering debug mode?
I’m new to this environment and usually debug by trial and error...

Thanks,
Nick.

So,
Looks like powering up the CPU prior to establishing a USB connection is problematic.

If I disconnect the power connection between Stink and the target, power the target via the USB lead it sort of works... intermittently...
a) Flash target over Stink
b) Enter debug perspective and start the debugger
c) Remove USB cable between target and host computer - debugger will report connection lost in the console window
d) Plug in target USB cable - debugger sometimes throws an error about a void pointer in some java file, dismiss dialog box.
e) Place a break point after all the cubemx generated initialisation code and allow the program to run to that point.
f) In windows 10, computer management, device management page - Menu action - scan for hardware changes
g) Open Terminal program - I’m using Realterm - and connect to COM device.
h) Place break point in CDC_Receive_FS in usbd_cdc_if.
i) Type something in Realterm - the code breaks in the reception routine - nice. biggrin
j) Step though, hunt down your bugs

Typing into the terminal whilst CPU is halted will stuff things up.
Leaving the target powered via Stink then unplugging USB and reconnect USB will stuff things up.
Recompiling and reflashing code requires you to start at step a.

Some times it all turns to sh!t, nothing responds and seems the only way out is a restart of the computer.


 

Newest Forum Posts

  1. Монтаж камина с грилем в Москве - установка и барбекю by KpddomErorb, 2025-05-10 18:28
  2. SPI on Nucleo_STMH533RE by royjamil, 2025-05-04 20:13
  3. SPI on Nucleo_STMH533RE by higginsa1, 2025-03-25 07:37
  4. SPI on Nucleo_STMH533RE by royjamil, 2025-03-23 11:31
  5. SPI on Nucleo_STMH533RE by higginsa1, 2025-03-23 09:33
  6. Configuring DMA for ADC in SW? by sam.hodgson, 2025-03-04 12:58
  7. Build a project in "release" mode by info@creosrl.it, 2025-02-20 18:12
  8. Build a project in "release" mode by info@creosrl.it, 2025-02-20 17:05
  9. Build a project in "release" mode by tang, 2025-02-20 10:36
  10. Build a project in "release" mode by info@creosrl.it, 2025-02-19 17:35

Last-Modified Blogs