Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++

LWIP crashing on httpd

Altera_Forum
Honored Contributor II
1,103 Views

I managed to get standalone-LWIP running on my own board, and all is well except when trying to get to HTTP. I can use the echo server fine (tried with hyperterminal), and I can ping the board ok... I have full debugging on, so here is some of the output when it crashes (there is no explicit error message). As you can see, it establishes the connection successfully, but after that, it looks like it crashes after it tries to send some response... maybe someone here is more familiar with the logging, and can point me in the right direction. The cutoff line at the end is actually what happens.. that&#39;s where it dies http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/sad.gif Oh, and I verified that other than establishing the connection, nothing gets sent out from the board. 

 

I also tried drastically increasing all parameters related to window size, memory size etc.. (I have 64 MB SDRAM). Help pleaSE!! 

 

TCP header: 

+-------------------------------+ 

| 4271 | 80 | (src port, dest port) 

+-------------------------------+ 

| 3789190961 | (seq no) 

+-------------------------------+ 

| 0000006737 | (ack no) 

+-------------------------------+ 

| 5 | |011000| 5840 | (hdrlen, flags (PSH ACK ), win) 

+-------------------------------+ 

| 0x61a1 | 0 | (chksum, urgp) 

+-------------------------------+ 

pbuf_header: old 0x70362 new 0x70376 (-20) 

inet_chksum_pseudo(): checksumming pbuf 0x70344 (has next 0x0) 

lwip_chksum(0x70376, 239) 

inet: chksum: odd byte 10 

inet_chksum_pseudo(): pbuf chain lwip_chksum()=ffff 

pbuf_header: old 0x70376 new 0x7038a (-20) 

+-+-+-+-+-+-+-+-+-+-+-+-+-+- tcp_input: flags PSH ACK -+-+-+-+-+-+-+-+-+-+-+-+-+ 

-+ 

State: ESTABLISHED 

tcp_receive: pcb->rttest 0 rtseq 6736 ackno 6737 

HTTPD Received something 

tcp_recved: recveived 219 bytes, wnd 32768 (0). 

pbuf_free(0x70344) 

pbuf_free: deallocating 0x70344 

tcp_write(pcb=0x6f758, arg=0x25e48, len=1637, copy=0) 

tcp_enqueue(pcb=0x6f758, arg=0x25e48, len=1637, flags=0, copy=0) 

tcp_enqueue: queuelen: 0 

pbuf_alloc(length=1460) 

pbuf_alloc(length=1460) == 0x6f3c8 

pbuf_alloc(length=0) 

pbuf_alloc(length=0) == 0x2f404 

pbuf_header: old 0x2f44c new 0x2f438 (20) 

tcp_enqueue: queueing 6737:8197 (0x0) 

pbuf_alloc(length=177) 

pbuf_alloc(length=177) == 0x6f3dc 

pbuf_alloc(length=0) 

pbuf_alloc(length=0) == 0x2f458 

pbuf_header: old 0x2f4a0 new 0x2f48c (20) 

tcp_enqueue: queueing 8197:8374 (0x0) 

tcp_enqueue: 4 (after enqueued) 

tcp_output: snd_wnd 5840, cwnd 1460, wnd 1460, effwnd 1460, seq 6737, ack 6737 

tcp_output: snd_wnd 5840, cwnd 1460, wnd 1460, effwnd 1460, seq 6737, ack 6737, 

i0 

tcp_output_segment: rtseq 6737 

tcp_output_segment: 6737:8197 

inet_chksum_pseudo(): checksumming pbuf 0x2f404 (has next 0x6f3c8) 

lwip_chksum(0x2f438, 20) 

inet: chksum: no odd byte 

inet_chksum_pseudo(): checksumming pbuf 0x6f3c8 (has next 0x0) 

lwip_chksum(0x25e48, 1460) 

inet: chksum: no odd byte 

inet_chksum_pseudo(): pbuf chain lwip_chksum()=b6b 

pbuf_header: old 0x2f438 new 0x2f424 (20) 

lwip_chksum(0x2f424, 20) 

inet: chksum: no odd byte 

ip_output_if: oc0 

IP header: 

+-------------------------------+ 

| 4 | 5 | 0x00 | 1500 | (v, hl, tos, len) 

+-------------------------------+ 

| 8 |010| 0 | (id, flags, offset) 

+-------------------------------+ 

| 255 | 6 | 0xf1e8 | (ttl, proto, chksum) 

+-------------------------------+ 

| 192 | 168 | 1 | 111 | (src) 

+-------------------------------+ 

| 192 | 168 | 1 | 107 | (dest) 

+-------------------------------+ 

netif->output()pbuf_header: old 0x2f424 new 0x2f416 (14) 

pbuf_alloc(length=1514) 

pbuf_alloc: allocated pbuf 0x70344 

pbu
0 Kudos
1 Reply
Altera_Forum
Honored Contributor II
393 Views

I think I have narrowed down the error somewhere in the PBUF section..  

 

it looks like it&#39;s in pbuf_alloc(), near the end where the reference flag is set: 

 

pbuf->ref = 1; 

 

Does this provide any more info? It seems almost like it&#39;s overwriting code/stack space...
0 Kudos
Reply