Skip to main content
Bertrand1
Senior
September 5, 2022
Solved

STM32H747 PA0_C & PA1_C input reading issue

  • September 5, 2022
  • 2 replies
  • 2726 views

Hello,

I am working with a STM32H747XI. I have connected a digital input on PA0_C & PA1_C.

I used CubeMX for the initialisation.

The initialisation code is :

/*Configure GPIO pins : UI_ENC0_Pin UI_ENC1_Pin */
 GPIO_InitStruct.Pin = UI_ENC0_Pin|UI_ENC1_Pin;
 GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
 GPIO_InitStruct.Pull = GPIO_NOPULL;
 HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);

When I read the pin, it stays always at 0 (GPIO_PIN_RESET)

bpState1 = HAL_GPIO_ReadPin(GPIOA, UI_ENC0_Pin);
bpState2 = HAL_GPIO_ReadPin(GPIOA, UI_ENC1_Pin);

The pin PA0 is at " Reset State".

I dont know what I have to do to solve it.

Many thanks for your help.

Bertrand

This topic has been closed for replies.
Best answer by Bertrand1

Hello,

Sorry for the late feedback.

It works!

Many thanks.

Should I report as a bug for CubeMx?

Bertrand

2 replies

Jaroslav JANOS
ST Employee
September 6, 2022

Hello Bertrand,

are the analog switches between PA0 & PA0_C and PA1 & PA1_C closed?

HAL_SYSCFG_AnalogSwitchConfig(SYSCFG_SWITCH_PA0, SYSCFG_SWITCH_PA0_CLOSE);
HAL_SYSCFG_AnalogSwitchConfig(SYSCFG_SWITCH_PA1, SYSCFG_SWITCH_PA1_CLOSE);

Jaroslav

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.
Bertrand1
Bertrand1AuthorAnswer
Senior
September 10, 2022

Hello,

Sorry for the late feedback.

It works!

Many thanks.

Should I report as a bug for CubeMx?

Bertrand

Jaroslav JANOS
ST Employee
September 21, 2022

Hello Bertrand,

I'm glad it worked. Concerning the CubeMX bug, I will take care of it.

Jaroslav

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.
Bertrand1
Bertrand1Author
Senior
September 6, 2022

I will check and try and revert to you.

Thank you.

Bertrand