2025-02-04 09:27 PM - last edited on 2025-02-06 02:03 AM by Andrew Neil
I Enabled LWIP DEBUG options in CUBEMX
in lwipopt.h
/* USER CODE BEGIN 1 */
#define LWIP_DEBUG 1
/* USER CODE END 1 */
in main.c
int __io_putchar(int ch)
{
ITM_SendChar(ch);
return ch;
}
But I am not getting anything in SWVITM Data Console
Solved! Go to Solution.
2025-02-06 03:35 AM
#define LWIP_PLATFORM_DIAG(x) do {printf x;} while(0)
//added fflush after printing Now it's working
#define LWIP_PLATFORM_DIAG(x) do {printf x;fflush(0);} while(0)
2025-02-06 01:56 AM - edited 2025-02-06 01:56 AM
Hello @lavanya,
With the #define LWIP_DEBUG 1, you should also define the specific topic you want to log. For example, to debug the dhcp.c file, you can add the following define:
#define DHCP_DEBUG LWIP_DBG_ON
This will enable debug messages for DHCP.
With Regards,
2025-02-06 02:04 AM
2025-02-06 03:35 AM
#define LWIP_PLATFORM_DIAG(x) do {printf x;} while(0)
//added fflush after printing Now it's working
#define LWIP_PLATFORM_DIAG(x) do {printf x;fflush(0);} while(0)