Problem adding USART3 functionality to LwIP_HTTP_Server_Netconn_RTOS demo
Hi,
I'm having troubles to add USART communication to the LwIP_HTTP_Server_Netconn_RTOS demo from ST. I need to add communications using USART1 & USART3 to the example but have been stuck with HAL_UART_Transmit() returning 3. I came up with a little example to show the issue I'm facing:
Can someone help out?
I want to use pins PD8 for Tx and PD9 for Rx (STM32F439ZI) but have not found where this would be set and I suspect that PB10 & PB11 are being used by mistake (and may conflict with ETH_MII_RX & ETH_MII_TX).
Thanks!
int uart_test(void)
{
int rv = OK;
char cmd[ZABER_STR_LEN]={0};
enum zaber_dev dev = ZAB_BOTH;
huart3.Instance = USART3;
huart3.Init.BaudRate = 115200;
huart3.Init.WordLength = UART_WORDLENGTH_8B;
huart3.Init.StopBits = UART_STOPBITS_1;
huart3.Init.Parity = UART_PARITY_NONE;
huart3.Init.HwFlowCtl = UART_HWCONTROL_NONE; // No hardware flow control
huart3.Init.Mode = UART_MODE_TX_RX; // Full-duplex mode
if (HAL_UART_Init(&huart3) != HAL_OK)
{
Error_Handler();
}
if (dev==ZAB_BOTH)
sprintf(cmd, "/%s\n", ZABER_CMD_HOME);
else
sprintf(cmd, "/%d %s\n", dev, ZABER_CMD_HOME);
rv = HAL_UART_Transmit(&huart3, (uint8_t*)cmd, strlen(cmd), 1000);
return rv;
}
int main(void)
{
HAL_Init();
SystemClock_Config();
uart_test();
