2018-03-02 09:48 AM
Hi,
i have a STM32L475 with USB OTG as Host with USB Disk attached and an GPIOInt with callback void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin).
If i build my HAL without USB all is ok, but when i build it with USB Support, the callback is never called anymore.
Can anybody help me (I have tested to set the usb Priority to 1 and the GPIOInt to 0 but it had failed).
Best Regards
Brian
#gpio-interrupt #usb-msc-device #stm32-l4Solved! Go to Solution.
2018-03-03 01:06 AM
I use the rtc.
So that's probably source of the problem - PC13 is used for various RTC functions when it overrides the GPIO settings (and then possibly disconnects also from EXTI, although this is not described clearly in the manual). See GPIOs controlled by the RTC subchapter in RTC chapter of Reference Manual.
2018-03-02 12:33 PM
Which pin?
Read out and check relevant GPIO and EXTI registers.
JW
2018-03-02 01:00 PM
Pin PC13 Configured as GPIO_EXTI13, External Interrupt Mode Rising Edge.
The Registers:
GPIO:
MODE13=00
MODER13=IN(00)
OT_13=FALSE
OSPEED13=00
OSPEEDR13=GPIO_Low_Speed(00)
PUPD13=00
PUPDR13=GPIO_Puipd_NOPULL(00)
ID13=FALSE
IDR13=FALSE
ODR13=FALSE
OD13=FALSE
BR13=FALSE
BS13=FALSE
LCK13=FALSE
AFSEL13=0
BR13=FALSE
BR_13=FALSE
ASC13=FALSE
EN_13=FALSE
EXTI:
IM13=TRUE
EM13=FALSE
RT13=TRUE
FT13=FALSE
SWI13=FALSE
PIF13=FALSE
I hope that thats all...
Best regards
Brian
2018-03-02 01:49 PM
Ok when i set
EXTI_SWIER1.SWI13
= true, then the callback is called with the right GPIO_Pin....The IDR Register isn't changed if i press the button...
Who supress it???
Best regards
Brian
2018-03-02 02:29 PM
No it is on the Board B-LE475-iot the user button, and if i use a simple test Programm, than it is all functional...
I use the rtc...all other are connected
2018-03-02 02:37 PM
Humm.
Is SYSCFG_EXTICR4.EXTI13 set properly?
If you now toggle the pin, do you see GPIOC_IDR.ID13 to toggle? Do you see EXTI_PR1.PIF13 come true on the rising edge? If not, does writing one to EXTI_SWIER1.SWI13 trigger the interrupt?
PC13 is a RTC pin in the VBAT domain. Do you use RTC? Are VDDA/VSSA//VBAT properly connected?
JW
2018-03-02 03:02 PM
PC13 is a RTC pin in the VBAT domain. Do you use RTC? Are VDDA/VSSA//VBAT properly connected?
Broken button? DIsconnected button from pin? Button trace shorted to a grounded signal?
JW
2018-03-02 11:45 PM
Ok i have used PB9 and that works...
2018-03-03 01:06 AM
I use the rtc.
So that's probably source of the problem - PC13 is used for various RTC functions when it overrides the GPIO settings (and then possibly disconnects also from EXTI, although this is not described clearly in the manual). See GPIOs controlled by the RTC subchapter in RTC chapter of Reference Manual.