2019-10-15 02:08 AM
Hello,
We have run into a weird behaviour with the STM32G070KB. With PA8 defined as an input with internal pullup and PA9 as output push-pull.
When PA9 is at low level and PA8 unconnected, PA8 is at VCC (3.3V) as expected.
When PA9 is at high level, PA8 drops to 0.29V. Adding an external 10k pull up raises PA8 to around 1V.
Actually after more tests, leaving PA9 as an input and driving it externally to VCC also makes PA8 to drop.
We are using a custom board, but at this point after unsoldering components and cutting traces, both PA8 and PA9 are not connected to anything so this is not due to external components.
This code sample reproduces the behaviour :
int main(void)
{
SET_BIT(RCC->IOPENR, RCC_IOPENR_GPIOAEN);
//Set PA8 as input pull up
GPIOA->MODER &= ~GPIO_MODER_MODE8;
GPIOA->PUPDR |= GPIO_PUPDR_PUPD8_0;
//PA8 reads 3.3V as it should
//Set PA9 as output push-pull low
GPIOA->MODER &= ~GPIO_MODER_MODE9_1;
GPIOA->OTYPER &= ~GPIO_OTYPER_OT9;
GPIOA->BSRR = GPIO_BSRR_BS9;
//PA8 reads 0.29V at this point
while (1)
{
}
return 0;
}
Why is this happening ? How can we avoid it ?
Best regards,
Geofrey MARCEL
Solved! Go to Solution.
2019-10-15 03:12 AM
The 'G070 is a "downgraded" 'G071 (the same chip, just with less testing). PA8 and PA9 are UCPD pins. Read the 'G071 RM to understand the potential reason for your problem.
JW
2019-10-15 03:12 AM
The 'G070 is a "downgraded" 'G071 (the same chip, just with less testing). PA8 and PA9 are UCPD pins. Read the 'G071 RM to understand the potential reason for your problem.
JW
2019-10-15 07:53 AM
Thank you Jan, adding :
SET_BIT(SYSCFG->CFGR1, SYSCFG_CFGR1_UCPD1_STROBE);
fixes the problem.
I did spend quite some time looking the datasheet of the G070 to see what could cause this behaviour... Well, having to look the RM of another part to set something in a register that is not supposed to exist is not so nice... HAL did not helped here either.
So if I get this right, G070 is the same than G071 and can be used the same way ? It is just that some functionnality is not guaranteed ?
2019-10-15 08:54 AM
> So if I get this right, G070 is the same than G071 and can be used the same way ? It is just that some functionnality is not guaranteed ?
Probably yes, but ST may be free to disable any functionality using any internal undocumented means, if they chose to. Also, should there be substantial interest in the stripped-down chips, they can produce a new maskset, omitting the "unavailable" functionality, to optimized chip area.
JW
2019-10-15 09:00 AM
@Imen DAHMEN ,
Can you please suggest adding to the USB PD / Dead battery support subchapter of GPIO chapter in RM0444 at least a one-liner explaining that applications . which don't want to use UCPD, should set the respective SYSCFG_CFGRx_UCPDx_STROBE bits? Best to explicitly mention the given pins (e.g. PA8), so that it could be found using textual search.
As this thread shows, this chapter should also be present in RM0454 (it is now but as a caution *not* to remove it in future), even if there is no official UCPD support in 'G070, maybe with some slightly modified title?
JW
2019-10-16 01:59 AM
Hello Jan,
Ok, I will work on this topic and will raise internally your feedback.
Thank you for your feedback and comments for improvements.
Regards,
Imen
2019-10-16 02:38 AM
Thanks, Imen.
Jan
2019-10-16 05:45 AM
Hi Jan,
After discussion with the appropriate team regarding your feedback, we will add a note in the Datasheet pinout table directly. The target and idea right now is not to modified GPIO chapter, which is transparent to it at logic level.
I hope this suggestion would fit your request?
By the way the limitation and strobe action is also present and must be taken in STM32G070.
Best Regards,
Imen
2019-10-16 07:16 AM
> By the way the limitation and strobe action is also present and must be taken in STM32G070.
I don't understand. Are you here talking about ES0418 - Rev 1 erratum 2.10.1 UCPD wrong R pdb default trimming value after power-on ?
> we will add a note in the Datasheet pinout table directly
That's a good idea.
> not to modified GPIO chapter, which is transparent to it at logic level.
I understand. However, you already have a sub chapter in the GPIO chapter dedicated to *exactly* this item - USB PD / Dead battery support ... except that it has just some placeholder text there as of now. So, it obviously is planned to talk about it in the GPIO chapter already...
But, as a broader view, I would suggest to add a dedicated chapter - "things that influence pins yet are not influenced by the settings in GPIO" - to *all* STM32 RMs. There are quite a few of them across the STM32 families - OTG USB pins in the 'F4/'F2, oscillator pins, RTC pins, just to name a few.
Jan
2019-10-16 08:18 AM
> I don't understand. Are you here talking about ES0418 - Rev 1 erratum 2.10.1 UCPD wrong R pdb default trimming value after power-on ?
No, there is no bug. You talked about limitation, but the product is like that, so nothing will be in Errata.
The point you described is the same for G070 and G071.
Regards,
Imen