cancel
Showing results for 
Search instead for 
Did you mean: 

How can I use a usart in the LwIP_HTTP_Server_Netconn_RTOS H743 project?

clock.1166
Senior

Hi,

I have been attempting to find out why I cannot get a usart to transmit (or presumably receive) in the above project.

I have set up a simple cubeide project for usart6 (below) and this works fine.

I set up the same sequence in LwIP_HTTP_Server_Netconn_RTOS H743 project (example in STM32Cube_FW_H7) on the same board (below). I also removed the MPU_config and CPU_cache sections. I cannot get a peep from usart6 even when I do not enter any of the LWIP/Netconn/RTOS sections (which work fine on the original project). It must be something to do with memory allocation, or perhaps GPIO allocation, or maybe the flash.ld but I've spent hours and I cannot find it. I realise that there is no specific GPIO allocation in the project, but do you need a gpio_init section for just a usart?

Could you please help?

Simple Usart6 from cubeide - works OK

*****************

int main(void)

{

 /* Reset of all peripherals, Initializes the Flash interface and the Systick. */

 HAL_Init();

 /* Configure the system clock */

 SystemClock_Config();

 uint8_t MSG1[] = "Hello\r\n";

 /* Initialize all configured peripherals */

 MX_GPIO_Init();

 MX_USART6_UART_Init();

 /* Infinite loop */

 /* USER CODE BEGIN WHILE */

 while (1)

 {

    HAL_UART_Transmit(&huart6, MSG1, sizeof(MSG1), 100); // works fine

    HAL_Delay(500);

   /* USER CODE END WHILE */

 }

}

************************************************ LWIP/Netconn proj

 HAL_Init();

 /* Configure the system clock to 400 MHz */

 SystemClock_Config();

MX_USART6_UART_Init();

HAL_Delay(100);

while(1)

{

   HAL_UART_Transmit(&huart6, MSG1, sizeof(MSG1), 100); // Does not work

   HAL_Delay(100);

}

1 ACCEPTED SOLUTION

Accepted Solutions
Pavel A.
Evangelist III

Yes you need to configure the pins for the UART.

this code is in your “simple“ project in the ….msp.c file.

View solution in original post

2 REPLIES 2
Pavel A.
Evangelist III

Yes you need to configure the pins for the UART.

this code is in your “simple“ project in the ….msp.c file.

clock.1166
Senior

Thanks ever so much! It works now and I have learnt a bit more!!!

Chris