[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-users] LwIP 1.3.1 - problems setting up the debug macros
From: |
Mikael Rosberg |
Subject: |
[lwip-users] LwIP 1.3.1 - problems setting up the debug macros |
Date: |
Wed, 15 Sep 2010 00:21:58 +0200 |
Hi,
Have started to take
a closer look at Lwip.
I'm using a keil
MCB1700 board and KEIL RealView MDK-ARM.
I found an
example for this platform using the CoOs RTOS.
App:
Application source code
CoOS: CooCox CoOS source code
Net: HTTP source
code
Ethernet: LwIP source code (LwIP 1.3.1)
RvMDK: Project
file
CMSIS: CMSIS source code
The
application (HTTP server) sseems to work ok but when starting to play around and
using debug printing, I ran into some problems.
Q1.
Took some
time to get the printning going and looks like other have
had similar problem with the debug macros.
Is there some doc describing
the debug macros ? ( I have searched quite a
lot...)
Q2.
I got the
printing of the ip addresses wrong,, like "udp_bind: bound to 0.0.0.268439356, port 13481" below.
I
had to change several macros in netif.c.to get proper printing and
also adjusting ip_addr_debug_print.
I believe
their must some other way to fix this.
Would
appreciate if someone could point me in the right direction.
Main entry checking UART & stdio
..
lwip_init_task
netif_add(..
netif_set_ipaddr: netif address being
changed
netif: IP address of interface set to:
192.168.2.100
netif: netmask of interface set to:
0.0.0.0
netif: GW address of interface set to:
192.168.2.1
DBG: ..\Ethernet\LWIP\src\core\netif.c, 158
netif: added
interface en IP addr 192.168.2.100
netmask 255.255.255.0
gw
192.168.2.1
netif_set_default(..
netif: setting default
interface en
netif_set_up(..
etharp_request: sending ARP
request.
pbuf_alloc(length=44)
pbuf_alloc(length=44) ==
10000678
etharp_raw: sending raw ARP packet.
pbuf_header: old 10000688 new
1000068a (-2)
pbuf_free(10000678)
pbuf_free: deallocating
10000678
pbuf_header: old 1000068a new 10000688
(2)
pbuf_free(10000678)
pbuf_free: 10000678 has ref 65535, ending
here.
sys_timeout: 10001f4c msecs=5000 h=0000b0a3
arg=10001f4c
tcpip_thread: API message 10004be8
tcpip_thread: API message
10004ef8
tcpip_thread: API message 10004be8
tcp_bind: bind to port
80
tcpip_thread: API message 10004ef8
udp_bind(ipaddr = 176.81.0.16
,
port = 95)
udp_bind: bound to 0.0.0.268439356,
port 13481
tcpip_thread: API message 10004bf0
tcpip_thread: API message
10004f00
//#define ip_addr_debug_print(debug, ipaddr)
\
// LWIP_DEBUGF(debug,
("%"U16_F".%"U16_F".%"U16_F".%"U16_F,
\
//
ipaddr != NULL
?
\
//
(u16_t)(ntohl((ipaddr)->addr) >> 24) & 0xff : 0,
\
//
ipaddr != NULL
?
\
//
(u16_t)(ntohl((ipaddr)->addr) >> 16) & 0xff : 0,
\
//
ipaddr != NULL
?
\
//
(u16_t)(ntohl((ipaddr)->addr) >> 8) & 0xff : 0,
\
//
ipaddr != NULL
?
\
//
(u16_t)ntohl((ipaddr)->addr) & 0xff : 0))
//#define (debug,
ipaddr)
\
// LWIP_DEBUGF(debug,
("%u.%u.%u.%u",
\
//
(ntohl((ipaddr)->addr) >> 24) & 0xff,
\
//
(ntohl((ipaddr)->addr) >> 16) & 0xff,
\
//
(ntohl((ipaddr)->addr) >> 8) & 0xff,
\
//
(ntohl((ipaddr)->addr) >> 0) & 0xff
\
//
))
/* These are cast to u16_t, with the intent that
they are often arguments
* to printf using the U16_F format from cc.h.
*/
#define ip4_addr1(ipaddr) ((u16_t)(ntohl((ipaddr)->addr) >> 24)
& 0xff)
#define ip4_addr2(ipaddr) ((u16_t)(ntohl((ipaddr)->addr)
>> 16) & 0xff)
#define ip4_addr3(ipaddr)
((u16_t)(ntohl((ipaddr)->addr) >> 8) & 0xff)
#define
ip4_addr4(ipaddr) ((u16_t)(ntohl((ipaddr)->addr) >> 0) &
0xff)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [lwip-users] LwIP 1.3.1 - problems setting up the debug macros,
Mikael Rosberg <=