What is "wifi0iram", and how to get rid of it?

PanicanWhyasker
Posts: 45
Joined: Sun Jan 06, 2019 12:42 pm

What is "wifi0iram", and how to get rid of it?

Postby PanicanWhyasker » Mon Mar 11, 2019 4:25 pm

Me and a colleague are developing using the ESP-IDF. The IDF version is v3.3 beta 1 (git commit e931fe9).
The strangest thing is happening when we try compiling on Windows. On Linux (which I'm using), everything builds nicely.
On his machine, the exact same app code, the exact same IDF (using the same git hash) produces an error while executing the elf2image step:

Code: Select all

A fatal error occurred: Invalid segment count 25 (max 16). Usually this indicates a linker script problem.
We went on to print out the segments that elf2image has when it does its check, by adding some debug prints in esptool.py, and we got this:

Code: Select all

.rtc.text len 0x00064 load 0x400c0000,
.rtc.data len 0x00dfc load 0x50000200,
.iram0.vectors len 0x00400 load 0x40080000,
.iram0.text len 0x0dc64 load 0x40080400,
.dram0.data len 0x02664 load 0x3ffb0000,
.flash.rodata len 0x22cdc load 0x3f400020,
.flash.text len 0x75bd4 load 0x400d0018,
.wifi0iram.2 len 0x00eb0 load 0x40145bec,
.wifi0iram.3 len 0x00974 load 0x40146a9c,
.wifi0iram.12 len 0x000a8 load 0x40147410,
.wifi0iram.9 len 0x002f0 load 0x401474b8,
.wifi0iram.11 len 0x00264 load 0x401477a8,
.wifi0iram.4 len 0x007c0 load 0x40147a0c,
.wifi0iram.13 len 0x00020 load 0x401481cc,
.wifi0iram.6 len 0x000dc load 0x401481ec,
.wifi0iram.17 len 0x001a8 load 0x401482c8,
.wifi0iram.16 len 0x00124 load 0x40148470,
.wifi0iram.18 len 0x00210 load 0x40148594,
.wifi0iram.20 len 0x0016c load 0x401487a4,
.wifi0iram.21 len 0x00084 load 0x40148910,
.wifi0iram.14 len 0x0063c load 0x40148994,
.wifi0iram.8 len 0x00044 load 0x40148fd0,
.wifi0iram.15 len 0x00600 load 0x40149014,
.wifi0iram.5 len 0x00204 load 0x40149614,
.wifi0iram.7 len 0x002f0 load 0x40149818
On the Linux machine, the ".wifi0iram.*" sections are absent and I don't have issues building.

Does anybody on earth know where these wifi0iram sections appeared from and how to get rid of them?

I'd be glad to contribute time in diagnosing this issue, and submitting a PR if we find the culprit and fix it.


ESP_Angus
Posts: 2344
Joined: Sun May 08, 2016 4:11 am

Re: What is "wifi0iram", and how to get rid of it?

Postby ESP_Angus » Tue Mar 12, 2019 1:33 am

Hi Panican,

Are any warnings printed by the build system about submodules being out of sync? If so, a "git submodule update" should straighten this out.

(Newer WiFi libs have the .wifi0iram sections for the configurable optimisations that WiFive linked to. Newer IDF has linker script sections to handle this. A mismatch between newer WiFi libs and an older IDF's linker script will produce linker errors like these.)

EDIT: This optimisation was added in v3.3-beta2, so if the IDF version is v3.3-beta1 then a newer wifi library submodule is probably the root cause.

PanicanWhyasker
Posts: 45
Joined: Sun Jan 06, 2019 12:42 pm

Re: What is "wifi0iram", and how to get rid of it?

Postby PanicanWhyasker » Thu Mar 14, 2019 4:24 pm

Many thanks, we updated the IDF to a stable version and the problem went away!

Who is online

Users browsing this forum: No registered users and 156 guests