2020-04-10 01:54 PM
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.
2020-04-10 02:49 PM
> 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
2020-04-10 02:53 PM
Yeah I just .. read section 6.1.3
Thanks man.
2020-04-13 09:46 AM
Hello,
Can you please share your code in order to reproduce your problem.
Best Regards,
Mohamed Aymen.
2020-11-01 01:27 AM
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.
2020-11-01 03:34 AM
Start a new thread, stating the hardware you are using and code you've tried.
JW