Copyright © https://mongoose-os.com

Mongoose OS Forum

frame
ATTENTION! This forum has moved to:

https://community.mongoose-os.com

Do not post any new messages.

It happened "Dumping core" when Porting ESP8266 SmartConfig on Mongoose IoT

JaredJared Chongqing,China
edited November 2018 in Mongoose OS

I port the ESP8266 smartconfig on Mongoose IoT. After start of ESP8266, it call 3 functions:

smartconfig_set_type(SC_TYPE_ESPTOUCH); 
wifi_set_opmode(STATION_MODE); 
smartconfig_start(smartconfig_done);

After a moment, it will happen "Dumping core", the log on UART0 as below:

SC version: V2.5.4
scandone
scandone
SC_STATUS_FIND_CHANNEL
heap integrity broken: mask wrong at addr 0x3fff0ac8: n=0x8000, p=0x0
cur = 676

Trap 9: pc=0x4024da3a va=0x1
Dumping core
--- BEGIN CORE DUMP ---
{"arch": "ESP8266", "cause": 9, "REGS": {"addr": 1073650016, "data": "8iUiQGD//z8BAAAAAAAAAFD0/j8AAAAAUPT+PwAAAACUg/4/kAEAAAAAAAC0m/4/pAIAACwmIkC8Df8/gKL+PzraJEAEAAAAAAAAAAAAAAAAAAAAMAAAAA=="}
, "DRAM": {"addr": 1073643520, "data": "AAAAAAAAAAAAAAAAAQEBAQEBAAABAAAAAADNq3gAAAD/AAAAAAQAAG4ZAAAAAAAAAAAAAAAAAABAgP4/AAAAAAAAAAAsg/4/lIP+P/yD/j8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADwi/4/
AQAAAMRjIkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMGGAAAAAAAA
DjPNqzQSbebs3gUACwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAACyD/j8AAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAA

Why? Do you meet the same problem with me? How to solve?
Thanks!

Comments

  • rojerrojer Dublin, Ireland

    yep, i ran into the same thing when trying to use smartconfig: it runs afoul of our malloc implementation's integrity check. we've had no false positives on it so far, so my suspicion is that this is genuine - libsmartconfig just stomps around some memory it allocates (use after free? out of bounds write?), and our malloc detects it. but it's a binary blob, so i can't verify.

  • JaredJared Chongqing,China

    So, I try another test, after calling the function "wifi_promiscuous_enable(1)" to set ESP8266 monitor mode, it will ran into the same problem.

  • SergeySergey Dublin, Ireland
    edited October 2016

    @Jared , since the wifi stack is closed by Espressif, we cannot do anything about it, unfortunately. This must be resolved with Espressif.

    Could you elaborate on what project you are working on, please?

  • JaredJared Chongqing,China

    Thanks, I found that the NonOS functions of ESP8266 must be called before Mongoose-IoT SDK initted. Because NonOS's heap address are same with Mongoose-IoT SDK's heap address for ESP8266. If calling the NonOS functions after Mongoose-IoT SDK initted, this can cause exceptions. So I port smartconfig at the begin of Mongoose-IoT, after configuring, Mongoose-IoT init will be executed.
    But it will run into new problem. After calling smartconfig function, ESP8266 will wait for receiving configuration data, but waiting for a while, the ESP8266 will be reset, the time of waiting are not fixed. Why the ESP8266 will be reset. But if ESP8266 received configuration data after calling smartconfig function and finished to connect wlan, ESP8266 will be steady running.
    The log of ESP8266 reset as below:
    {d�c��go�don���cx��lslslp�g��dco�|d��c��oo��nnlo{���n�llp�o�r�����cg�|���b��gg��gglns���g�l�ls��g�d�lrd�b�go���x|��cpb�c��oo��g�c�gcx�ol�g��o��oc��llxc���g��odln�������g��g����c�lllsl�c�gg��l�nng�oo��|���g�����n��r��o|��l�p{l��s�l�l�d��r�l�d�l��s�l��dl`{l��{l�
    -> Set UART Rate: 115200 ... done.
    -> Set CPU Freq 160 MHz.
    SC version: V2.5.4
    scandone
    scandone
    SC_STATUS_FIND_CHANNEL

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

    wdt reset
    load 0x40100000, len 1688, room 16
    tail 8
    chksum 0x49
    load 0x3ffe8000, len 784, room 0
    tail 0
    chksum 0x7e
    csum 0x7e

    rBoot v1.2.1 - richardaburton@gmail.com
    Flash Size: 32 Mbit
    Flash Mode: DIO
    Flash Speed: 40 MHz
    rBoot Option: Big flash

    Booting rom 0.
    ����o��s��g|��d�xrd��r�l�d�l��s�l�l�l��{�d��ll`rl��rd�
    -> Set UART Rate: 115200 ... done.
    -> Set CPU Freq 160 MHz.
    SC version: V2.5.4
    scandone
    scandone
    SC_STATUS_FIND_CHANNEL

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

    wdt reset
    load 0x40100000, len 1688, room 16
    tail 8
    chksum 0x49
    load 0x3ffe8000, len 784, room 0
    tail 0
    chksum 0x7e
    csum 0x7e

    rBoot v1.2.1 - richardaburton@gmail.com
    Flash Size: 32 Mbit
    Flash Mode: DIO
    Flash Speed: 40 MHz
    rBoot Option: Big flash

    Booting rom 0.
    ����g��{��n|��l�psl��s�l�l�l��{�d�l�d��s�l��ll`sl��sl�
    -> Set UART Rate: 115200 ... done.
    -> Set CPU Freq 160 MHz.
    SC version: V2.5.4
    scandone
    scandone
    SC_STATUS_FIND_CHANNEL

  • SergeySergey Dublin, Ireland

    Thanks Jared.
    We will not be looking at smartconfig-related issues, however.
    As we said, these are caused by smartconfig code, not Mongoose IoT code.

Sign In or Register to comment.