No interrupt generated on USB device connection while USB OTG_FS core is running as USB host only
Posted: Thu Jan 10, 2019 6:01 pm
Hi,
I am testing the USBHv1 driver which, as I understood, is setting the USB OTG_FS core to run as USB host only. Unfortunately, no interrupt is generated when I plug a USB device into the user USB port on the following two ST boards: Discovery STM32F4259I-DISC1 (MCU STM32F429ZITx) and Nucleo-144 STM32L496ZG.
Hopefully, I put my hands on a Discovery STM32F4-Discovery board (MCU STM32F407VGTx), the one board on which the "USB_HOST" sample program was tested. On that board, the USBHv1 driver is working correctly since I got a host port interrupt (HPRTINT bit in OTG_FS_GINTSTS register) and the bit which tells that a USB device is connecting is set (PCDET bit in OTG_FS_HPRT register).
I modified the "USB_HOST" sample program in order to be able to switch quickly between the two Discovery boards (the one working and the one not working). I tried to compare the values of the relevant registers to my eyes (OTG_FS related registers, clock registers, NVIC registers, etc.) but did not find any main differences. I also checked that clocks were correctly set and did not find any issues between the two boards.
I join the source code of my modified "USB_HOST" program which contains the board files for STM32F4-Discovery and STM32F4259I-DISC1. You can just uncomment two lines in the makefile (one to include the board and one to define the linker script) to switch from one Discovery board to the other. I also added two threads to make the green and red LEDs flash when the program is running.
Do you have the possibility to test that program on the same boards as me ?
Thanks for the help,
I am testing the USBHv1 driver which, as I understood, is setting the USB OTG_FS core to run as USB host only. Unfortunately, no interrupt is generated when I plug a USB device into the user USB port on the following two ST boards: Discovery STM32F4259I-DISC1 (MCU STM32F429ZITx) and Nucleo-144 STM32L496ZG.
Hopefully, I put my hands on a Discovery STM32F4-Discovery board (MCU STM32F407VGTx), the one board on which the "USB_HOST" sample program was tested. On that board, the USBHv1 driver is working correctly since I got a host port interrupt (HPRTINT bit in OTG_FS_GINTSTS register) and the bit which tells that a USB device is connecting is set (PCDET bit in OTG_FS_HPRT register).
I modified the "USB_HOST" sample program in order to be able to switch quickly between the two Discovery boards (the one working and the one not working). I tried to compare the values of the relevant registers to my eyes (OTG_FS related registers, clock registers, NVIC registers, etc.) but did not find any main differences. I also checked that clocks were correctly set and did not find any issues between the two boards.
I join the source code of my modified "USB_HOST" program which contains the board files for STM32F4-Discovery and STM32F4259I-DISC1. You can just uncomment two lines in the makefile (one to include the board and one to define the linker script) to switch from one Discovery board to the other. I also added two threads to make the green and red LEDs flash when the program is running.
Do you have the possibility to test that program on the same boards as me ?
Thanks for the help,