AnsweredAssumed Answered

STM32F030 UART problem

Question asked by Francisco SinapseEnergia on Sep 28, 2017
Latest reply on Oct 2, 2017 by Francisco SinapseEnergia

Hi all,


I'm trying to send an HTTP message through Ethernet interface using a WIFI external device. For this, I use HAL_UART functions as shown:


HAL_UART_Transmit(huart, messageTX,lengthOfmessage, timeoutTX);


UART has the following configuration:


static void MX_USART1_UART_Init(void)

huart1.Instance = USART1;
huart1.Init.BaudRate = 115200;
huart1.Init.WordLength = UART_WORDLENGTH_8B;
huart1.Init.StopBits = UART_STOPBITS_1;
huart1.Init.Parity = UART_PARITY_NONE;
huart1.Init.Mode = UART_MODE_TX_RX;
huart1.Init.HwFlowCtl = UART_HWCONTROL_NONE;
huart1.Init.OverSampling = UART_OVERSAMPLING_16;
huart1.Init.OneBitSampling = UART_ONE_BIT_SAMPLE_DISABLE;
huart1.AdvancedInit.AdvFeatureInit = UART_ADVFEATURE_NO_INIT;
if (HAL_UART_Init(&huart1) != HAL_OK)
_Error_Handler(__FILE__, __LINE__);



My tests results was (monitoring with Wireshark software):


1) Set the parameters as follows:

- messageTX = "GET /registro/index.php/?solicitud=Hello HTTP/1.1\ \r\n Host:\r\n\r\n"

lengthOfmessage = 75

- timeoutTX = 100


Results are OK, messageTX is successfully sent


2) Set the parameters as follows:

- messageTX = GET /registro/index.php/?solicitud=<horfeus><firma><IP></IP><TipoCliente>4</TipoCliente><tiempo>23/01/2017-04:57:04</tiempo><edificio>53</edificio><TipoAula>6</TipoAula><aula>MA21FPLA1</aula><serie>00352738</serie></firma></horfeus> <horfeus><firma><IP></IP><TipoCliente>4</TipoCliente><tiempo>23/01/2017-04:57:04</tiempo><edificio>53</edificio><TipoAula>6</TipoAula><aula>MA21FPLA1</aula><serie>00352738</serie></firma></horfeus> HTTP/1.1\ \r\n Host:\r\n\r\n"

lengthOfmessage = 275

- timeoutTX = 100


Here, results are NOK, messageTX is not successfully sent. In Wireshark SW I receive a message with size 19 bytes. I think this size 19 indicates the size that exceeds my messageTX, i.e.:


messageTX(275 bytes) - messageReceived(19 bytes) = 256 bytes


So, it's possible that STM32f030 UART interface limits my messageTX size in 256 bytes?


Please, help me.

Thanks in advance.