cancel
Showing results for 
Search instead for 
Did you mean: 

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

Kent Swan
Senior
Posted on April 06, 2018 at 00:55

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.

#vddusb #stm32cubemx #stm32l4 #usb-device #exti-handler
1 REPLY 1
Posted on April 06, 2018 at 08:15

What are ''the 4 EXTI controllers''? Is this some Cube concept? I don't Cube, but maybe this is of some help:

0690X0000060AKGQA2.png

plus the table on the following page; and then the 49  HAL PWR Generic Driver and 50  HAL PWR Extension Driver chapters.

JW