2019-07-22 12:01 PM
PCB Silkscreen: MB1311C (No revision number visible)
IDE: Keil uVision 5.16a
FW: STM32Cube_FW_L4_V1.14.0
STM32CubeMX Version: 5.3.0
PC OS: WIndows 7 Ultimate 64-bit
ST VCP Driver Version: 1.5.0
I am experiencing two issues related to this error. If I need to create separate posts for each, please let me know and I apologize in advance. I am new to this processor so bear with me. Let me preface by saying that I have been able to successfully get the VCP functionality working on my devkit, but I am still experiencing intermittent issues.
Issue A. USB low-power must be enabled for USB to work. Why is this? Is this an error with STM32CubeMX?
Steps to reproduce:
After comparing the two projects created in the above steps, I see the following key differences:
I. The "Low power" project sets up the USB interrupt (below), whereas the non-low-power variant doesn't in usbd_conf.c.
/* Peripheral interrupt init */
HAL_NVIC_SetPriority(OTG_FS_IRQn, 0, 0);
HAL_NVIC_EnableIRQ(OTG_FS_IRQn);
if(pcdHandle->Init.low_power_enable == 1)
{
/* Enable EXTI Line 17 for USB wakeup */
__HAL_USB_OTG_FS_WAKEUP_EXTI_ENABLE_IT();
}
II. OTG_FS_IRQHandler() is declared in stm32l4xx_it.c (below) in the "Low-power" variant while not being declared in the non-low-power variant.
/**
* @brief This function handles USB OTG FS global interrupt.
*/
void OTG_FS_IRQHandler(void)
{
/* USER CODE BEGIN OTG_FS_IRQn 0 */
/* USER CODE END OTG_FS_IRQn 0 */
HAL_PCD_IRQHandler(&hpcd_USB_OTG_FS);
/* USER CODE BEGIN OTG_FS_IRQn 1 */
/* USER CODE END OTG_FS_IRQn 1 */
}
Any thoughts, comments, or feedback on this? Again I am new to USB on the STM32, so this might be a silly question :).
Issue B. Unplugging and plugging the USB cable into the PC multiple (5-10) times eventually results in "Unknown Device" within Device Manager.
Steps to reproduce:
Thoughts, comments, or feedback?
Thanks for any help or insight received!
Derek