NONOS SDK 1.5.3 not compiling

Blop
Posts: 3
Joined: Sat Apr 23, 2016 4:02 am

NONOS SDK 1.5.3 not compiling

Postby Blop » Sat Apr 23, 2016 4:18 am

Hi,
My app makes use of the UART functions but it does not compile anymore. It seems that there is some conflicts between libat and libdriver.

-With no changes or even if including "driver/uart.h":

Code: Select all

xtensa-lx106-elf-gcc  -L../lib -nostdlib -T../ld/eagle.app.v6.ld -Wl,--no-check-sections -u call_user_start -Wl,-static -Wl,--start-group -lc -lgcc -lhal -lphy -lpp -lnet80211 -llwip -lwpa -lcrypto -lmain -ljson -lupgrade -lssl -lwps -lsmartconfig -lairkiss user/.output/eagle/debug/lib/libuser.a -lat -Wl,--end-group -o .output/eagle/debug/image/eagle.app.v6.out
user/.output/eagle/debug/lib/libuser.a(user_main.o): In function `msgbroadcast':
/mnt/Share/app/user/user_main.c:145: undefined reference to `uart0_tx_buffer'
user/.output/eagle/debug/lib/libuser.a(user_main.o): In function `bf_sndbroad':
/mnt/Share/app/user/user_main.c:164: undefined reference to `uart0_tx_buffer'
collect2: error: ld returned 1 exit status


-When modifying the app makefile by adding -ldriver in LINKFLAGS:

Code: Select all

xtensa-lx106-elf-gcc  -L../lib -nostdlib -T../ld/eagle.app.v6.ld -Wl,--no-check-sections -u call_user_start -Wl,-static -Wl,--start-group -lc -lgcc -lhal -lphy -lpp -lnet80211 -llwip -lwpa -lcrypto -lmain -ljson -lupgrade -lssl -lwps -lsmartconfig -lairkiss -ldriver user/.output/eagle/debug/lib/libuser.a -lat -Wl,--end-group -o .output/eagle/debug/image/eagle.app.v6.out
../lib/libdriver.a(uart.o): In function `uart_tx_one_char':
(.text.uart_tx_one_char+0x8): multiple definition of `uart_tx_one_char'
../lib/libat.a(uart.o):(.text+0xb0): first defined here
../lib/libdriver.a(uart.o): In function `uart0_sendStr':
(.irom0.text+0x1e8): multiple definition of `at_port_print'
../lib/libat.a(uart.o):(.irom0.text+0x228): first defined here
../lib/libdriver.a(uart.o): In function `uart_init':
(.irom0.text+0x224): multiple definition of `uart_init'
../lib/libat.a(uart.o):(.irom0.text+0x290): first defined here
../lib/libdriver.a(uart.o): In function `uart_reattach':
(.irom0.text+0x270): multiple definition of `uart_reattach'
../lib/libat.a(uart.o):(.irom0.text+0x2d0): first defined here
../lib/libdriver.a(uart.o): In function `uart_tx_one_char_no_wait':
(.text.uart_tx_one_char_no_wait+0x8): multiple definition of `uart_tx_one_char_no_wait'
../lib/libat.a(uart.o):(.text+0x238): first defined here
../lib/libdriver.a(uart.o): In function `uart1_sendStr_no_wait':
(.text.uart1_sendStr_no_wait+0x4): multiple definition of `uart1_sendStr_no_wait'
../lib/libat.a(uart.o):(.text+0x25c): first defined here
../lib/libdriver.a(uart.o): In function `uart_rx_intr_disable':
(.text.uart_rx_intr_disable+0x4): multiple definition of `uart_rx_intr_disable'
../lib/libat.a(uart.o):(.text+0x688): first defined here
../lib/libdriver.a(uart.o): In function `uart_rx_intr_enable':
(.text.uart_rx_intr_enable+0x4): multiple definition of `uart_rx_intr_enable'
../lib/libat.a(uart.o):(.text+0x6b0): first defined here
../lib/libdriver.a(uart.o): In function `UART_SetWordLength':
(.irom0.text+0x334): multiple definition of `UART_SetWordLength'
../lib/libat.a(uart.o):(.irom0.text+0x918): first defined here
../lib/libdriver.a(uart.o): In function `UART_SetStopBits':
(.irom0.text+0x360): multiple definition of `UART_SetStopBits'
../lib/libat.a(uart.o):(.irom0.text+0x948): first defined here
../lib/libdriver.a(uart.o): In function `UART_SetLineInverse':
(.irom0.text+0x394): multiple definition of `UART_SetLineInverse'
../lib/libat.a(uart.o):(.irom0.text+0x97c): first defined here
../lib/libdriver.a(uart.o): In function `UART_SetParity':
(.irom0.text+0x3c8): multiple definition of `UART_SetParity'
../lib/libat.a(uart.o):(.irom0.text+0x9b4): first defined here
../lib/libdriver.a(uart.o): In function `UART_SetBaudrate':
(.irom0.text+0x40c): multiple definition of `UART_SetBaudrate'
../lib/libat.a(uart.o):(.irom0.text+0x9f8): first defined here
../lib/libdriver.a(uart.o): In function `UART_SetFlowCtrl':
(.irom0.text+0x458): multiple definition of `UART_SetFlowCtrl'
../lib/libat.a(uart.o):(.irom0.text+0xa44): first defined here
../lib/libdriver.a(uart.o): In function `UART_WaitTxFifoEmpty':
(.irom0.text+0x534): multiple definition of `UART_WaitTxFifoEmpty'
../lib/libat.a(uart.o):(.irom0.text+0xbec): first defined here
../lib/libdriver.a(uart.o): In function `UART_CheckOutputFinished':
(.irom0.text+0x5a0): multiple definition of `UART_CheckOutputFinished'
../lib/libat.a(uart.o):(.irom0.text+0xb40): first defined here
../lib/libdriver.a(uart.o): In function `UART_ResetFifo':
(.irom0.text+0x610): multiple definition of `UART_ResetFifo'
../lib/libat.a(uart.o):(.irom0.text+0xc20): first defined here
../lib/libdriver.a(uart.o): In function `UART_ClearIntrStatus':
(.irom0.text+0x648): multiple definition of `UART_ClearIntrStatus'
../lib/libat.a(uart.o):(.irom0.text+0xc5c): first defined here
../lib/libdriver.a(uart.o): In function `UART_SetIntrEna':
(.irom0.text+0x664): multiple definition of `UART_SetIntrEna'
../lib/libat.a(uart.o):(.irom0.text+0xc78): first defined here
../lib/libdriver.a(uart.o): In function `UART_SetPrintPort':
(.irom0.text+0x698): multiple definition of `UART_SetPrintPort'
../lib/libat.a(uart.o):(.irom0.text+0xca4): first defined here
collect2: error: ld returned 1 exit status


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

