sdk_v1.1.0_15_05_22 : undefined ref user_rf_pre_init

User avatar
rudi
Posts: 197
Joined: Fri Oct 24, 2014 7:55 pm

sdk_v1.1.0_15_05_22 : undefined ref user_rf_pre_init

Postby rudi » Sun May 24, 2015 7:51 pm

hi

the compiler breaks with undefined reference to 'user_rf_pre_init' in the at app example.

think,
the funcion in user_main.c

void user_rf_pre_init(void) {
}

makes fail without a define

void user_rf_pre_init(void);

at begin in user_main.c



hint: libmain.a
function: user_uart_wait_tx_fifo_empty



best wishes
rudi ;-)

-------------------------------------
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪

harrys
Posts: 4
Joined: Mon May 25, 2015 3:13 pm
Location: The Netherlands

Re: sdk_v1.1.0_15_05_22 : undefined ref user_rf_pre_init

Postby harrys » Mon May 25, 2015 3:23 pm

I can confirm the same issue

/opt/Espressif/ESP8266_SDK_1.1.0/lib/libmain.a(app_main.o): In function `user_uart_wait_tx_fifo_empty':
(.irom0.text+0x34c): undefined reference to `user_rf_pre_init'
/opt/Espressif/ESP8266_SDK_1.1.0/lib/libmain.a(app_main.o): In function `user_uart_wait_tx_fifo_empty':
(.irom0.text+0x474): undefined reference to `user_rf_pre_init'
collect2: error: ld returned 1 exit status
make: *** [build/test.out] Error 1

code compiles ok with SDK 1.0.1

Regards, Harry
5xESP-01 (MQTT Switch)
2xESP-07 (Test/Dev)

hdrut
Posts: 25
Joined: Fri Feb 13, 2015 11:02 am
Location: Argentina

Re: sdk_v1.1.0_15_05_22 : undefined ref user_rf_pre_init

Postby hdrut » Mon May 25, 2015 11:37 pm

I confirm the issue.


/home/esp8266/Projects/esp_iot_sdk_v1.1.0/lib/libmain.a(app_main.o): In function `user_uart_wait_tx_fifo_empty':
(.irom0.text+0x34c): undefined reference to `user_rf_pre_init'


Any fix for this??

thks ,rgds

ESP_Faye
Posts: 1646
Joined: Mon Oct 27, 2014 11:08 am

Re: sdk_v1.1.0_15_05_22 : undefined ref user_rf_pre_init

Postby ESP_Faye » Tue May 26, 2015 11:05 am

Hi,

Since SDK_v1.1.0 , user_rf_pre_init is added for user-define RF initialization.

Users need to add void user_rf_pre_init(void) in user_main.c , refer to IOT_Demo (user_main.c)

So sorry for the inconvenience.

hdrut
Posts: 25
Joined: Fri Feb 13, 2015 11:02 am
Location: Argentina

Re: sdk_v1.1.0_15_05_22 : undefined ref user_rf_pre_init

Postby hdrut » Tue May 26, 2015 7:33 pm

Thanks, that did the trick !!

harrys
Posts: 4
Joined: Mon May 25, 2015 3:13 pm
Location: The Netherlands

Re: sdk_v1.1.0_15_05_22 : undefined ref user_rf_pre_init

Postby harrys » Wed May 27, 2015 1:11 am

Thanks, working again
5xESP-01 (MQTT Switch)
2xESP-07 (Test/Dev)

User avatar
rudi
Posts: 197
Joined: Fri Oct 24, 2014 7:55 pm

Re: sdk_v1.1.0_15_05_22 : undefined ref user_rf_pre_init

Postby rudi » Wed May 27, 2015 9:16 pm

Espressif_Faye wrote:Hi,

Since SDK_v1.1.0 , user_rf_pre_init is added for user-define RF initialization.

Users need to add void user_rf_pre_init(void) in user_main.c , refer to IOT_Demo (user_main.c)

So sorry for the inconvenience.



rudi wrote:
..
makes fail without a define

void user_rf_pre_init(void);

at begin in user_main.c




yes you are right ;)


;-)

-------------------------------------
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪

dkinzer
Posts: 52
Joined: Fri Jul 31, 2015 7:37 am

Re: sdk_v1.1.0_15_05_22 : undefined ref user_rf_pre_init

Postby dkinzer » Mon Aug 03, 2015 6:50 am

Espressif_Faye wrote:Users need to add void user_rf_pre_init(void) in user_main.c , refer to IOT_Demo (user_main.c).
I realize that this is a thread from several months ago but it has been bugging me since the requirement was introduced. The "proper" way to handle something like this is to define a do-nothing stub with the name user_rf_pre_init() as a weak symbol in the module that calls user_rf_pre_init(). Then, if an application author wants to perform such pre-initialization they would just define the function normally (i.e., not weak) and it will automatically replace the weak stub.

https://en.wikipedia.org/wiki/Weak_symbol

The advantage to doing it the "right" way is that it has no effect on anyone who has no interest in using the feature *and* it doesn't break existing code.
Don Kinzer
Beaverton, OR, USA

Who is online

Users browsing this forum: No registered users and 2 guests