AnsweredAssumed Answered

STM32F302CB Problems with USB

Question asked by Andriy Mark on Apr 5, 2018
Latest reply on Apr 7, 2018 by waclawek.jan


I'm trying make USB custom HID with stm32f302CB. I'm using Keil v5.23 and STM32CubeMX. The problem: PC just don't recognize the USB, when i running in debug mode i saw something strange. Just after calling HAL_PCD_Init interrupt executing. In HAL_PCD_IRQHandler from there we go to HAL_PCD_ResetCallback. Thet calbek must config USB_EP0R register to config default endpoint. It perform by HAL_PCD_EP_Open. Ther are macros PCD_SET_EPTYPE thet write in USB_EPnR  but in peripheral viewer they doesnt change. It's strange because others USB registers are writing normally. I'm trying write UART_EP0R by my own but it's doesn't work either. In RCC_APB1ENR USBEN is set.

Im trying to create same USB HID on STM32F407 Discovery with Keil and CubeMX and it works fine. 

Does someone have an idea where the problem could be?