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


Receiving data over USB com port

I have created a project using STMCubeMX which includes a usbd driver configured as a virtual com port. I have it working and can receive data via the CDC_Receive_FS callback function. My question is how is this callback called. Is it done at interrupt level, or is there some other mechanism. In particular, if I want to copy the data from the callback buffer into a queue which will be read by my main code, do I need some protection for concurrency (e.g. disable interrupts)?

Thanks.

i suppose USB VCP is interrupt driven. I’m using USB HID, this is definitely interrupt driven.
Yo do need concurrency protection. Are you using FreeRTOS? FreeRTOS provides message queues with are thread safe


Thanks for the reply. I have determined that it is interrupt driven and that I need to disable interrupts when removing elements from the queue. (I am not using FreeRTOS).