2026-02-02 11:48 PM
Hi, I use the stm32f103 to read the IMU(BNO055) via I2C to get the Quaternion data,
I use this library from ivyknob, https://github.com/ivyknob/bno055_stm32
The AR Anchors result is well (Head Mount Display application), I use the USB VCP to Transmit the BNO055 Quaternion data to PC or SBC, using the function CDC_Transmit_FS. But I face a problem immediately, the transmit speed is 100Hz, it will caused the USB_BUSY(race condition), I try some methods, such as add delay in the while loop, using timer interrupt and flag to limit the transmit speed, avoid using sprintf function, it could not solve this problem. As the picture shown below, Tx could write the data from STM32 to PC, but Rx could not write the data from PC to STM32
Files include the main.c and usbd_cdc_if.c
Could you give me some advices to resolve this problem.
Thank you
Best Regard Steve