cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F407 Discovery board , not getting any data on console of terminal like realterm or teraterm

Sarthak.official
Associate

My code is hanging in infinite loop during transmit stage

BOARD used : Stm32f407vg Discovery board

IDE used    : STM32Cube IDE

------------------------------------------------------------------------------------------------------------------------------------

if( HAL_UART_Transmit ( &huart2 , (uint8_t *) mydata , strlen(mydata) ,HAL_MAX_DELAY ) != HAL_OK )

{

Error_hanlder();

}

​I need help if anyone could help me please.

I wrote code to transfer data and watch it on teraterm or realterm. I know the functions of what UE ,TE ,TXE, TC are. 

I debugged the code and watched the SR and could see values changing correctly as expected but no data was shown in teraterm. So I thought I am using teraterm incorrectly I watched videos about it and configuring serial port settings and became sure that my settings were perfect ,same baud same parity wordlength etc etc.. but still could not see data on teraterm console.

I got frustrated and thought of using cube mx .. I used usart2 as I have f4 board which has PA2,3 direct connection to PC .

I generated the code and just wrote a char array and used hal_uart_transmit function to Send and still!!! No output in teraterm. 

This time I used auto generated code and debugged it ,which showed me same behavior of CR and SR registers therefore code was obviously correct and that meant my own written was also correct ,even I debugged step over and step into transmit function line by line ,flags were perfectly configured . Then whyyy am I not getting anything on realterm or teraterm console.

5 REPLIES 5

> I have f4 board which has PA2,3 direct connection to PC .

This board? https://www.st.com/en/evaluation-tools/stm32f4discovery.html

Note, that the connections from the target 'F407 to STLink ('F103) are NOT present on that board, and you have to do them yourself (see UM1472, chapter 6.1.3 ST-LINK/V2-A VCP configuration ).

JW

Yeah I just .. read section 6.1.3

Thanks man. ​

Mohamed Aymen HZAMI
ST Employee

Hello,

Can you please share your code in order to reproduce your problem.

Best Regards,

Mohamed Aymen.

Can I get the code please. I am trying to get a output using teraterm. But it yields nothing. I have minutely debugged the code. Even started all over again but no results. I am using CubeMx UartTransmit function to pass a string via PA2 and PA3 as Tx and Rx.

Start a new thread, stating the hardware you are using and code you've tried.

JW