cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F4 discovery uart problem

Posted on April 02, 2015 at 11:31

Hello there,

For many hours now I am trying to send couple bytes using uart on stm32f4 board. I tried Usart1 and Uart4 but it doesnt send anything. I have a scope attached to TX pin and there is nothing. Here is my code:

https://pastebin.com/qyVhySzU

I am using HAL. The clock is configured correctly, even if it wasnt I would see anything on the TX pin... I would really aprichiate all help, I have searched everywhere for an answer.

#stm32 #uart #hal
7 REPLIES 7
brett23
Associate II
Posted on April 02, 2015 at 14:12

Hi

 I have 

 GPIO_InitStruct.Speed     = GPIO_SPEED_FAST;

in my Usart1 at 115200 and it works fine

Although I use the DMA to do the Transmission.

Also I dont see the Structure declares. I assume you have them defined somewhere else  otherwise it should not compile

 GPIO_InitTypeDef  

GPIO_InitStructUart4;

UART_HandleTypeDef

huart4

;

Posted on April 02, 2015 at 14:20

Hello,

Yes the structs are declared, I forgot to paste them. I have tried with speed FAST as well, but it doesnt work either. At the end I would like to use DMA as well, but I cant even send anything using blocking mode :(.

Posted on April 02, 2015 at 15:02

I have just noticed that my configuration works, but I havent seen it, because the signal amplitude is 1.5V, instead of 3.3V as I expected... I checked the STM32F4 discovery schematic and noticed that PA0 is biased (It shouldnt have anything to do with it though). But to be sure i swapped to uart5, but there amplitude is 1.5V as well. Is there something I forgot or dont know about? Are IO's in stm32f4 powered with 1.5V?

brett23
Associate II
Posted on April 03, 2015 at 14:25

Is the Uart connected to anything at all Ie a RS232 Driver Level Chip? Otherwise maybe Loading it down

Check  all your VDD Supplys are are OK  

brett23
Associate II
Posted on April 03, 2015 at 18:47

can you just isolate the TX pin (diconnect it from the others MCU) Just to be sure that its not trying to also be an output instead of an input.

gvigelet
Associate II
Posted on April 05, 2015 at 18:32

PA0 is hooked up to the User Button. Try Usart 2 or 3 they are free on the F4 discovery.  You can remove jumper SB20 to isolate the pin adn use it for the USART.

Posted on April 07, 2015 at 09:06

Hello and thank you for answers. I have checked the schematic and the button connected has no effect on the line.

0690X00000605G3QAI.png

Even though, I have changed the config to uart2. The amplitude remains about 2 V...

0690X00000605G8QAI.png

Does anyone understand this?

Btw, I havent seen more complicated and unclear posting system than this on st.com for a while :|