2018-02-05 04:23 AM
Hello, I'm facing a difficulty using CubeMx generated code with USB (CDC with VBus sensing).
HAL_GPIO_EXTI_Callback is declared as 'weak' so for managing some GPIO's interrupts, I declared my own call back to 'catch gpio's interruption' and everything works fine. Now I'm trying to add USB CDC and it appears that in usb_conf.c file, HAL_GPIO_EXTI_Callback is redefine to manage VBus detection. So now I have in my project a double declaration for this callback : in the user code and in the code generated by CubeMx.
Is there any simple way to deal with this?Thanks
#hal_gpio_exti_callback #usb-with-gpio2018-02-05 11:50 AM
You will need to combine both routines in one place, of your choice.
-- pa
2018-02-06 12:17 AM
Hello, thanks for your reply. That exactly the purpose of my question. How can I merge both routine without modifying generated code (from CubeMx).Is there some configuration or can I had some 'User code tag' to prevent overrides after an update?
2018-02-10 03:18 PM
X2 on this problem and Hassan Chiker's response. Some kind of 'User code tag' would be a great 'get out of jail free card' for all bugs like this in CubeMX.
2018-02-10 04:29 PM
Sometimes this concept of 'user code' does not work and we have to merge manually.