Question
USB SOF interrupt not working :(
Posted on February 01, 2016 at 13:37
Hi,
MCU : STM32F303RBT6 Library : STM32Cube_FW_F3_V1.4.0 () I want to use USB SOF (Start Of Frame) as 1ms timer to send usb datas. With the old standard library, it's works perfectly. So, I've set my function address inside the USBD_ClassTypeDef structure as described below. The device is well recognized by the host, but the interrupt occurs only one time, then no more happens ... Is something wrong in my code, or did I forget something ? Thanks for reply [code] // Low layer callback void HAL_PCD_SOFCallback(PCD_HandleTypeDef *hpcd) { USBD_LL_SOF(hpcd->pData); } // my SOF function uint8_t USBD_TMC_SOF(USBD_HandleTypeDef *pdev) { static uint32_t sof_counter = 0; if (sof_counter++>=5) { HAL_GPIO_TogglePin(GPIOA, GPIO_PIN_8); sof_counter = 0; } return USBD_OK; } // structure const USBD_ClassTypeDef USBD_TMC = { USBD_TMC_Init, USBD_TMC_DeInit, USBD_TMC_Setup, NULL, /*EP0_TxSent*/ NULL, /*EP0_RxReady*/ USBD_TMC_DataIn, /*DataIn*/ USBD_TMC_DataOut, /*DataOut*/ USBD_TMC_SOF, /*SOF */ NULL, NULL, USBD_TMC_ConfigDescriptor, USBD_TMC_ConfigDescriptor, USBD_TMC_ConfigDescriptor, NULL, }; [/code] #stm32-usb-sof