Page 1 of 1

Now wifi won't work

Posted: Wed Mar 01, 2017 12:59 pm
by murray_lang
Hi all,

I have been successfully using WiFi for some time, but with the latest SDK I now see:

Code: Select all

W (1031) wifi: wifi nvs_open fail ret=4353                                      
                                                                                
E (1031) wifi: wifi_init 1191 ret=4353                                          
assertion "0 && "esp_wifi_init(&cfg)"" failed: file "/home/murray/Robotics/Weta/
vm/weta-esp/weta-esp32/main/./main.c", line 61, function: init_wifi             
abort() was called at PC 0x400d2313                                             
Guru Meditation Error: Core  0 panic'ed (abort)                                 
                                                                                
Backtrace: 0x40008155:0x3ffb8ea0 0x40007d16:0x3ffb8ec0 0x400d2fa6:0x3ffb8ef0 0x4
00d3012:0x3ffb8f90 0x400d1191:0x3ffb8fc0
I thought it might have been something to do with the new storage of PHY calibration data in NVS, but disabling that made no difference.
What do I need to do to prevent this please?

Regards,
Murray

Re: Now wifi won't work

Posted: Wed Mar 01, 2017 2:45 pm
by kolban
I am presuming you are calling esp_wifi_init() and it is returning a value other than ESP_OK. What I would suggest you do is capture the numeric value that is returned in a variable and then log that variable. That will give us a clue as to what return code is being returned. Also, the esp_wifi_init takes as input a structure (if I remember correctly). It is possible that there is an error in the input data being passed into esp_wifi_init() ... so you might want to post the values passed in.

If you have just changed environments, consider deleting sdkconfig file and rebuild a new one by running "make menuconfig".

Also consider completely erasing flash memory on the ESP32 using the esptool erase_flash command.

Re: Now wifi won't work

Posted: Wed Mar 01, 2017 3:06 pm
by ESP_igrr
Can you add a call to nvs_flash_init() before calling esp_wifi_init?
Also do keep "store calibration data in NVS" option enabled for now.

Re: Now wifi won't work

Posted: Wed Mar 01, 2017 3:57 pm
by murray_lang
Hi Neil,

The code was working for some time as is, and I ran make menuconfig (I was forced to by the SDK update anyway). I'll try erasing the flash.

Hi iggr,

I tried adding nvs_flash_init() when I remembered about the new PHY nvs param storage setting, but that didn't fix it. It's late here now, but I will follow suggestions tomorrow and report back.

Murray

Re: Now wifi won't work

Posted: Wed Mar 01, 2017 5:41 pm
by enitalp
Lucky you, you get an assert at least.

Since yesterday i'm dealing with the same problem, but i do crash.
Changing to store phy calibration fixed my crash. thanks for the tip,

FYI here is my crash before

Code: Select all

===============================================================
==================== ESP32 CORE DUMP START ====================

================== CURRENT THREAD REGISTERS ===================
pc             0x4008a056       0x4008a056 <register_chipv7_phy_init_param+6>
lbeg           0x0      0
lend           0x0      0
lcount         0x0      0
sar            0x0      0
ps             0x60c30  396336
threadptr      <unavailable>
br             <unavailable>
scompare1      <unavailable>
acclo          <unavailable>
acchi          <unavailable>
m0             <unavailable>
m1             <unavailable>
m2             <unavailable>
m3             <unavailable>
expstate       <unavailable>
f64r_lo        <unavailable>
f64r_hi        <unavailable>
f64s           <unavailable>
fcr            <unavailable>
fsr            <unavailable>
a0             0x3ffc8ee0       1073516256
a1             0x0      0
a2             0x3ffc6ed0       1073508048
a3             0x1      1
a4             0x0      0
a5             0x0      0
a6             0x0      0
a7             0x0      0
a8             0x0      0
a9             0x0      0
a10            0x0      0
a11            0x0      0
a12            0x0      0
a13            0x0      0
a14            0x0      0
a15            0x0      0

