2017-09-14 05:34 AM
Hello,
I need your help. I've got some troubles with lwIP and to find a solution for that I want to enable debugging in lwIP.
I'm working with a STM3210C-EVAL board and with CubeMX. lwIP is working, I can send a ping and also see the webpage in fsdata. But now I want to enable debugging. I also configured UART2 with CubeMX and can send messages via HAL_UART_Transmit(). Then I redirect printf, so that messages are send via UART. This also workes fine. For this I added this lines to my main.c:
#ifdef __GNUC__
/* With GCC, small printf (option LD Linker->Libraries->Small printf set to 'Yes') calls __io_putchar() */#define PUTCHAR_PROTOTYPE int __io_putchar(int ch)#else#define PUTCHAR_PROTOTYPE int fputc(int ch, FILE *f)#endif /* __GNUC__ */And after the main function:
PUTCHAR_PROTOTYPE {
HAL_UART_Transmit(&huart2, (uint8_t *)&ch, 1, 0xFFFF); return ch;}And now I wanted to enable the debugging in lwIP. For this, I added the lines below in lwipopts.h:
#define LWIP_DEBUG 1
#define ICMP_DEBUG LWIP_DBG_ON
But there are no messages send when I ping or open the webserver. I tried another options, like IP_DEBUG or TCP_DEBUG, but there is no difference.
Have anyone an idea where my mistake is?
Thank you
2017-09-14 06:19 AM
https://community.st.com/0D70X000006Sp7qSAC
JW
2017-09-14 08:31 AM
Thank you for your quick response.
Where I have do add '#define LWIP_PLATFORM_DIAG(message) output_print(message)'? I put it into the lwipopts.h, but it didn't work.
Thanks.
2017-09-18 01:16 AM
Has anyone an other suggestion?
2017-09-19 01:37 AM
I found my mistake.
In my lwipopts.h was this line:
#define LWIP_DBG_TYPES_ON LWIP_DBG_OFF
With changing it to #define LWIP_DBG_TYPES_ON LWIP_DBG_ON debuging works fine.