2017-07-24 01:29 AM
Hi,
i already have done the setup for the lwip stack on the STM3210C-Eval board. I can already send via TCP/UDP and also RS232 to the uC (PC-->uC) and get also a echo back (uC-->PC). The debug output of the lwip-stack is already configured via cubemx, too. But i have absolutly no idea, how to configure the lwip-stack (via lwipopts.h or something else) that i can see the debug output of the lwip on RS232. Can anybody give a hint ?
Thanks in advance,
Mathias
2017-07-24 04:05 AM
Create a function which outputs a string through the method of your choice (), then
#define LWIP_PLATFORM_DIAG(message) yourfunction(message)
(you can similarly define LWIP_PLATFORM_ASSERT(message))
Debug is enabled globally by
#define LWIP_DEBUG 1
and then there are individual debugs, e.g.
#define UDP_DEBUG LWIP_DBG_ON
#define LWIP_DBG_TYPES_ON (LWIP_DBG_ON | LWIP_DBG_TRACE)
See [lwip-1.4.1]/src/include/lwip/debug.h
JW
2017-07-26 04:29 AM
Hi Jan, thank you for your fast and very good response ! I enabled the debuggin via cubemx and thought, that LWIP_DEBUG is already defined. I didnt have a look on it and that was the cause of the problem. Now i can debug . Thank you
2017-07-26 07:08 AM
I enabled the debuggin via cubemx and thought, that LWIP_DEBUG is already defined.
And what did that do then?
I am not interested in Cube/MX at all, but ST might want to hear some feedback.
JW
2017-07-26 09:26 AM
You can change the settings of WHAT the debug output should show. Now im fighting with my debug output . Do you
have another hint, how to format the lwip debug output, so that i can send it via uart ? Because the output messages are formated to be handled by printf.... i tried snprintf to save the string into an array, but there is an error with ''too few arguments''.
2017-07-26 09:56 AM
Couldn't in CubeMX a tickbox needed to enable the debug globally be hidden in some other place?
-----
I use
void UartBufPrint(char * s);
&sharpdefine UartBufPrintF(...) {char s[80]; snprintf(s, 80, __VA_ARGS__); UartBufPrint(s);} &sharpdefine LWIP_PLATFORM_DIAG(m) UartBufPrintF mJW
2017-07-26 10:14 AM
I havent found a radiobutton yet. I give your hint a try and implement it in that way. Hopefully i understand till tomorow, what your code snippet means :) . Thank you !
So i implemented it quick and dirty and the debug is now working. Great :) ! Is it normal, that in ''idle state'' (if no packages are sended by pc or uC) that the debug output shows some weired data ?
2017-07-26 10:35 AM
So i implemented it quick and dirty and the debug is now working.
Congrats! Quick and dirty, that's how it supposed to be! ;)
Is it normal,[...]
Sorry don't know, it's been quite a couple of months I've looked at this last time...
JW
2017-07-27 12:36 AM
No need to write sorry. Everything is fine :)