Skip to content

Constructing IPAddress crashes ESP. Since 2.5.0. Works in 2.4.2. #5420

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
3 of 6 tasks
crndn2018 opened this issue Dec 3, 2018 · 1 comment · Fixed by #5421
Closed
3 of 6 tasks

Constructing IPAddress crashes ESP. Since 2.5.0. Works in 2.4.2. #5420

crndn2018 opened this issue Dec 3, 2018 · 1 comment · Fixed by #5421
Assignees

Comments

@crndn2018
Copy link

Basic Infos

  • This issue complies with the issue POLICY doc.
  • I have read the documentation at readthedocs and the issue is not addressed there.
  • I have tested that the issue is present in current master branch (aka latest git).
  • I have searched the issue tracker for a similar issue.
  • If there is a stack dump, I have decoded it.
  • I have filled out all fields below.

Platform

  • Hardware: [ESP-12]
  • Core Version: [773f306]
  • Development Env: [Arduino IDE]
  • Operating System: [Windows]

Settings in IDE

  • Module: [Generic ESP8266 Module]
  • Flash Mode: [qio]
  • Flash Size: [4MB]
  • lwip Variant: [v2 Lower Memory]
  • Reset Method: [ck]
  • Flash Frequency: [40Mhz]
  • CPU Frequency: [80Mhz]
  • Upload Using: [SERIAL]
  • Upload Speed: [115200] (serial upload only)

Problem Description

This sketch works fine with Core 2.4.2. With 2.5.0 it throws Exceptions.

MCVE Sketch

#include <ESP8266WiFi.h>

struct NetworkEthernetSetup 
{
  byte bMac[6];
  byte bIp[4];
  byte bDns[4];
  byte bGateway[4];
  byte bNetmask[4];
};

NetworkEthernetSetup nes;

void setup() {
  Serial1.begin(115200);
  
  nes.bMac[0] = 0xA;
  nes.bMac[1] = 0xB;
  nes.bMac[2] = 0xC;
  nes.bMac[3] = 0xD;
  nes.bMac[4] = 0xE;
  nes.bMac[5] = 0xF;

  nes.bIp[0] = 192;
  nes.bIp[1] = 168;
  nes.bIp[2] = 16;
  nes.bIp[3] = 1;
  
  nes.bDns[0] = 192;
  nes.bDns[1] = 168;
  nes.bDns[2] = 16;
  nes.bDns[3] = 2;

  nes.bGateway[0] = 192;
  nes.bGateway[1] = 168;
  nes.bGateway[2] = 16;
  nes.bGateway[3] = 3;

  nes.bNetmask[0] = 255;
  nes.bNetmask[1] = 255;
  nes.bNetmask[2] = 255;
  nes.bNetmask[3] = 0;
}

void loop() {
  
  Serial1.println("Livebeat");
  IPAddress ipa = IPAddress(nes.bIp);    // Here is the problem !
  delay(1000);
}

### Debug Messages

Exception (9):
epc1=0x402027d3 epc2=0x00000000 epc3=0x00000000 excvaddr=0x3ffee61e depc=0x00000000

>>>stack>>>

ctx: cont
sp: 3ffffd90 end: 3fffffc0 offset: 01a0
3fffff30:  3fffdad0 00000008 3ffee630 40202630
3fffff40:  3fffdad0 00000000 3ffee630 40202835
3fffff50:  3ffe887c 0000001c 00000000 40202835
3fffff60:  3ffe8870 feefeffe 3ffee630 40202850
3fffff70:  3fffdad0 00000001 3ffee630 40202874
3fffff80:  0001c200 00000000 3ffee684 402025ab
3fffff90:  feefeffe 00000000 3ffee684 40202528
3fffffa0:  feefeffe feefeffe feefeffe 40202c54
3fffffb0:  feefeffe feefeffe 3ffe8500 40100a35
<<<stack<<<

 ets Jan  8 2013,rst cause:2, boot mode:(3,6)

load 0x4010f000, len 1384, room 16
tail 8
chksum 0x2d
csum 0x2d
v00000000
~ld
@d-a-v
Copy link
Collaborator

d-a-v commented Dec 3, 2018

reproduced, fix on its way #5421.
Thanks

@d-a-v d-a-v added the type: bug label Dec 3, 2018
@d-a-v d-a-v self-assigned this Dec 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants