Skip to main content
Bkell.1
Associate II
November 1, 2021
Question

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

  • November 1, 2021
  • 7 replies
  • 2918 views

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) ;

This topic has been closed for replies.

7 replies

TDK
November 1, 2021

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
Bkell.1Author
Associate II
November 1, 2021

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

TDK
November 1, 2021

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""."