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


USB CDC and CAN not running together on STM32F103 (imported from CubeMX)

Hey, I’m sorry to disappoint you, but in F103 chip you cannot use USB and CAN at the same time. It is not clear from Reference Manual, but that’s the reality. Out of F1 family only F105/107 (Connectivity line) have a different USB peripheral arhitecture (USB OTG) so that allows to use it with CAN bus simultaneously. F3\F4 serial almost all have USB OTG so no problem with that. Out of F0 family only F072 series can have both at the same time, rest are just as limited as F103.

The reason behind this limitation is the following: there’s an internal 512b RAM buffer for storing received and sent data (since both CAN and USB are highly loaded protocols and asynchronous) which can be used either only for USB or only for CAN. CubeMX though still allows to check both peripherals for use at the same time, but in reality you will be able to use only one (only one can be initialized at the time) - the shared RAM is accessed through CAN and USB exclusively.

My suggestion is to use UART instead of USB and then add an external USB-UART converted (either smth like FT232, CH340, CP2102 or you can use another F103 chip) :-)

Screenshot from F10x reference manual, page 622 (USB) see below
Reference Manual

 

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