cancel
Showing results for 
Search instead for 
Did you mean: 

There is UART BUG on STM32F446RCT6

Mugtaba
Associate II

STM32CUBEIDE:  version 1.14.1
PA0-WKUP ------> UART4_TX
PA1 ------> UART4_RX

On a new project when enabling the UART4 with interrupt on receive ,everything is working normal .
But once I enable PH1 pin as a GPIO_OUTPUT the UART is not transmitting or receiving any more.

Any ideas or help please?

Update 1: I attached the two code form comparing.
Update 2: if I configure the PH1 pin as input the UART4 will work normal

1 ACCEPTED SOLUTION

Accepted Solutions
Mugtaba
Associate II

I have solved the problem by my self, I had to enable the printf and scanf as I have used them as UART transmission function from the project settings (didn't know why it is working once the PH1 pin is disabled)
also I added this line before the while (1) __HAL_UART_ENABLE_IT(&huart4,UART_IT_RXNE);


@Mugtaba wrote:

STM32CUBEIDE:  version 1.14.1
PA0-WKUP ------> UART4_TX
PA1 ------> UART4_RX

On a new project when enabling the UART4 with interrupt on receive ,everything is working normal .
But once I enable PH1 pin as a GPIO_OUTPUT the UART is not transmitting or receiving any more.


For the PH1 pin still don't know I am leaving it for the STM team

View solution in original post

7 REPLIES 7
STOne-32
ST Employee

Dear @Mugtaba ,

 

PH0 and PH1 are used by the HSE - High speed crystal oscillator for precise clock and get right UART baudrate , if PH1 is configured as GPIO , the system will run on internal HSI and your  UART baudrate will be lost and so stopping at application level . Can you check your clocks ?

 

Cheers,

 

STOne-32

Thank you for your reply
but the HSE is already disabled, I am using the internal clocks

Mugtaba_0-1705753317991.png

 

Interesting ! And what is your UART4 baudrate ? We need to replicated such behavior never seen before .

Cheers,

STOne-32

I tested it starting from 9600, 115200 to 512000

Mugtaba
Associate II

I have solved the problem by my self, I had to enable the printf and scanf as I have used them as UART transmission function from the project settings (didn't know why it is working once the PH1 pin is disabled)
also I added this line before the while (1) __HAL_UART_ENABLE_IT(&huart4,UART_IT_RXNE);


@Mugtaba wrote:

STM32CUBEIDE:  version 1.14.1
PA0-WKUP ------> UART4_TX
PA1 ------> UART4_RX

On a new project when enabling the UART4 with interrupt on receive ,everything is working normal .
But once I enable PH1 pin as a GPIO_OUTPUT the UART is not transmitting or receiving any more.


For the PH1 pin still don't know I am leaving it for the STM team

STOne-32
ST Employee

Dear @Mugtaba ,

glad to see you solved the problem observed . however this is weird to have a link between printf / scanf and PH1 GPIO activation ! To fully understand the root cause :  sharing the full project and settings are helpful.

Cheers,

STOne-32

Thank you for your reply
I did share (on the question it self as attachment) the two project when the PH1 is enabled and disabled.