FreeRTOS + LWIP + UDP
I'm trying to achieve a UDP communication with STM32H753IIT6 and LAN8720A.
I use STM32CubeIDE 1.14.0.
According to the ST Ethernet and LwIP example: Adam BERLINGER edited on 2023-12-07 , I create a project, and change the pin layout according to my PCB design.
In the .ioc, I set the ip addrass as 192.168.0.10 and I did the other things described in the ST example, except for
"(Optional) Adding simple Hello UDP message" .
Everything's fine at this point : I can ping 192.168.0.10 and get replies.
Then I want to send some simple Hello UDP messages as the ST Ethernet and LwIP example describe.
However, after I Modify the StartDefaultTask in main.c , I can't ping the device and get some debug information from uart :


How to deal with "core lock " in the debug information ?
This is the StartDefaultTask code modifyied:
void StartDefaultTask(void *argument)
{
/* init code for LWIP */
MX_LWIP_Init();
/* USER CODE BEGIN StartDefaultTask */
const char* message = "Hello UDP message!\n\r";
osDelay(1000);
ip_addr_t PC_IPADDR;
IP_ADDR4(&PC_IPADDR, 192, 168, 0, 1);
struct udp_pcb* my_udp = udp_new();
udp_connect(my_udp, &PC_IPADDR, 55151);
struct pbuf* udp_buffer = NULL;
/* Infinite loop */
for (;;) {
osDelay(1000);
/* !! PBUF_RAM is critical for correct operation !! */
udp_buffer = pbuf_alloc(PBUF_TRANSPORT, strlen(message), PBUF_RAM);
if (udp_buffer != NULL) {
memcpy(udp_buffer->payload, message, strlen(message));
udp_send(my_udp, udp_buffer);
pbuf_free(udp_buffer);
}
}
/* USER CODE END StartDefaultTask */
}
