STM32U5A5: PB5 and PB15 - failing (for your errata sheet?)
Dear STM team,
I am debugging the chip since hours and I think there is something wrong with the PB5 and PB15 pins:
1. SPI1 with MOSI on PB5:
I have configured SPI1 and want to get the SPI1_MOSI on PB5 (as mentioned as ALT5 in datasheet).
I use a STM32U5A5 with LQFP64 package.
Nothing comes out as MOSI (constant high, no bit pattern driven by SPI1).
But:
- if I configure PB5 as GPIO - I can toggle - OK, no shorts on PCB
- I can also use the SWAP function for SPI - now MOSI comes out on PB4 (which was MISO) - all OK (SPI1 works - MOSI is now out on PB4)
- I can also use MOSI on PA7 - also fine!
Just:
PB5 is NOT a SPI1_MOSI as mentioned in datasheet!
And: if I connect with SWAP configured (PB4 is MOSI) with PB5 (now as MISO): the waveform is damaged!
There are not anymore nice bits out of MOSI: so, the PB5 seems to be driven all the time, with something else (see below on Remarks).
2. PB15: if high - USB fails
I want to use PB15 as GPIO.
When I configure as GPIO and set as low (RESET pin value) - fine (USB comes up).
But when I set this GPIO pin PB15 to high - the USB fails! No enumeration anymore, my USB VCP UART is gone.
I have also realized: playing with these pins, setting these to the "wrong" GPIO state, it can make my debugger (SWO) failing: I can flush, but the USB VCP does not connect. The debugger stops (loses connection). I can disconnect debugger, reset the board and now VCP works (but no way to debug right after flushing the MCU).
BTW: what works on PB15 is: set it to low - the USB VCP UART comes up and the debugger is fine.|
I can toggle "later" (when all is up and running) this GPIO pin (configured as GPIO out): it works, I can set low and high without to lose USB. But just after all is up and running, not on startup (e.g. via MX_GPIO_Init();)
If PB15 is high on startup config - the USB is dead.
What is this?
Remarks
I have found in datasheet this remark:
"After reset, a pull-down resistor (Rd = 5.1 k
Ω from UCPD peripheral) can be activated on PA15 and PB15 (UCPD1_CC1, UCPD1_CC2). The pull-down on PA15
(UCPD1_CC1) is activated by high level on PB5 (UCPD1_DBCC1). The pull-down on PB15 (UCPD1_CC2) is activated by high level on PB14 (UCPD1_DBCC2).
This pull-down control (dead battery support on UCPD) can be disabled by setting UCPD_DBDIS = 1 in the PWR_UCPDR register."
I do not know what does it mean. But it sounds to me as: "PB5 and PB15 have also other special functions, related to USB" (what I see). Even I do not configure and enable UCPD (nothing with USB-C, just regular USB HS PHY for USB VCP), there seems to be a "side effect":
PB5 is never working as SPI1_MOSI and PB15 must be low for USB config/start-up.
What is wrong?
Also my impression:
if this happens, a GPIO pin seems to drive against something, or it is shorten to GND when driven high - my VDD voltage (running with 1V8) seems to drop a bit, e.g. to 1.79V (usually it is 1.804V): if this seems to happen (even USB VDD is 3V3) - the USB connection fails.
So, a "pin conflict" seems to draw a bit more current, to drop a little bit the 1V8 VDD and now it starts failing on USB. Very sensitive to run with 1V8. And hard to debug! I lose debugger in this case. OK: possible that dropping below 1V8 as VDD makes the ST-LINK debugger (external STLINK-V3SET) to fail (maybe ST-LINK issue, not the chip itself).
Please, ask your RTL designers what is going on with PB5 (for SPI1_MOSI) and PB15 (for USB function, when driven high at startup).
Thank you,