Re: NONOS SDK 1.5.3 not compiling

Postby ESP_Faye » Tue Apr 26, 2016 11:10 am

Hi,

Yes. AT commands are sent by a host to ESP8266 through UART, so it has already taken the UART driver.

There are some AT related APIs you can use, please refer to the documentation 2C-ESP8266__SDK__API Guide.

Blop
Posts: 3
Joined: Sat Apr 23, 2016 4:02 am

Re: NONOS SDK 1.5.3 not compiling

Postby Blop » Thu Apr 28, 2016 5:15 pm

As you can see in my first code block, the only API function I need is uart0_tx_buffer. I do not understand what I am supposed to do since it cannot be linked anymore, and the API guide is not helping on this point.
I think that something bas been missed when the UART API bas been moved from libat to libdriver.

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

Re: NONOS SDK 1.5.3 not compiling

Postby ESP_Faye » Wed May 04, 2016 9:36 am

Hi,

What do you want to do with uart0_tx_buffer?

If you need to print some logs, you can use at_port_print instead.

Thanks for your interest in ESP8266 !

Blop
Posts: 3
Joined: Sat Apr 23, 2016 4:02 am

Re: NONOS SDK 1.5.3 not compiling

Postby Blop » Thu May 05, 2016 7:25 am

Actually, the compiler output shown above is a bit misleading: I only call uart0_tx_buffer once in my code.
If I comment out this call, the compile process runs fine.

I just call the function for its intended use: send a buffer, for which one the length to send is already known.

This call is made inside a socket receive callback, in order to easily and directly forward the incoming message buffer to the host microcontroller (and then the ESP autonomously forwards this message to potential softAP clients or broadcasts it to station).

Code: Select all

void ICACHE_FLASH_ATTR
recv_cb(void *arg, char *pusrdata, unsigned short len)
{
//do stuff

   uart0_tx_buffer(pusrdata, len);

//do stuff
}



I could quite certainly find a workaround, but it would not be the nicest solution. Since the API offers this function to users, for our convenience I still believe that it should be fixed.

Thank you for your help.

Who is online

Users browsing this forum: No registered users and 4 guests