Hello there,
I have tried to install the example project for ESP32 but the build process failed. I'm not quite experienced with esp-idf or eve.
The compiler is giving me some errors and warnings. I wonder if this is caused by the version of esp-idf. Or am I making a mistake during the process?
#pragma message "Compiling " __FILE__ " for Espressif ESP32"
^~~~~~~
In file included from ../lib/eve/eve_arch_esp32/EVE_MCU_ESP32.c:65:
../lib/eve/eve_arch_esp32/endian.h:86: warning: "__bswap16" redefined
#define __bswap16 __bswap_16
In file included from ../lib/eve/eve_arch_esp32/EVE_MCU_ESP32.c:59:
c:\users\dunya\.espressif\tools\xtensa-esp32-elf\esp-2019r2-8.2.0\xtensa-esp32-elf\xtensa-esp32-elf\sys-include\machine\endian.h:24: note: this is the location of the previous definition
#define __bswap16(_x) __builtin_bswap16(_x)
In file included from ../lib/eve/eve_arch_esp32/EVE_MCU_ESP32.c:65:
../lib/eve/eve_arch_esp32/endian.h:87: warning: "__bswap32" redefined
#define __bswap32 __bswap_32
In file included from ../lib/eve/eve_arch_esp32/EVE_MCU_ESP32.c:59:
c:\users\dunya\.espressif\tools\xtensa-esp32-elf\esp-2019r2-8.2.0\xtensa-esp32-elf\xtensa-esp32-elf\sys-include\machine\endian.h:25: note: this is the location of the previous definition
#define __bswap32(_x) __builtin_bswap32(_x)
../lib/eve/eve_arch_esp32/EVE_MCU_ESP32.c: In function 'MCU_Init':
../lib/eve/eve_arch_esp32/EVE_MCU_ESP32.c:91:5: error: unknown type name 'gpio_config_t'; did you mean 'spi_bus_config_t'?
gpio_config_t io_conf;
^~~~~~~~~~~~~
spi_bus_config_t
../lib/eve/eve_arch_esp32/EVE_MCU_ESP32.c:73:22: error: 'GPIO_NUM_19' undeclared (first use in this function); did you mean 'PIN_NUM_PD'?
#define PIN_NUM_MISO GPIO_NUM_19
^~~~~~~~~~~
../lib/eve/eve_arch_esp32/EVE_MCU_ESP32.c:94:24: note: in expansion of macro 'PIN_NUM_MISO'
.miso_io_num = PIN_NUM_MISO,
^~~~~~~~~~~~
../lib/eve/eve_arch_esp32/EVE_MCU_ESP32.c:73:22: note: each undeclared identifier is reported only once for each function it appears in
#define PIN_NUM_MISO GPIO_NUM_19
^~~~~~~~~~~
../lib/eve/eve_arch_esp32/EVE_MCU_ESP32.c:94:24: note: in expansion of macro 'PIN_NUM_MISO'
.miso_io_num = PIN_NUM_MISO,
^~~~~~~~~~~~
../lib/eve/eve_arch_esp32/EVE_MCU_ESP32.c:74:22: error: 'GPIO_NUM_23' undeclared (first use in this function); did you mean 'PIN_NUM_PD'?
#define PIN_NUM_MOSI GPIO_NUM_23
^~~~~~~~~~~
../lib/eve/eve_arch_esp32/EVE_MCU_ESP32.c:95:24: note: in expansion of macro 'PIN_NUM_MOSI'
.mosi_io_num = PIN_NUM_MOSI,
^~~~~~~~~~~~
../lib/eve/eve_arch_esp32/EVE_MCU_ESP32.c:75:22: error: 'GPIO_NUM_18' undeclared (first use in this function); did you mean 'PIN_NUM_PD'?
#define PIN_NUM_CLK GPIO_NUM_18
^~~~~~~~~~~
../lib/eve/eve_arch_esp32/EVE_MCU_ESP32.c:96:24: note: in expansion of macro 'PIN_NUM_CLK'
.sclk_io_num = PIN_NUM_CLK,
^~~~~~~~~~~
../lib/eve/eve_arch_esp32/EVE_MCU_ESP32.c:117:12: error: request for member 'intr_type' in something not a structure or union
io_conf.intr_type = GPIO_PIN_INTR_DISABLE;
^
../lib/eve/eve_arch_esp32/EVE_MCU_ESP32.c:117:25: error: 'GPIO_PIN_INTR_DISABLE' undeclared (first use in this function)
io_conf.intr_type = GPIO_PIN_INTR_DISABLE;
^~~~~~~~~~~~~~~~~~~~~
../lib/eve/eve_arch_esp32/EVE_MCU_ESP32.c:119:12: error: request for member 'mode' in something not a structure or union
io_conf.mode = GPIO_MODE_OUTPUT;
^
../lib/eve/eve_arch_esp32/EVE_MCU_ESP32.c:119:20: error: 'GPIO_MODE_OUTPUT' undeclared (first use in this function); did you mean 'GPIO_SD5_OUT_IDX'?
io_conf.mode = GPIO_MODE_OUTPUT;
^~~~~~~~~~~~~~~~
GPIO_SD5_OUT_IDX
../lib/eve/eve_arch_esp32/EVE_MCU_ESP32.c:121:12: error: request for member 'pin_bit_mask' in something not a structure or union
io_conf.pin_bit_mask = BIT(PIN_NUM_PD) | BIT(PIN_NUM_CS);
^
In file included from ../../components/esp_common/include/esp_system.h:22,
from ../../components/freertos/include/freertos/portable.h:128,
from ../../components/freertos/include/freertos/FreeRTOS.h:105,
from ../lib/eve/eve_arch_esp32/EVE_MCU_ESP32.c:62:
../lib/eve/eve_arch_esp32/EVE_MCU_ESP32.c:78:22: error: 'GPIO_NUM_15' undeclared (first use in this function); did you mean 'PIN_NUM_PD'?
#define PIN_NUM_PD GPIO_NUM_15
^~~~~~~~~~~
../../components/esp_common/include/esp_bit_defs.h:53:42: note: in definition of macro 'BIT'
#define BIT(nr) (1UL << (nr))
^~
../lib/eve/eve_arch_esp32/EVE_MCU_ESP32.c:121:32: note: in expansion of macro 'PIN_NUM_PD'
io_conf.pin_bit_mask = BIT(PIN_NUM_PD) | BIT(PIN_NUM_CS);
^~~~~~~~~~
../lib/eve/eve_arch_esp32/EVE_MCU_ESP32.c:76:22: error: 'GPIO_NUM_22' undeclared (first use in this function); did you mean 'PIN_NUM_PD'?
#define PIN_NUM_CS GPIO_NUM_22
^~~~~~~~~~~
../../components/esp_common/include/esp_bit_defs.h:53:42: note: in definition of macro 'BIT'
#define BIT(nr) (1UL << (nr))
^~
../lib/eve/eve_arch_esp32/EVE_MCU_ESP32.c:121:50: note: in expansion of macro 'PIN_NUM_CS'
io_conf.pin_bit_mask = BIT(PIN_NUM_PD) | BIT(PIN_NUM_CS);
^~~~~~~~~~
../lib/eve/eve_arch_esp32/EVE_MCU_ESP32.c:123:12: error: request for member 'pull_down_en' in something not a structure or union
io_conf.pull_down_en = 0;
^
../lib/eve/eve_arch_esp32/EVE_MCU_ESP32.c:125:12: error: request for member 'pull_up_en' in something not a structure or union
io_conf.pull_up_en = 0;
^
../lib/eve/eve_arch_esp32/EVE_MCU_ESP32.c:127:5: error: implicit declaration of function 'gpio_config'; did you mean 'lldesc_config'? [-Werror=implicit-function-declaration]
gpio_config(&io_conf);
^~~~~~~~~~~
lldesc_config
../lib/eve/eve_arch_esp32/EVE_MCU_ESP32.c: In function 'MCU_CSlow':
../lib/eve/eve_arch_esp32/EVE_MCU_ESP32.c:140:5: error: implicit declaration of function 'gpio_set_level'; did you mean '_xtos_set_intlevel'? [-Werror=implicit-function-declaration]
gpio_set_level(PIN_NUM_CS, 0);
^~~~~~~~~~~~~~
_xtos_set_intlevel
../lib/eve/eve_arch_esp32/EVE_MCU_ESP32.c:76:22: error: 'GPIO_NUM_22' undeclared (first use in this function); did you mean 'PIN_NUM_PD'?
#define PIN_NUM_CS GPIO_NUM_22
^~~~~~~~~~~
../lib/eve/eve_arch_esp32/EVE_MCU_ESP32.c:140:20: note: in expansion of macro 'PIN_NUM_CS'
gpio_set_level(PIN_NUM_CS, 0);
^~~~~~~~~~
../lib/eve/eve_arch_esp32/EVE_MCU_ESP32.c: In function 'MCU_CShigh':
../lib/eve/eve_arch_esp32/EVE_MCU_ESP32.c:76:22: error: 'GPIO_NUM_22' undeclared (first use in this function); did you mean 'PIN_NUM_PD'?
#define PIN_NUM_CS GPIO_NUM_22
^~~~~~~~~~~
../lib/eve/eve_arch_esp32/EVE_MCU_ESP32.c:146:20: note: in expansion of macro 'PIN_NUM_CS'
gpio_set_level(PIN_NUM_CS, 1);
^~~~~~~~~~
../lib/eve/eve_arch_esp32/EVE_MCU_ESP32.c: In function 'MCU_PDlow':
../lib/eve/eve_arch_esp32/EVE_MCU_ESP32.c:78:22: error: 'GPIO_NUM_15' undeclared (first use in this function); did you mean 'PIN_NUM_PD'?
#define PIN_NUM_PD GPIO_NUM_15
^~~~~~~~~~~
../lib/eve/eve_arch_esp32/EVE_MCU_ESP32.c:152:20: note: in expansion of macro 'PIN_NUM_PD'
gpio_set_level(PIN_NUM_PD, 0);
^~~~~~~~~~
../lib/eve/eve_arch_esp32/EVE_MCU_ESP32.c: In function 'MCU_PDhigh':
../lib/eve/eve_arch_esp32/EVE_MCU_ESP32.c:78:22: error: 'GPIO_NUM_15' undeclared (first use in this function); did you mean 'PIN_NUM_PD'?
#define PIN_NUM_PD GPIO_NUM_15
^~~~~~~~~~~
../lib/eve/eve_arch_esp32/EVE_MCU_ESP32.c:158:20: note: in expansion of macro 'PIN_NUM_PD'
gpio_set_level(PIN_NUM_PD, 1);
^~~~~~~~~~
cc1.exe: some warnings being treated as errors
[832/838] Building C object esp-idf/eve_arch_esp32/CMakeFiles/__idf_eve_arch_esp32.dir/__/source/EVE_HAL.c.obj
ninja: build stopped: subcommand failed.
ninja failed with exit code 1
Hi all,
I've just tested this AN on my ESP32 and I had the same errors (ESP IDF 4.0.1)
In order to get it compiled I changed the following in the code:
- in file EVE_MCU_ESP32.c I added:
#include "driver/gpio.h"
- in file edian.h I placed the following lines in remark in order to suppress the warnings about redefinition:
//#define __bswap16 __bswap_16
//#define __bswap32 __bswap_32
After changing this I successfully compiled and flashed my ESP32 and the demo works fine.
Luckily this AN exists because it would have been too much work to get started!
Thanks for this!
PS: I also had to change the EVE_config.h to add my 3.5 QVGA display.