==================== CURRENT THREAD STACK =====================
#0  0x4008a056 in register_chipv7_phy_init_param ()

======================== THREADS INFO =========================
  Id   Target Id         Frame
  9    process 8         0x40084757 in xQueueGenericReceive (xQueue=0x0, pvBuffer=0x0, xTicksToWait=<unavailable>, xJustPeeking=0) at C:/ESP32-IDK-SDK/esp-idf/components/freertos/queue.c:1594
  8    process 7         0x40084757 in xQueueGenericReceive (xQueue=0x3ffc3760, pvBuffer=0x3f40537c, xTicksToWait=<unavailable>, xJustPeeking=0) at C:/ESP32-IDK-SDK/esp-idf/components/freertos/queue.c:1594
  7    process 6         0x40084757 in xQueueGenericReceive (xQueue=0x0, pvBuffer=0x0, xTicksToWait=<unavailable>, xJustPeeking=0) at C:/ESP32-IDK-SDK/esp-idf/components/freertos/queue.c:1594
  6    process 5         0x40084e8a in prvProcessTimerOrBlockTask (xNextExpireTime=<optimized out>, xListWasEmpty=<optimized out>) at C:/ESP32-IDK-SDK/esp-idf/components/freertos/timers.c:487
  5    process 4         0x40084757 in xQueueGenericReceive (xQueue=0x3ffc54dc <mbox>, pvBuffer=0x3ffb7b80, xTicksToWait=0, xJustPeeking=0) at C:/ESP32-IDK-SDK/esp-idf/components/freertos/queue.c:1594
  4    process 3         prvIdleTask (pvParameters=0x0) at C:/ESP32-IDK-SDK/esp-idf/components/freertos/tasks.c:3248
  3    process 2         0x4008438e in xQueueGenericSend (xQueue=0x3ffbc9bc, pvItemToQueue=<optimized out>, xTicksToWait=4294967295, xCopyPosition=0) at C:/ESP32-IDK-SDK/esp-idf/components/freertos/queue.c:775
  2    process 1         0x4009993c in ?? ()
* 1    <main task>       0x4008a056 in register_chipv7_phy_init_param ()

======================= ALL MEMORY REGIONS ========================
Name   Address   Size   Attrs
.rtc.text 0x400c0000 0x0 RW
.iram0.vectors 0x40080000 0x400 R XA
.iram0.text 0x40080400 0x1a1a0 R XA
.dram0.data 0x3ffc0000 0x1f28 RW A
.flash.rodata 0x3f400010 0x8500 RW A
.flash.text 0x400d0018 0x3b894 R XA
.coredump.tasks 0x3ffbd050 0x174 RW
.coredump.tasks 0x3ffc8e20 0x264 RW
.coredump.tasks 0x3ffd448c 0x174 RW
.coredump.tasks 0x3ffd4360 0x120 RW
.coredump.tasks 0x3ffb5a28 0x174 RW
.coredump.tasks 0x3ffb57b0 0x26c RW
.coredump.tasks 0x3ffb61c8 0x174 RW
.coredump.tasks 0x3ffb6090 0x12c RW
.coredump.tasks 0x3ffb7c28 0x174 RW
.coredump.tasks 0x3ffb7ad0 0x14c RW
.coredump.tasks 0x3ffb6980 0x174 RW
.coredump.tasks 0x3ffb6890 0xe4 RW
.coredump.tasks 0x3ffb7da4 0x174 RW
.coredump.tasks 0x3ffbc870 0x110 RW
.coredump.tasks 0x3ffd3610 0x174 RW
.coredump.tasks 0x3ffd3510 0xf4 RW
.coredump.tasks 0x3ffb38a4 0x174 RW
.coredump.tasks 0x3ffb37b0 0xe8 RW

===================== ESP32 CORE DUMP END =====================

Re: Now wifi won't work

Posted: Thu Mar 02, 2017 1:20 am
by murray_lang
Sorry fellas,

I added nvs_flash_init() to one of my tasks by mistake instead of main. Tired and rushing.

All good now.

Many thanks,
Murray