Discuss here different C compiler set ups, and compiling executables for the ESP8266

User avatar
By Yandiev Ruslan
#63369 Hello! Help please!
when i try to make drivers in dir driver_lib of rtos_sdk i get this on step compiling i2c_master:

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/pi/ESP8266_RTOS_SDK/include -I /home/pi/ESP8266_RTOS_SDK/extra_include -I /home/pi/ESP8266_RTOS_SDK/driver_lib/include -I /home/pi/ESP8266_RTOS_SDK/include/espressif -I /home/pi/ESP8266_RTOS_SDK/include/lwip -I /home/pi/ESP8266_RTOS_SDK/include/lwip/ipv4 -I /home/pi/ESP8266_RTOS_SDK/include/lwip/ipv6 -I /home/pi/ESP8266_RTOS_SDK/include/nopoll -I /home/pi/ESP8266_RTOS_SDK/include/spiffs -I /home/pi/ESP8266_RTOS_SDK/include/ssl -I /home/pi/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/pi/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));
^
../../Makefile:333: ошибка выполнения рецепта для цели «.output/eagle/debug/obj/i2c_master.o»
make: *** [.output/eagle/debug/obj/i2c_master.o] Ошибка 1
+ cp .output/eagle/debug/lib/libdriver/.a ../../lib/libdriver/.a
cp: не удалось выполнить stat для «.output/eagle/debug/lib/libdriver/.a»: Нет такого файла или каталога
+ xtensa-lx106-elf-strip --strip-unneeded ../../lib/libdriver/.a
xtensa-lx106-elf-strip: '../../lib/libdriver/.a': No such file
+ cd ..