cancel
Showing results for 
Search instead for 
Did you mean: 

How to configure interrupts and register a callback for USB CDC receive?

Anaik.11
Associate

My project involves a STM32F1 interfacing with a Linux machine as a USB CDCACM device, where the Linux machine will send some packets that need to be received/parsed on the MCU. I'd like to configure an interrupt for when the MCU receives the data packets.

I haven't found much material on this, except for UM1734 where I wasn't able to find anything about interrupts for CDC. I also found functions for USB_LP_CAN1_RX0_IRQn interrupt configuration (HAL_NVIC_SetPriority, HAL_NVIC_EnableIRQ) in the HAL user manual which get auto generated by CubeMX, but I'm not sure how to make use of these.

Any code or pointers to relevant reference material will be helpful.

11 REPLIES 11

Thank you dear Adib

Hi Ons,

Thank you a lot. I will check it out.,