Undefined reference to NVS

nrcrast
Posts: 17
Joined: Mon Apr 16, 2018 6:07 pm

Undefined reference to NVS

Postby nrcrast » Mon Jun 18, 2018 3:47 pm

Hi guys,

I'm not sure how my project is different from the scan project, but I'm getting an undefined reference error when I try to integrate the scan code into my own project. Any ideas?

Going into the build directory, I see it compiling the NVS library. Am I missing some sort of wifi configuration?

Code: Select all

/home/nick/esp32_atmo/esp-idf/components/esp32/lib/libnet80211.a(ieee80211.o):(.text.wifi_mode_set+0x0): undefined reference to `g_misc_nvs'
/home/nick/esp32_atmo/esp-idf/components/esp32/lib/libnet80211.a(ieee80211_ioctl.o):(.text.wifi_deinit_process+0x0): undefined reference to `misc_nvs_deinit'
/home/nick/esp32_atmo/esp-idf/components/esp32/lib/libnet80211.a(ieee80211_ioctl.o):(.text.wifi_deinit_process+0x16): undefined reference to `misc_nvs_deinit'
/home/nick/esp32_atmo/esp-idf/components/esp32/lib/libnet80211.a(ieee80211_ioctl.o):(.text.wifi_restore_process+0x0): undefined reference to `misc_nvs_restore'
/home/nick/esp32_atmo/esp-idf/components/esp32/lib/libnet80211.a(ieee80211_ioctl.o):(.text.wifi_restore_process+0x7): undefined reference to `misc_nvs_restore'
/home/nick/esp32_atmo/esp-idf/components/esp32/lib/libnet80211.a(ieee80211_ioctl.o):(.text.wifi_init+0x28): undefined reference to `misc_nvs_init'
/home/nick/esp32_atmo/esp-idf/components/esp32/lib/libnet80211.a(ieee80211_ioctl.o):(.text.wifi_init+0x98): undefined reference to `misc_nvs_init'
-Nick

nrcrast
Posts: 17
Joined: Mon Apr 16, 2018 6:07 pm

Re: Undefined reference to NVS

Postby nrcrast » Tue Jun 19, 2018 1:35 pm

May be worth noting that I'm calling the wifi code from within a component, but I don't think that should make much of a difference at link time.

nrcrast
Posts: 17
Joined: Mon Apr 16, 2018 6:07 pm

Re: Undefined reference to NVS

Postby nrcrast » Tue Jun 19, 2018 7:52 pm

More experimental data:
* Still happens even if I turn off Bluetooth (I have both bluetooth/wifi enabled in my project, thought there may be conflict)
* Happens even if i disable the wifi NVS option menuconfig

nrcrast
Posts: 17
Joined: Mon Apr 16, 2018 6:07 pm

Re: Undefined reference to NVS

Postby nrcrast » Tue Jun 19, 2018 9:09 pm

Figured it out. I have a component called "core", that seems to be overriding a built in component. Renaming it fixes the issue, but I'd rather not rename it.

I tried changing the COMPONENT_NAME variable in my component.mk file, but that didn't seem to do anything. Is there a way I can avoid this clobbering without changing the component name?

ESP_Sprite
Posts: 8921
Joined: Thu Nov 26, 2015 4:08 am

Re: Undefined reference to NVS

Postby ESP_Sprite » Wed Jun 20, 2018 2:41 am

That's interesting... esp-idf doesn't have an explicit component called 'core', just some directories in the lwip and btc directories. Those shouldn't 'count' as components and shouldn't be override-able by another component that's called like this. Any chance you can set up a minimal example of this behavior so we can replicate it?

nrcrast
Posts: 17
Joined: Mon Apr 16, 2018 6:07 pm

Re: Undefined reference to NVS

Postby nrcrast » Wed Jun 20, 2018 3:01 am

Sure, here's an example.

I took the scan example and added a component called core with just a trivial .c/.h pair. If you take core out of the Makefile, it compiles fine.

I've tried with both esp-idf 2.0 and the latest from git and the behavior is the same.

-Nick
Attachments
scan_test.zip
(4.55 KiB) Downloaded 398 times

Who is online

Users browsing this forum: Majestic-12 [Bot] and 133 guests