I have created a project in CubeMX 4.19.0 for the STM32L476JGY (Firmware package 1.6.0) in which I have a USB device in CDC mode. The code was generated for SW4STM32. Communication with a PC works fine for both RX and TX.
Now I added a GPIO in interrupt mode to my design and implemented HAL_GPIO_EXTI_Callback in my user code. Oups... The compiler says I have multiple definition of 'HAL_GPIO_EXTI_Callback'.
I found that CubeMX has generated some code for HAL_GPIO_EXTI_Callback in usbd_conf.c even though VBUS sensing parameter is set to DISABLED and no GPIO_PIN_9 is defined in my design. Here is the code generated by CubeMX:
* @brief GPIO EXTI Callback function
* Handle USB VBUS detection upon External interrupt
* @param GPIO_Pin
* @retval None
void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)
if (GPIO_Pin == GPIO_PIN_9)
Which USB parameter setting should I change in CubeMX so that the HAL_GPIO_EXTI_Callback function is not generated in usbd_conf.c?