Another day, another SDK fubar…

So, you’ve upgraded to SDK 1.*, you do”make” in your application directory and…  the world explodes (which is pretty much normal when you do an SDK upgrade).  Sigh!

...
CC modules/config.c
CC modules/wifi.c
AR build/app_app.a
LD build/app.out
/opt/Espressif/ESP8266_SDK/lib/libmain.a(app_main.o): In function `user_uart_wait_tx_fifo_empty':
(.irom0.text+0x340): undefined reference to `user_rf_pre_init'
/opt/Espressif/ESP8266_SDK/lib/libmain.a(app_main.o): In function `user_uart_wait_tx_fifo_empty':
(.irom0.text+0x45c): undefined reference to `user_rf_pre_init'
collect2: error: ld returned 1 exit status
make: *** [build/app.out] Error 1

Luckily this one is easy. It is now mandatory that you have a user_rf_pre_init() function somewhere in your code and, if you’re recompiling an existing project which was created with a pre v1.* SDK, you most probably won’t have one.

The solution is simple. Just create a dummy, empty function in the top of your user_main.c (or whatever file your user code happens to be in). The function should look something like this:-
void user_rf_pre_init(void) { return; }

Now re-run make and you should get a clean compile (please note that I didn’t say  it will actually work …just compile!).

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s