cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F756ZGY6TR GPIO READ ERROR on PORT A Pin11 But Same Code Works fine on STM32F746IGT6

Bkell.1
Associate II

Hi, We had to change to a new MCU from the same family due to the great chip shortage of 2021.

But on the new MCU STM32F756ZGY6TR.

PORT A PIN11 does not read its state property

PORT A PIN10 works fine though

PIn11 will read low (correct) but then on next read will read High.

I have scanned the code for any other driver that is using this pin and none.

The Same Code on the previous STM32F746IGT6 MCU works fine.

Is there some thing Special with Pin11 on the Version of the MCU?

I measured the Pin and its pulled up correctly, and goes low correctly (when I press the Button)

Its such a simple thing (GPIO READ) But I cannot fathom when it does not work on this MCU

Thanks

Setup and read below

#define OPTO1_Pin GPIO_PIN_10

#define OPTO1_GPIO_Port GPIOA

#define OPTO2_Pin GPIO_PIN_11

#define OPTO2_GPIO_Port GPIOA

 /*Configure GPIO pins : PAPin PAPin */

 GPIO_InitStruct.Pin = OPTO1_Pin|OPTO2_Pin;

 GPIO_InitStruct.Mode = GPIO_MODE_INPUT;

 GPIO_InitStruct.Pull = GPIO_PULLUP;

 HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);

// read function used

HAL_GPIO_ReadPin(GPIOA, OPTO2_Pin) ;

7 REPLIES 7
TDK
Guru

The STM32F756 is just a STM32F746 + CRYPTO. But crypto certainly isn't going to affect how PA11 behaves.

> PIn11 will read low (correct) but then on next read will read High.

> I measured the Pin and its pulled up correctly, and goes low correctly (when I press the Button)

Likely the issue is somewhere else in your code. Perhaps the button is not debounced correctly. Perhaps there is a hardware connection you're missing or a PWB design error.

The two chips you're comparing are different packages, so clearly something more is different than just the chip.

If you feel a post has answered your question, please click "Accept as Solution".
Bkell.1
Associate II

Hi

Its not a de-bounce - code issue.

Sorry and just to correct. The Pin Reads LOW when it should read HIGH .

I can hold the PIN HIGH and it only randomly reads HIGH

1) The same code on the other MCU STM32F746 works fine.

2) Tested 5 PCBS all same. Every other READ on GPIO PIN is OK Just this Pin11 on Port A

And that's using a Direct Read HAL_GPIO_ReadPin(GPIOA, OPTO2_Pin) ;Function.

The Scope on the PIN shows a stable High.

Tested 5 PCBS all Same. Every other READ on GPIO PIN is OK Just this Pin11 on Port A

I have searched the files in the project. And there's no other code accessing this Pin. And again same code on the Other MCU is fine

Its Weird

Thanks

One other test you could do is set it as GPIO output and verify the PA11 bit in IDR matches the bit in ODR when it's high and when it's low. Since the problem is intermittent, I don't think a misconfiguration issue could be the cause.

If you feel a post has answered your question, please click "Accept as Solution".

The F746 / F756 share the same die, you should check the DEVID in the MCUDBG

>Anything special about PA11?

USB? OTG_FS_DM. The IO cell on this pin might be different.

Do you have an adequate pull-up? On externally? What's driving the pin? An Open-Drain/Collector?

Perhaps use a logic analyzer, triggered on the misread, and be sure nothing odd is going on externally or at a board level.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Hi

The Pin has internal Pull Up. Makes no difference if I also Add a 1K pull up.

It almost always reads low and only randomly reads the correct idle state high.

And that's with the same O/C Opto (sub board) that works fine on the F746.

I would expect the die to be different as this STM32F756ZGY6TR is in the Tiny BGA Package

I will read the registers as you say

Thanks

And No USB is config.

The WLCSP tends to be a good metric of how large the die is, the 2MB part starts at a WLCSP180

ST classically doesn't do die-shrinks of existing designs, just pivots to new designs, as the re-validation would be more burdensome.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..