ESP8266 Developer Zone The Official ESP8266 Forum 2018-12-24T23:44:31+08:00 https://bbs.espressif.com:443/feed.php?f=66&t=1975 2018-12-24T23:44:31+08:00 2018-12-24T23:44:31+08:00 https://bbs.espressif.com:443/viewtopic.php?t=1975&p=36158#p36158 <![CDATA[Re: DHCP server error when soft-AP client connects with recompiled liblwip.a]]> Statistics: Posted by solomonC — Mon Dec 24, 2018 11:44 pm


]]>
2016-04-20T19:39:20+08:00 2016-04-20T19:39:20+08:00 https://bbs.espressif.com:443/viewtopic.php?t=1975&p=6543#p6543 <![CDATA[Re: DHCP server error when soft-AP client connects with recompiled liblwip.a]]>
We were recompiling lwip to enable PPPoS and IP Forwarding to create (not accomplished yet...) a transparent bridge network topology proposed in viewtopic.php?f=65&t=1981

Statistics: Posted by luisfer.rigoni — Wed Apr 20, 2016 7:39 pm


]]>
2016-04-20T05:33:07+08:00 2016-04-20T05:33:07+08:00 https://bbs.espressif.com:443/viewtopic.php?t=1975&p=6531#p6531 <![CDATA[Re: DHCP server error when soft-AP client connects with recompiled liblwip.a]]> Statistics: Posted by vinicius.vbf — Wed Apr 20, 2016 5:33 am


]]>
2016-04-02T01:43:43+08:00 2016-04-02T01:43:43+08:00 https://bbs.espressif.com:443/viewtopic.php?t=1975&p=6312#p6312 <![CDATA[Re: DHCP server error when soft-AP client connects with recompiled liblwip.a]]>
Thanks for your response. It actually worked!!!

Do you know what means ICACHE_RODATA_ATTR?
There's a way to disable it globally?

Statistics: Posted by luisfer.rigoni — Sat Apr 02, 2016 1:43 am


]]>
2016-04-02T01:35:44+08:00 2016-04-02T01:35:44+08:00 https://bbs.espressif.com:443/viewtopic.php?t=1975&p=6311#p6311 <![CDATA[Re: DHCP server error when soft-AP client connects with recompiled liblwip.a]]>
To fix DHCP server, you need to remove ICACHE_RODATA_ATTR from dhcpserver to magic_cookie.

Best regards
Orlando

index f483b64..d1dbba2 100644
--- a/third_party/lwip/core/dhcpserver.c
+++ b/third_party/lwip/core/dhcpserver.c
@@ -14,7 +14,7 @@
////////////////////////////////////////////////////////////////////////////////////
//static const uint8_t xid[4] = {0xad, 0xde, 0x12, 0x23};
//static u8_t old_xid[4] = {0};
-static const u32_t magic_cookie ICACHE_RODATA_ATTR STORE_ATTR = 0x63538263;
+static const u32_t magic_cookie STORE_ATTR = 0x63538263;
static struct udp_pcb *pcb_dhcps = NULL;
static struct ip_addr broadcast_dhcps;
static struct ip_addr server_address;

Statistics: Posted by osteinjr — Sat Apr 02, 2016 1:35 am


]]>
2016-04-01T20:36:24+08:00 2016-04-01T20:36:24+08:00 https://bbs.espressif.com:443/viewtopic.php?t=1975&p=6304#p6304 <![CDATA[Re: DHCP server error when soft-AP client connects with recompiled liblwip.a]]>
I have the same problem using the ESP-01 (512Bytes and 1MBytes). If I compiled LWIP provide in SDK source code with my code, when my device try to connect with ESP occours a Fatal exception (3). I compiled too, using the VirtualBox image provided by Espressif to isolate the environment problem and the problem also happens. Very frustrating .

Statistics: Posted by osteinjr — Fri Apr 01, 2016 8:36 pm


]]>
2016-04-01T20:12:53+08:00 2016-04-01T20:12:53+08:00 https://bbs.espressif.com:443/viewtopic.php?t=1975&p=6303#p6303 <![CDATA[DHCP server error when soft-AP client connects with recompiled liblwip.a]]> I use sample code provided in viewtopic.php?f=31&t=227.

Code:

SDK version:1.4.0(c599790)
mode : softAP(5e:cf:7f:12:2e:cf)
dhcp server start:(ip:192.168.4.1,mask:255.255.255.0,gw:192.168.4.1)
add if1
bcn 100
add 1
aid 1
station: 0c:e7:25:d8:38:60 join, AID = 1
Fatal exception (3):
epc1=0x4024f233
epc2=0x00000000
epc3=0x40105af3
epcvaddr=0x4024d92c
depc=0x00000000
tn_add=0x4024f230
 ets Jan  8 2013,rst cause:2, boot mode:(3,6)

load 0x40100000, len 26044, room 16
tail 12
chksum 0xe6
ho 0 tail 12 room 4
load 0x3ffe8000, len 2128, room 12
tail 4
chksum 0xab
load 0x3ffe8850, len 1408, room 4
tail 12
chksum 0x8a
csum 0x8a


The eagle.S excerpt pointed by epc1 shows:

Code:

4024f230:       ffd821          l32r    a2, 4024f190 <dhcp_start+0xc8>
4024f233:       000232          l8ui    a3, a2, 0
4024f236:       010242          l8ui    a4, a2, 1


If disabling DHCP with wifi_softap_dhcps_stop(); at the end of user_init(), the module don't crashes.

I compile liblwip with

Code:

cd third_party/
./make_lib.sh lwip


I compile my source with

Code:

make BOOT=none APP=0 SPI_SPEED=40 SPI_MODE=QIO SPI_SIZE_MAP=2


I flash module with

Code:

esptool.py --port /dev/ttyUSB0 write_flash 0x00000 eagle.flash.bin 0x20000 eagle.irom0text.bin 0xFE000 blank.bin


My module is ESP-07 with 8MBits =1MBytes
PS: Using liblwip binary provided in lib folder, there's no runtime problem

Statistics: Posted by luisfer.rigoni — Fri Apr 01, 2016 8:12 pm


]]>