I can't initialize PB12 (STM32H743ZIT6) for Input NoPull if I would initialize USB HS to.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-02-12 07:31 AM
I generated the code with cubeIDE.
PB12 would be a digital input. I pulled down this an 100kOhm resistor to GND.
I don't connect any else to this pin yet.
I measured this pin around 2,6V-2,8V.
I tried several panels and the promlem is the same.
Somebody met this bug before?
Thanks
- Labels:
-
STM32CubeIDE
-
STM32H7 Series
-
USB
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-02-12 09:50 AM
In some STM32 models, USB PHY overrides the GPIO settings. This is undocumented and unacknowledged by ST, but has been reported here several times already, I'm lazy to look it up now. This may be the same case.
JW
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-02-15 11:54 PM
Well, USB-HS uses ULPI interface, and PB12 is used for data exchange in ULPI, so your question sounds a bit stupid... .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-02-16 01:20 AM
This stems from ST's inability to establish a solid nomenclature for the USB OTG modules and their PHY. In 'H7 datasheets (the pinmux table), they kinda' started in the right direction by marking them OTG1 and OTG2, but then they ignore this nomenclature in names of individual signals in the very same table. No wonder they also in CubeMX ignore this own nomenclature, adding more and more names, promoting further the confusion they introduced in earlier models.
In 'H743, OTG1 - which in CubeMX is apparently called USB_HS - can use both external ULPI (which traditionally is called HS but may be capable of FS, too) and its internal PHY for FS-only. PBere obviously chose using the internal PHY, as witnessed by DP/DM being assigned to PB14/PB15, leaving PB12 free - unless the 'H7 suffers from the plague of PHY overriding the GPIO settings (PB12 is OTG1 PHY's ID pin).
JW
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-02-16 03:55 AM
In any case, read out the GPIOB registers and check their setting for PB12.
JW
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-02-17 02:16 AM
Thanks every answers!
I configurated USB-OTG-HS with Internal FS Phy in Device_Only.
I did not set up PB12 ULPI-D5 manually. (But I checked the code if I will set up. Just in this case I saw PB12 setup for ULPI-D5 in USB config function.)
I checked the GPIO registers in Debug:
Before USB init: (PB12 initialised input-floating)
MODER.MODE12==0 -->INPUT
OTYPER.OT12==0 -->OUT PP (reset state)
PUPDR.PUPD12==0 -->FLOATING
IDR.IDR12==0 -->0V
ODR.ODR12==0 -->0V
LCKR.LCK12==0 -->NOT LOCKED
AFRH.AFSEL12==0 -->AF0
After USB init: (PB12 initialised input-floating -- excepd PB12 pin measured voltage:2.7V)
MODER.MODE12==0 -->INPUT
OTYPER.OT12==0 -->OUT PP (reset state)
PUPDR.PUPD12==0 -->FLOATING
IDR.IDR12==1 -->2.7V
ODR.ODR12==0 -->2.7V
LCKR.LCK12==0 -->NOT LOCKED
AFRH.AFSEL12==0 -->AF0
After USB init and reinitialise PB12: (PB12 initialised input-floating -- excepd measured voltage:2.7V)
MODER.MODE12==0 -->INPUT
OTYPER.OT12==0 -->OUT PP (reset state)
PUPDR.PUPD12==0 -->FLOATING
IDR.IDR12==1 -->2.7V
ODR.ODR12==0 -->2.7V
LCKR.LCK12==0 -->NOT LOCKED
AFRH.AFSEL12==0 -->AF0
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-02-17 03:14 AM
Can you please
- try to switch on the internal pulldown, and measure the output (don't need to write code, you can do it in the debugger alone); perhaps also try to attach an external pulldown, various values, try perhaps 10kOhm and 1kOhm
- try to change the pin to GPIO Output and observe if it follows changes in ODR
- try to disable USB's PHY (set OTG_GCCFG.PWRDWN to 0) and measure the pin's output
Thanks,
JW
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-02-18 12:16 AM
Sorry, I neither like nor use STMcube ... I cannot give you answers on such detail questions ... STMcube has "deep and tricky dungeons" in the software, it is always difficult to judge what is happening there ... .
But I use USB-HS in HiSpeed mode together with much other peripherals ... and all running VERY nice - STMH7 is really a very nice controller family (STMcube free :)).