2009-04-20 01:14 PM
USART Hyperterminal Interrupts Example
2011-05-17 04:10 AM
I am trying to run this example on a Ubuntu machine and a STM32F103FE EVM board. The TxBuffer being transmitted (I am transmitting the string ''123435 USART Hyperterminal Interrupts Example: USART-Hyperterminal
communication using Interrupt'') gets corrupted. Most probably the most significant bit of some of the characters (denoted as dots below) is set for unknown reason. Also this error is consistent(for example, 1,2,4,R,T etc is transmitted properly at all times) 8A 0D 31 32 B3 34 B3 B5 - 20 D5 D3 C1 52 54 20 C8 ..12.4.. ...RT . 79 70 E5 F2 F4 E5 F2 6D - E9 6E 61 EC 20 49 6E F4 yp.....m .na. In. E5 F2 F2 75 70 F4 73 20 - 45 F8 61 6D 70 EC E5 BA ...up.s E.amp... 20 D5 D3 C1 52 54 AD C8 - 79 70 E5 F2 F4 E5 F2 6D ...RT.. yp.....m E9 6E 61 EC 20 E3 EF 6D - 6D 75 6E E9 E3 61 F4 E9 .na. ..m mun..a.. EF 6E 20 75 73 E9 6E 67 - 20 49 6E F4 E5 F2 F2 75 .n us.ng In....u 70 F4 8A 0D p... However, if the transmitted string is looped back into the receive side, the RxBuffer[] receives the string correctly. Any help/ ideas will be appreciated. Baudrate etc are the same. Function USART1_IRQHandler() is the same. void USART1_IRQHandler(void) { if(USART_GetITStatus(USART1, USART_IT_RXNE) != RESET) { /* Read one byte from the receive data register */ RxBuffer[RxCounter++] = (USART_ReceiveData(USART1) & 0x7F); if(RxCounter == NbrOfDataToRead) { /* Disable the USART Receive interrupt */ USART_ITConfig(USART1, USART_IT_RXNE, DISABLE); } } if(USART_GetITStatus(USART1, USART_IT_TXE) != RESET) { /* Write one byte to the transmit data register */ USART_SendData(USART1, TxBuffer[TxCounter++]); if(TxCounter == NbrOfDataToTransfer) { /* Disable the USART1 Transmit interrupt */ USART_ITConfig(USART1, USART_IT_TXE, DISABLE); } } } [ This message was edited by: arpan.mandal on 20-04-2009 07:02 ]2011-05-17 04:10 AM
What's the baud rate?
How long is the serial cable? What terminal application are you running in Ubuntu? Do other serial devices (e.g. MODEM) work on this host? Can you try it on a different host (desktop or laptop with Windows)?2011-05-17 04:10 AM
Quote:
if the transmitted string is looped back into the receive side, the RxBuffer[] receives the string correctly.
That certainly sounds like a configuration mismatch between the STM32 and your host system! Obviously, with a loopback, the transmitter & receiver settings have to be the same - so it should be expected to work! IF you're getting only certain characters ''corrupted'', check the Parity setting...