2024-01-26 05:37 AM - last edited on 2024-01-26 07:01 AM by SofLit
Hello,
I'm experiencing a problem with PB6 pin on STM32G474 MCU when any type of reset occurs. The pin goes low for the whole duration of the reset pin being low, and stays low to around when the FDCAN is initalized. This is a significant issue, as it causes error frames to be sent whenever such device is restarted while connected to a working CAN bus.
I thought it might be linked to the UCPD Dead battery feature (UCPD1_CC1) - indeed a fresh project without the HAL_PWREx_DisableUCPDDeadBattery(); does not pull the PB6 pin low, however adding this call causes the low state to occur while under reset. The same goes when a FDCAN init is used. It looks as if whatever peripheral touched the PB6 the problem shows up.
Did anyone experienced anything like this?
Solved! Go to Solution.
2024-02-13 02:14 AM
Hello @Wasilewski.Piotr
During reset, the ultimate solution would be to pull down PA9 by HW.
PB4_PUPEN OB is only considered for category 4 devices.
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2024-01-26 08:41 AM
Hello @Wasilewski.Piotr
Is it possible to reproduce using reference board nucleo or eval and simple loopback example FDCAN? If not, could you check the surrounding circuitry in the layout.
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2024-01-29 12:43 AM
Sure - the only thing I have to do to reproduce is run an empty project with FDCAN2 remapped to PB5 and PB6.
I noticed the problem is directly linked to PA9 state during reset - when it's low the problem is nonexistent. However when a small pullup is applied (for example input pullup of a logic analyzer) the PB6 pin mimics the reset pin.
I also attach the project for Nucleo-G474RE.
2024-02-12 02:17 AM
2024-02-12 08:10 AM
Note 6 in datasheet explains the behavior:
After reset, a pull-down resistor (Rd = 5.1kΩ from UCPD peripheral) can be activated on PB6, PB4 (UCPD1_CC1,
UCPD1_CC2). The pull-down on PB6 (UCPD1_CC1) is activated by high level on PA9 (UCPD1_DBCC1).
Workaround:
The pull-down effect on the CC lines can be removed by using the bit UCPD1_DBDIS =1 (USB Type-C and power delivery dead battery disable) in the PWR_CR3 register.
I hope this helps
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2024-02-12 11:31 PM
Hello,
So the UCPD1_DBDIS =1 does not help, as the behavior is present during reset. You can see that the pin goes high only after some time, so I don't think it is something that can be solved by software (except maybe some option bytes?).
2024-02-13 02:14 AM
Hello @Wasilewski.Piotr
During reset, the ultimate solution would be to pull down PA9 by HW.
PB4_PUPEN OB is only considered for category 4 devices.
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.