Compilation error on ESP8266_RTOS_SDK : ./make_lib.sh driver reports error

dashy81
Posts: 2
Joined: Fri Dec 02, 2016 2:46 pm

Compilation error on ESP8266_RTOS_SDK : ./make_lib.sh driver reports error

Postby dashy81 » Sun Dec 11, 2016 9:22 pm

Dear All,

I've just downloaded the RTOS sdk and follohwed the steps here:
https://github.com/espressif/ESP8266_RTOS_SDK

I can compile apps in examples folder. But I need to use gpio functionality, so wanted to generate driver lib.
I followed method 1 from, Readme.md present in driver_lib. But it results in the errors.

Please help.

Code: Select all

esp8266@esp8266-VirtualBox:~/ESP8266_RTOS_SDK/driver_lib$ ./make_lib.sh
+ echo 'make_lib.sh version 20160307'
make_lib.sh version 20160307
+ echo ''

+ cd
+ make clean
make: *** No rule to make target `clean'.  Stop.
+ make COMPILE=gcc
make: *** No targets specified and no makefile found.  Stop.
+ cp .output/eagle/debug/lib/lib.a ../../lib/lib.a
cp: cannot stat ‘.output/eagle/debug/lib/lib.a’: No such file or directory
+ xtensa-lx106-elf-strip --strip-unneeded ../../lib/lib.a
xtensa-lx106-elf-strip: '../../lib/lib.a': No such file
+ cd ..
esp8266@esp8266-VirtualBox:~/ESP8266_RTOS_SDK/driver_lib$ ./make_lib.sh driver
+ echo 'make_lib.sh version 20160307'
make_lib.sh version 20160307
+ echo ''

+ cd driver
+ make clean
rm -f -r .output/eagle/debug
+ make COMPILE=gcc
DEPEND: xtensa-lx106-elf-gcc -M -Os -g -Wpointer-arith -Wundef -Werror -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -ffunction-sections -fdata-sections -fno-builtin-printf -DICACHE_FLASH -I include -I ../include -I /home/esp8266/ESP8266_RTOS_SDK/include -I /home/esp8266/ESP8266_RTOS_SDK/extra_include -I /home/esp8266/ESP8266_RTOS_SDK/driver_lib/include -I /home/esp8266/ESP8266_RTOS_SDK/include/espressif -I /home/esp8266/ESP8266_RTOS_SDK/include/lwip -I /home/esp8266/ESP8266_RTOS_SDK/include/lwip/ipv4 -I /home/esp8266/ESP8266_RTOS_SDK/include/lwip/ipv6 -I /home/esp8266/ESP8266_RTOS_SDK/include/nopoll -I /home/esp8266/ESP8266_RTOS_SDK/include/spiffs -I /home/esp8266/ESP8266_RTOS_SDK/include/ssl -I /home/esp8266/ESP8266_RTOS_SDK/include/json uart.c
DEPEND: xtensa-lx106-elf-gcc -M -Os -g -Wpointer-arith -Wundef -Werror -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -ffunction-sections -fdata-sections -fno-builtin-printf -DICACHE_FLASH -I include -I ../include -I /home/esp8266/ESP8266_RTOS_SDK/include -I /home/esp8266/ESP8266_RTOS_SDK/extra_include -I /home/esp8266/ESP8266_RTOS_SDK/driver_lib/include -I /home/esp8266/ESP8266_RTOS_SDK/include/espressif -I /home/esp8266/ESP8266_RTOS_SDK/include/lwip -I /home/esp8266/ESP8266_RTOS_SDK/include/lwip/ipv4 -I /home/esp8266/ESP8266_RTOS_SDK/include/lwip/ipv6 -I /home/esp8266/ESP8266_RTOS_SDK/include/nopoll -I /home/esp8266/ESP8266_RTOS_SDK/include/spiffs -I /home/esp8266/ESP8266_RTOS_SDK/include/ssl -I /home/esp8266/ESP8266_RTOS_SDK/include/json spi_interface.c
DEPEND: xtensa-lx106-elf-gcc -M -Os -g -Wpointer-arith -Wundef -Werror -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -ffunction-sections -fdata-sections -fno-builtin-printf -DICACHE_FLASH -I include -I ../include -I /home/esp8266/ESP8266_RTOS_SDK/include -I /home/esp8266/ESP8266_RTOS_SDK/extra_include -I /home/esp8266/ESP8266_RTOS_SDK/driver_lib/include -I /home/esp8266/ESP8266_RTOS_SDK/include/espressif -I /home/esp8266/ESP8266_RTOS_SDK/include/lwip -I /home/esp8266/ESP8266_RTOS_SDK/include/lwip/ipv4 -I /home/esp8266/ESP8266_RTOS_SDK/include/lwip/ipv6 -I /home/esp8266/ESP8266_RTOS_SDK/include/nopoll -I /home/esp8266/ESP8266_RTOS_SDK/include/spiffs -I /home/esp8266/ESP8266_RTOS_SDK/include/ssl -I /home/esp8266/ESP8266_RTOS_SDK/include/json i2c_master.c
DEPEND: xtensa-lx106-elf-gcc -M -Os -g -Wpointer-arith -Wundef -Werror -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -ffunction-sections -fdata-sections -fno-builtin-printf -DICACHE_FLASH -I include -I ../include -I /home/esp8266/ESP8266_RTOS_SDK/include -I /home/esp8266/ESP8266_RTOS_SDK/extra_include -I /home/esp8266/ESP8266_RTOS_SDK/driver_lib/include -I /home/esp8266/ESP8266_RTOS_SDK/include/espressif -I /home/esp8266/ESP8266_RTOS_SDK/include/lwip -I /home/esp8266/ESP8266_RTOS_SDK/include/lwip/ipv4 -I /home/esp8266/ESP8266_RTOS_SDK/include/lwip/ipv6 -I /home/esp8266/ESP8266_RTOS_SDK/include/nopoll -I /home/esp8266/ESP8266_RTOS_SDK/include/spiffs -I /home/esp8266/ESP8266_RTOS_SDK/include/ssl -I /home/esp8266/ESP8266_RTOS_SDK/include/json hw_timer.c
DEPEND: xtensa-lx106-elf-gcc -M -Os -g -Wpointer-arith -Wundef -Werror -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -ffunction-sections -fdata-sections -fno-builtin-printf -DICACHE_FLASH -I include -I ../include -I /home/esp8266/ESP8266_RTOS_SDK/include -I /home/esp8266/ESP8266_RTOS_SDK/extra_include -I /home/esp8266/ESP8266_RTOS_SDK/driver_lib/include -I /home/esp8266/ESP8266_RTOS_SDK/include/espressif -I /home/esp8266/ESP8266_RTOS_SDK/include/lwip -I /home/esp8266/ESP8266_RTOS_SDK/include/lwip/ipv4 -I /home/esp8266/ESP8266_RTOS_SDK/include/lwip/ipv6 -I /home/esp8266/ESP8266_RTOS_SDK/include/nopoll -I /home/esp8266/ESP8266_RTOS_SDK/include/spiffs -I /home/esp8266/ESP8266_RTOS_SDK/include/ssl -I /home/esp8266/ESP8266_RTOS_SDK/include/json gpio.c
xtensa-lx106-elf-gcc -Os -g -Wpointer-arith -Wundef -Werror -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -ffunction-sections -fdata-sections -fno-builtin-printf  -DICACHE_FLASH   -I include -I ../include -I /home/esp8266/ESP8266_RTOS_SDK/include -I /home/esp8266/ESP8266_RTOS_SDK/extra_include -I /home/esp8266/ESP8266_RTOS_SDK/driver_lib/include -I /home/esp8266/ESP8266_RTOS_SDK/include/espressif -I /home/esp8266/ESP8266_RTOS_SDK/include/lwip -I /home/esp8266/ESP8266_RTOS_SDK/include/lwip/ipv4 -I /home/esp8266/ESP8266_RTOS_SDK/include/lwip/ipv6 -I /home/esp8266/ESP8266_RTOS_SDK/include/nopoll -I /home/esp8266/ESP8266_RTOS_SDK/include/spiffs -I /home/esp8266/ESP8266_RTOS_SDK/include/ssl -I /home/esp8266/ESP8266_RTOS_SDK/include/json  -o .output/eagle/debug/obj/gpio.o -c gpio.c
xtensa-lx106-elf-gcc -Os -g -Wpointer-arith -Wundef -Werror -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -ffunction-sections -fdata-sections -fno-builtin-printf  -DICACHE_FLASH   -I include -I ../include -I /home/esp8266/ESP8266_RTOS_SDK/include -I /home/esp8266/ESP8266_RTOS_SDK/extra_include -I /home/esp8266/ESP8266_RTOS_SDK/driver_lib/include -I /home/esp8266/ESP8266_RTOS_SDK/include/espressif -I /home/esp8266/ESP8266_RTOS_SDK/include/lwip -I /home/esp8266/ESP8266_RTOS_SDK/include/lwip/ipv4 -I /home/esp8266/ESP8266_RTOS_SDK/include/lwip/ipv6 -I /home/esp8266/ESP8266_RTOS_SDK/include/nopoll -I /home/esp8266/ESP8266_RTOS_SDK/include/spiffs -I /home/esp8266/ESP8266_RTOS_SDK/include/ssl -I /home/esp8266/ESP8266_RTOS_SDK/include/json  -o .output/eagle/debug/obj/hw_timer.o -c hw_timer.c
xtensa-lx106-elf-gcc -Os -g -Wpointer-arith -Wundef -Werror -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -ffunction-sections -fdata-sections -fno-builtin-printf  -DICACHE_FLASH   -I include -I ../include -I /home/esp8266/ESP8266_RTOS_SDK/include -I /home/esp8266/ESP8266_RTOS_SDK/extra_include -I /home/esp8266/ESP8266_RTOS_SDK/driver_lib/include -I /home/esp8266/ESP8266_RTOS_SDK/include/espressif -I /home/esp8266/ESP8266_RTOS_SDK/include/lwip -I /home/esp8266/ESP8266_RTOS_SDK/include/lwip/ipv4 -I /home/esp8266/ESP8266_RTOS_SDK/include/lwip/ipv6 -I /home/esp8266/ESP8266_RTOS_SDK/include/nopoll -I /home/esp8266/ESP8266_RTOS_SDK/include/spiffs -I /home/esp8266/ESP8266_RTOS_SDK/include/ssl -I /home/esp8266/ESP8266_RTOS_SDK/include/json  -o .output/eagle/debug/obj/i2c_master.o -c i2c_master.c
In file included from i2c_master.c:13:0:
i2c_master.c: In function 'i2c_master_getDC':
../include/gpio.h:193:66: error: 'BIT0' undeclared (first use in this function)
 #define GPIO_INPUT_GET(gpio_no)     ((gpio_input_get()>>gpio_no)&BIT0)
                                                                  ^
i2c_master.c:60:15: note: in expansion of macro 'GPIO_INPUT_GET'
     sda_out = GPIO_INPUT_GET(GPIO_ID_PIN(I2C_MASTER_SDA_GPIO));
               ^
../include/gpio.h:193:66: note: each undeclared identifier is reported only once for each function it appears in
 #define GPIO_INPUT_GET(gpio_no)     ((gpio_input_get()>>gpio_no)&BIT0)
                                                                  ^
i2c_master.c:60:15: note: in expansion of macro 'GPIO_INPUT_GET'
     sda_out = GPIO_INPUT_GET(GPIO_ID_PIN(I2C_MASTER_SDA_GPIO));
               ^
In file included from ../include/i2c_master.h:4:0,
                 from i2c_master.c:15:
i2c_master.c: In function 'i2c_master_gpio_init':
/home/esp8266/ESP8266_RTOS_SDK/include/espressif/esp8266/pin_mux_register.h:149:47: error: 'BIT2' undeclared (first use in this function)
         SET_PERI_REG_MASK(PIN_NAME, (((FUNC & BIT2) << 2) | (FUNC & 0x3)) << PERIPHS_IO_MUX_FUNC_S); \
                                               ^
i2c_master.c:111:5: note: in expansion of macro 'PIN_FUNC_SELECT'
     PIN_FUNC_SELECT(I2C_MASTER_SDA_MUX, I2C_MASTER_SDA_FUNC);
     ^
In file included from i2c_master.c:13:0:
../include/gpio.h:85:34: error: 'GPIO_PIN0_ADDRESS' undeclared (first use in this function)
 #define GPIO_PIN_ADDR(i)        (GPIO_PIN0_ADDRESS + i*4)
                                  ^
i2c_master.c:114:20: note: in expansion of macro 'GPIO_PIN_ADDR'
     GPIO_REG_WRITE(GPIO_PIN_ADDR(GPIO_ID_PIN(I2C_MASTER_SDA_GPIO)), GPIO_REG_READ(GPIO_PIN_ADDR(GPIO_ID_PIN(I2C_MASTER_SDA_GPIO))) | GPIO_PIN_PAD_DRIVER_SET(GPIO_PAD_DRIVER_ENABLE)); //open drain;
                    ^
i2c_master.c:114:158: error: 'GPIO_PAD_DRIVER_ENABLE' undeclared (first use in this function)
     GPIO_REG_WRITE(GPIO_PIN_ADDR(GPIO_ID_PIN(I2C_MASTER_SDA_GPIO)), GPIO_REG_READ(GPIO_PIN_ADDR(GPIO_ID_PIN(I2C_MASTER_SDA_GPIO))) | GPIO_PIN_PAD_DRIVER_SET(GPIO_PAD_DRIVER_ENABLE)); //open drain;
                                                                                                                                                              ^
i2c_master.c:115:20: error: 'GPIO_ENABLE_ADDRESS' undeclared (first use in this function)
     GPIO_REG_WRITE(GPIO_ENABLE_ADDRESS, GPIO_REG_READ(GPIO_ENABLE_ADDRESS) | (1 << I2C_MASTER_SDA_GPIO));
                    ^
make: *** [.output/eagle/debug/obj/i2c_master.o] Error 1
+ cp .output/eagle/debug/lib/libdriver.a ../../lib/libdriver.a
cp: cannot stat ‘.output/eagle/debug/lib/libdriver.a’: No such file or directory
+ xtensa-lx106-elf-strip --strip-unneeded ../../lib/libdriver.a
+ cd ..
esp8266@esp8266-VirtualBox:~/ESP8266_RTOS_SDK/driver_lib$

pratik

Re: Compilation error on ESP8266_RTOS_SDK : ./make_lib.sh driver reports error

Postby pratik » Mon Dec 12, 2016 12:48 pm

Hi!
If it is not absolutely required by your application to use a library, you can just use the header file and source code from the library directory. Copy them into your main project folder or just include a header file from the driver directory. That should work just fine!

mmmmar
Posts: 6
Joined: Thu Jan 26, 2017 10:28 am

Re: Compilation error on ESP8266_RTOS_SDK : ./make_lib.sh driver reports error

Postby mmmmar » Thu Jan 26, 2017 10:30 am

Hi
you can just add

Code: Select all

#include "esp8266/gpio_register.h"
#include "esp8266/eagle_soc.h"


in i2c_master.c

Who is online

Users browsing this forum: No registered users and 60 guests