AnsweredAssumed Answered

STM32L4 USB HAL EXTI_Line35 IRQ handler for VDDUSB Detection coding???

Question asked by Kent Swan on Apr 6, 2018
Latest reply on Apr 6, 2018 by waclawek.jan

I'm using an STM32L462 and HAL CubeMX all quite successfully.  This question concerns USB Device mode handling and how to proprerly implement VDDUSB detection using EXTI_Line35.   


I need to be able to dynamically detect the insertion and removal of a USB cable to (a) execute port vs dedicated charger and (b) wake from sleep on USB connection to either a host or a dedicated charger.  When connected to a host I'm running a CDC serial port using the streaming usart driver mod I posted earlier (which works perfectly). 


I'm familiar with GPIO EXTI handling and use it frequently to detect events and for external wakeup.  That also works perfectly.


Now to the problem.   VDDUSB voltage on that pin detection is a signal defined as PVM1 which uses EXTI_Line35.  This line mapping and code generation is NOT supported in HAL or the CubeMX configuration application (it should be) My issue is that, using HAL, I'm a bit lost as to which of the 4 EXTI controllers this is mapped to and then how to set this interrupt mapping and bit detection for the IRQ_Handler.


It can't be rocket science. Would appreciate any help.