2021-09-28 01:04 AM
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);
}
Solved! Go to Solution.
2021-09-28 02:37 AM
Yes you need to configure the pins for the UART.
this code is in your “simple“ project in the ….msp.c file.
2021-09-28 02:37 AM
Yes you need to configure the pins for the UART.
this code is in your “simple“ project in the ….msp.c file.
2021-09-28 04:50 AM
Thanks ever so much! It works now and I have learnt a bit more!!!
Chris