jonask1337 / esp-idf-nat-example

ESP-IDF example project with NAT setup.
82 stars 15 forks source link

Errors on esp_wifi_init() #3

Closed dcambron closed 5 years ago

dcambron commented 5 years ago

I was able to get this project to compile with the changes to the lwip component and using ESP-IDF release/v3.3 branch, and changing the setting regarding layer2 and layer3 copying, but when I flash code to an ESP32-WROOM, it is failing at esp_wifi_init() and rebooting with the following COM port output:

Rebooting...
ets Jun  8 2016 00:22:57

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0018,len:4
load:0x3fff001c,len:6376
load:0x40078000,len:11308
load:0x40080400,len:6700
entry 0x40080764
I (29) boot: ESP-IDF v3.3-beta3-34-g8c57aa024-dirty 2nd stage bootloader
I (29) boot: compile time 11:23:19
I (30) boot: Enabling RNG early entropy source...
I (36) boot: SPI Speed      : 40MHz
I (40) boot: SPI Mode       : DIO
I (44) boot: SPI Flash Size : 4MB
I (48) boot: Partition Table:
I (51) boot: ## Label            Usage          Type ST Offset   Length
I (59) boot:  0 nvs              WiFi data        01 02 00009000 00006000
I (66) boot:  1 phy_init         RF data          01 01 0000f000 00001000
I (74) boot:  2 factory          factory app      00 00 00010000 00100000
I (81) boot: End of partition table
I (85) esp_image: segment 0: paddr=0x00010020 vaddr=0x3f400020 size=0x18220 ( 98                           848) map
I (129) esp_image: segment 1: paddr=0x00028248 vaddr=0x3ffb0000 size=0x02e0c ( 1                           1788) load
I (134) esp_image: segment 2: paddr=0x0002b05c vaddr=0x40080000 size=0x00400 (                             1024) load
I (136) esp_image: segment 3: paddr=0x0002b464 vaddr=0x40080400 size=0x04bac ( 1                           9372) load
I (153) esp_image: segment 4: paddr=0x00030018 vaddr=0x400d0018 size=0x68cf4 (42                           9300) map
I (304) esp_image: segment 5: paddr=0x00098d14 vaddr=0x40084fac size=0x0bdd4 ( 4                           8596) load
I (334) boot: Loaded app from partition at offset 0x10000
I (334) boot: Disabling RNG early entropy source...
I (335) cpu_start: Pro cpu up.
I (338) cpu_start: Application information:
I (343) cpu_start: Project name:     esp-idf-nat-example
I (349) cpu_start: App version:      1
I (354) cpu_start: Compile time:     Jun 11 2019 11:23:05
I (360) cpu_start: ELF file SHA256:  9c8e5442de069042...
I (366) cpu_start: ESP-IDF:          v3.3-beta3-34-g8c57aa024-dirty
I (373) cpu_start: Starting app cpu, entry point is 0x40081070
I (365) cpu_start: App cpu up.
I (383) heap_init: Initializing. RAM available for dynamic allocation:
I (390) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM
I (396) heap_init: At 3FFB8DF8 len 00027208 (156 KiB): DRAM
I (402) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (409) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (415) heap_init: At 40090D80 len 0000F280 (60 KiB): IRAM
I (421) cpu_start: Pro cpu start user code
I (104) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
I (167) net80211: OS adapter function version error! Version 1 is expected, but                            it is 2
ESP_ERROR_CHECK failed: esp_err_t 0x102 (ESP_ERR_INVALID_ARG) at 0x4008be70
file: "C:/msys32/home/dcambron/esp/esp-idf-nat-example-master/main/main.c" line                            90
func: wifi_init_sta
expression: esp_wifi_init(&cfg)

ELF file SHA256: 9c8e5442de0690429a3484feb97d07e463d850faa7873ac4a017bc79e31fd22                           a

Backtrace: 0x4008ba08:0x3ffba9a0 0x4008be73:0x3ffba9c0 0x400d2a95:0x3ffba9e0 0x4                           00d2c78:0x3ffbabd0 0x400d0ea2:0x3ffbabf0 0x4008eeb1:0x3ffbac10

Rebooting...
dcambron commented 5 years ago

It looks like there were some issues switching between ESP-IDF branches. I went back to stable release/3.2 and ran 'git submodule update' and rebuilt the project and it worked.