cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H747I-DISCO: USB Host (FS device on CN1) conflicts with TouchGFX / SDRAM – any reference projects?

Neuman
Associate II

Hello,

I am using an STM32H747I-DISCO with the MB1166-A09 display and a standard TouchGFX project.

I want to run the board as USB Host on CN1 (USB OTG HS, ULPI PHY) and connect a USB Full-Speed device (STM32H503 Nucleo running in device mode).
VBUS is forced ON via ULPI_D0 and works fine in a non-TouchGFX project.

However, as soon as I add USB Host to a TouchGFX project:

  • The display becomes black

  • TouchGFX no longer renders

  • CubeMX reports conflicts with FMC (SDRAM) when USB OTG HS is enabled

TouchGFX works without USB, and USB works without TouchGFX, but not together.
It looks like USB HS (ULPI) and TouchGFX (DSI + SDRAM) conflict, possibly due to clocks or FMC being partially disabled.

Question:
Are there any reference projects or examples where TouchGFX and USB Host on CN1 coexist correctly on STM32H747I-DISCO?
Is this a known limitation?

Thanks in advance.

1 REPLY 1
franticspider787
Associate

Hey

I took a quick look at the schematic:  https://www.st.com/resource/en/schematic_pack/mb1248-h747i-d03-schematic.pdf

You might also need to look through the DISCO user's manual:  https://www.st.com/resource/en/user_manual/um2411-discovery-kit-with-stm32h747xi-mcu-stmicroelectronics.pdf

Looks like there's no conflict with CPU pins.  Not sure about clock setup / FMC setup -- you'll need to look through your setup with CubeMX.

One thing I've run into is interrupt priority, especially if you've got FreeRTOS running in there also.

What I've found that works for me is:

TIM6 (used by FreeRTOS as the sys_tick) is set to NVIC priority 4.  FreeRTOS priority scheme allows IRQs to be between 5 and 15.  Note:  FreeRTOS docs state that context switching should be *lowest* priority interrupt.  The ST implementation seems to take the high-priority TIM6 and then activates the "pendable request for system service" at priority 15 to run after the TIM6 runs.  TIM6 must be at highest priority as some of the HAL libraries depend on it not being blocked by anything in the RTOS or application.

The two required IRQs for TouchGFX are set to priority 7.  That would be DMA2D and LTDC.  Per somewhere, these two must be on the same priority level.

Not sure if these make any difference, but I put DSI and MDMA to priority 6.  All other interrupts are at priority 5.

The blank screen seems directly related to TIM6 being set to 5 or below (higher numbers).  Only with TIM6 at priority 4 and lower can I get TouchGFX to run with other interrupts happening.