Skip to content

Compilation error #4357

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
tarun-woz opened this issue Sep 23, 2020 · 4 comments
Closed

Compilation error #4357

tarun-woz opened this issue Sep 23, 2020 · 4 comments
Labels
Status: Stale Issue is stale stage (outdated/stuck)

Comments

@tarun-woz
Copy link

Hardware: ESP32-WROOM-32UE

Board:
Core Installation version: 1.0.4 October - 2019
IDE name: IDF component
Flash Frequency: 40Mhz
PSRAM enabled: ?no? ?yes?
Upload Speed: ?115200?
Computer OS: MAC OS

Description:

I have installed the esp32 arduino core for my project but I am getting compilation errors as shown below. Can you please help me understand how to solve these issues and how i can implement any arduino library in my idf project code. I am trying to integrate IRMP Arduino library in my project.
The link for which is
https://github.com/ukw100/IRMP
Any help would be great.

Sketch: (leave the backquotes for code formatting)

### Debug Messages:
In file included from /Users/tarunpakala/Documents/Tarun/updated_sdk/esp-homekit-sdk/esp-idf/components/soc/esp32/include/soc/dport_reg.h:20,
                 from /Users/tarunpakala/Documents/Tarun/updated_sdk/esp-homekit-sdk/accessories/aura_sense_single_board_new_ir/components/arduino/cores/esp32/esp32-hal-spi.c:28:
/Users/tarunpakala/Documents/Tarun/updated_sdk/esp-homekit-sdk/accessories/aura_sense_single_board_new_ir/components/arduino/cores/esp32/esp32-hal-spi.c: In function 'spiStartBus':
/Users/tarunpakala/Documents/Tarun/updated_sdk/esp-homekit-sdk/accessories/aura_sense_single_board_new_ir/components/arduino/cores/esp32/esp32-hal-spi.c:431:57: error: 'DPORT_SPI_CLK_EN' undeclared (first use in this function); did you mean 'DPORT_SPI3_CLK_EN'?
         DPORT_SET_PERI_REG_MASK(DPORT_PERIP_CLK_EN_REG, DPORT_SPI_CLK_EN);
                                                         ^~~~~~~~~~~~~~~~
/Users/tarunpakala/Documents/Tarun/updated_sdk/esp-homekit-sdk/esp-idf/components/soc/esp32/include/soc/dport_access.h:154:88: note: in definition of macro '_DPORT_WRITE_PERI_REG'
 #define _DPORT_WRITE_PERI_REG(addr, val) (*((volatile uint32_t *)(addr))) = (uint32_t)(val)
                                                                                        ^~~
/Users/tarunpakala/Documents/Tarun/updated_sdk/esp-homekit-sdk/esp-idf/components/soc/esp32/include/soc/dport_access.h:183:46: note: in expansion of macro 'DPORT_WRITE_PERI_REG'
 #define DPORT_SET_PERI_REG_MASK(reg, mask)   DPORT_WRITE_PERI_REG((reg), (DPORT_READ_PERI_REG(reg)|(mask)))
                                              ^~~~~~~~~~~~~~~~~~~~
/Users/tarunpakala/Documents/Tarun/updated_sdk/esp-homekit-sdk/accessories/aura_sense_single_board_new_ir/components/arduino/cores/esp32/esp32-hal-spi.c:431:9: note: in expansion of macro 'DPORT_SET_PERI_REG_MAS'
         DPORT_SET_PERI_REG_MASK(DPORT_PERIP_CLK_EN_REG, DPORT_SPI_CLK_EN);
         ^~~~~~~~~~~~~~~~~~~~~~~
/Users/tarunpakala/Documents/Tarun/updated_sdk/esp-homekit-sdk/accessories/aura_sense_single_board_new_ir/components/arduino/cores/esp32/esp32-hal-spi.c:431:57: note: each undeclared identifier is reported only once for each function it appears in
         DPORT_SET_PERI_REG_MASK(DPORT_PERIP_CLK_EN_REG, DPORT_SPI_CLK_EN);
                                                         ^~~~~~~~~~~~~~~~
/Users/tarunpakala/Documents/Tarun/updated_sdk/esp-homekit-sdk/esp-idf/components/soc/esp32/include/soc/dport_access.h:154:88: note: in definition of macro '_DPORT_WRITE_PERI_REG'
 #define _DPORT_WRITE_PERI_REG(addr, val) (*((volatile uint32_t *)(addr))) = (uint32_t)(val)
                                                                                        ^~~
/Users/tarunpakala/Documents/Tarun/updated_sdk/esp-homekit-sdk/esp-idf/components/soc/esp32/include/soc/dport_access.h:183:46: note: in expansion of macro 'DPORT_WRITE_PERI_REG'
 #define DPORT_SET_PERI_REG_MASK(reg, mask)   DPORT_WRITE_PERI_REG((reg), (DPORT_READ_PERI_REG(reg)|(mask)))
                                              ^~~~~~~~~~~~~~~~~~~~
/Users/tarunpakala/Documents/Tarun/updated_sdk/esp-homekit-sdk/accessories/aura_sense_single_board_new_ir/components/arduino/cores/esp32/esp32-hal-spi.c:431:9: note: in expansion of macro 'DPORT_SET_PERI_REG_MAS'
         DPORT_SET_PERI_REG_MASK(DPORT_PERIP_CLK_EN_REG, DPORT_SPI_CLK_EN);
         ^~~~~~~~~~~~~~~~~~~~~~~
/Users/tarunpakala/Documents/Tarun/updated_sdk/esp-homekit-sdk/accessories/aura_sense_single_board_new_ir/components/arduino/cores/esp32/esp32-hal-spi.c:432:59: error: 'DPORT_SPI_RST' undeclared (first use in this function); did you mean 'DPORT_SPI2_RST'?
         DPORT_CLEAR_PERI_REG_MASK(DPORT_PERIP_RST_EN_REG, DPORT_SPI_RST);
                                                           ^~~~~~~~~~~~~
/Users/tarunpakala/Documents/Tarun/updated_sdk/esp-homekit-sdk/esp-idf/components/soc/esp32/include/soc/dport_access.h:154:88: note: in definition of macro '_DPORT_WRITE_PERI_REG'
 #define _DPORT_WRITE_PERI_REG(addr, val) (*((volatile uint32_t *)(addr))) = (uint32_t)(val)
                                                                                        ^~~
/Users/tarunpakala/Documents/Tarun/updated_sdk/esp-homekit-sdk/esp-idf/components/soc/esp32/include/soc/dport_access.h:180:46: note: in expansion of macro 'DPORT_WRITE_PERI_REG'
 #define DPORT_CLEAR_PERI_REG_MASK(reg, mask) DPORT_WRITE_PERI_REG((reg), (DPORT_READ_PERI_REG(reg)&(~(mask))))
                                              ^~~~~~~~~~~~~~~~~~~~
/Users/tarunpakala/Documents/Tarun/updated_sdk/esp-homekit-sdk/accessories/aura_sense_single_board_new_ir/components/arduino/cores/esp32/esp32-hal-spi.c:432:9: note: in expansion of macro 'DPORT_CLEAR_PERI_REG_MASK'
         DPORT_CLEAR_PERI_REG_MASK(DPORT_PERIP_RST_EN_REG, DPORT_SPI_RST);
         ^~~~~~~~~~~~~~~~~~~~~~~~~
/Users/tarunpakala/Documents/Tarun/updated_sdk/esp-homekit-sdk/accessories/aura_sense_single_board_new_ir/components/arduino/cores/esp32/esp32-hal-spi.c:434:57: error: 'DPORT_SPI_CLK_EN_2' undeclared (first use in this function); did you mean 'DPORT_SPI3_CLK_EN'?
         DPORT_SET_PERI_REG_MASK(DPORT_PERIP_CLK_EN_REG, DPORT_SPI_CLK_EN_2);
                                                         ^~~~~~~~~~~~~~~~~~
/Users/tarunpakala/Documents/Tarun/updated_sdk/esp-homekit-sdk/esp-idf/components/soc/esp32/include/soc/dport_access.h:154:88: note: in definition of macro '_DPORT_WRITE_PERI_REG'
 #define _DPORT_WRITE_PERI_REG(addr, val) (*((volatile uint32_t *)(addr))) = (uint32_t)(val)
                                                                                        ^~~
/Users/tarunpakala/Documents/Tarun/updated_sdk/esp-homekit-sdk/esp-idf/components/soc/esp32/include/soc/dport_access.h:183:46: note: in expansion of macro 'DPORT_WRITE_PERI_REG'
 #define DPORT_SET_PERI_REG_MASK(reg, mask)   DPORT_WRITE_PERI_REG((reg), (DPORT_READ_PERI_REG(reg)|(mask)))
                                              ^~~~~~~~~~~~~~~~~~~~
/Users/tarunpakala/Documents/Tarun/updated_sdk/esp-homekit-sdk/accessories/aura_sense_single_board_new_ir/components/arduino/cores/esp32/esp32-hal-spi.c:434:9: note: in expansion of macro 'DPORT_SET_PERI_REG_MAS'
         DPORT_SET_PERI_REG_MASK(DPORT_PERIP_CLK_EN_REG, DPORT_SPI_CLK_EN_2);
         ^~~~~~~~~~~~~~~~~~~~~~~
/Users/tarunpakala/Documents/Tarun/updated_sdk/esp-homekit-sdk/accessories/aura_sense_single_board_new_ir/components/arduino/cores/esp32/esp32-hal-spi.c:435:59: error: 'DPORT_SPI_RST_2' undeclared (first use in this function); did you mean 'DPORT_SPI2_RST'?
         DPORT_CLEAR_PERI_REG_MASK(DPORT_PERIP_RST_EN_REG, DPORT_SPI_RST_2);
                                                           ^~~~~~~~~~~~~~~
/Users/tarunpakala/Documents/Tarun/updated_sdk/esp-homekit-sdk/esp-idf/components/soc/esp32/include/soc/dport_access.h:154:88: note: in definition of macro '_DPORT_WRITE_PERI_REG'
 #define _DPORT_WRITE_PERI_REG(addr, val) (*((volatile uint32_t *)(addr))) = (uint32_t)(val)
                                                                                        ^~~
/Users/tarunpakala/Documents/Tarun/updated_sdk/esp-homekit-sdk/esp-idf/components/soc/esp32/include/soc/dport_access.h:180:46: note: in expansion of macro 'DPORT_WRITE_PERI_REG'
 #define DPORT_CLEAR_PERI_REG_MASK(reg, mask) DPORT_WRITE_PERI_REG((reg), (DPORT_READ_PERI_REG(reg)&(~(mask))))
                                              ^~~~~~~~~~~~~~~~~~~~
/Users/tarunpakala/Documents/Tarun/updated_sdk/esp-homekit-sdk/accessories/aura_sense_single_board_new_ir/components/arduino/cores/esp32/esp32-hal-spi.c:435:9: note: in expansion of macro 'DPORT_CLEAR_PERI_REG_MASK'
         DPORT_CLEAR_PERI_REG_MASK(DPORT_PERIP_RST_EN_REG, DPORT_SPI_RST_2);
         ^~~~~~~~~~~~~~~~~~~~~~~~~
/Users/tarunpakala/Documents/Tarun/updated_sdk/esp-homekit-sdk/accessories/aura_sense_single_board_new_ir/components/arduino/cores/esp32/esp32-hal-spi.c:437:57: error: 'DPORT_SPI_CLK_EN_1' undeclared (first use in this function); did you mean 'DPORT_SPI3_CLK_EN'?
         DPORT_SET_PERI_REG_MASK(DPORT_PERIP_CLK_EN_REG, DPORT_SPI_CLK_EN_1);
                                                         ^~~~~~~~~~~~~~~~~~
/Users/tarunpakala/Documents/Tarun/updated_sdk/esp-homekit-sdk/esp-idf/components/soc/esp32/include/soc/dport_access.h:154:88: note: in definition of macro '_DPORT_WRITE_PERI_REG'
 #define _DPORT_WRITE_PERI_REG(addr, val) (*((volatile uint32_t *)(addr))) = (uint32_t)(val)
                                                                                        ^~~
/Users/tarunpakala/Documents/Tarun/updated_sdk/esp-homekit-sdk/esp-idf/components/soc/esp32/include/soc/dport_access.h:183:46: note: in expansion of macro 'DPORT_WRITE_PERI_REG'
 #define DPORT_SET_PERI_REG_MASK(reg, mask)   DPORT_WRITE_PERI_REG((reg), (DPORT_READ_PERI_REG(reg)|(mask)))
                                              ^~~~~~~~~~~~~~~~~~~~
/Users/tarunpakala/Documents/Tarun/updated_sdk/esp-homekit-sdk/accessories/aura_sense_single_board_new_ir/components/arduino/cores/esp32/esp32-hal-spi.c:437:9: note: in expansion of macro 'DPORT_SET_PERI_REG_MAS'
         DPORT_SET_PERI_REG_MASK(DPORT_PERIP_CLK_EN_REG, DPORT_SPI_CLK_EN_1);
         ^~~~~~~~~~~~~~~~~~~~~~~
/Users/tarunpakala/Documents/Tarun/updated_sdk/esp-homekit-sdk/accessories/aura_sense_single_board_new_ir/components/arduino/cores/esp32/esp32-hal-spi.c:438:59: error: 'DPORT_SPI_RST_1' undeclared (first use in this function); did you mean 'DPORT_SPI2_RST'?
         DPORT_CLEAR_PERI_REG_MASK(DPORT_PERIP_RST_EN_REG, DPORT_SPI_RST_1);
                                                           ^~~~~~~~~~~~~~~
/Users/tarunpakala/Documents/Tarun/updated_sdk/esp-homekit-sdk/esp-idf/components/soc/esp32/include/soc/dport_access.h:154:88: note: in definition of macro '_DPORT_WRITE_PERI_REG'
 #define _DPORT_WRITE_PERI_REG(addr, val) (*((volatile uint32_t *)(addr))) = (uint32_t)(val)
                                                                                        ^~~
/Users/tarunpakala/Documents/Tarun/updated_sdk/esp-homekit-sdk/esp-idf/components/soc/esp32/include/soc/dport_access.h:180:46: note: in expansion of macro 'DPORT_WRITE_PERI_REG'
 #define DPORT_CLEAR_PERI_REG_MASK(reg, mask) DPORT_WRITE_PERI_REG((reg), (DPORT_READ_PERI_REG(reg)&(~(mask))))
                                              ^~~~~~~~~~~~~~~~~~~~
/Users/tarunpakala/Documents/Tarun/updated_sdk/esp-homekit-sdk/accessories/aura_sense_single_board_new_ir/components/arduino/cores/esp32/esp32-hal-spi.c:438:9: note: in expansion of macro 'DPORT_CLEAR_PERI_REG_MASK'
         DPORT_CLEAR_PERI_REG_MASK(DPORT_PERIP_RST_EN_REG, DPORT_SPI_RST_1);
         ^~~~~~~~~~~~~~~~~~~~~~~~~
make[1]: *** [cores/esp32/esp32-hal-spi.o] Error 1
make: *** [component-arduino-build] Error 2
@lbernstone
Copy link
Contributor

You have far too many variables here to be able to troubleshoot this. You need to work from a known good setup, which compiles a simple program cleanly (eg Hello World). Espressif provides the lib-builder to get to that point. It currently has some issues due to code drift.

Once you know your base is good, then you can troubleshoot your code. Start by checking that just your included library compiles, then pin down the minimal section that is failing in your code.

@tarun-woz
Copy link
Author

I have now tried compiling a basic hello world program on the idf with the arduino esp core. It is still showing compilation errors.

Sketch :
/* Hello World Example

This example code is in the Public Domain (or CC0 licensed, at your option.)

Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#include <stdio.h>
#include "sdkconfig.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "esp_system.h"
#include "esp_spi_flash.h"
#include "Arduino.h"

extern "C" {
void app_main();
}

void app_main(void)
{
initArduino();
printf("Hello world!\n");

/* Print chip information */
esp_chip_info_t chip_info;
esp_chip_info(&chip_info);
printf("This is %s chip with %d CPU cores, WiFi%s%s, ",
        CONFIG_IDF_TARGET,
        chip_info.cores,
        (chip_info.features & CHIP_FEATURE_BT) ? "/BT" : "",
        (chip_info.features & CHIP_FEATURE_BLE) ? "/BLE" : "");

printf("silicon revision %d, ", chip_info.revision);

printf("%dMB %s flash\n", spi_flash_get_chip_size() / (1024 * 1024),
        (chip_info.features & CHIP_FEATURE_EMB_FLASH) ? "embedded" : "external");

printf("Free heap: %d\n", esp_get_free_heap_size());

for (int i = 10; i >= 0; i--) {
    printf("Restarting in %d seconds...\n", i);
    vTaskDelay(1000 / portTICK_PERIOD_MS);
}
printf("Restarting now.\n");
fflush(stdout);
esp_restart();

}

Terminal :
/Users/tarunpakala/Documents/ESP/esp-idf/examples/get-started/hello_world_arduino/components/arduino/cores/esp32/esp32-hal-gpio.c: In function '__pinMode':
/Users/tarunpakala/Documents/ESP/esp-idf/examples/get-started/hello_world_arduino/components/arduino/cores/esp32/esp32-hal-gpio.c:90:24: error: 'rtc_gpio_desc' undeclared (first use in this function); did you mean 'rtc_io_desc'?
uint32_t rtc_reg = rtc_gpio_desc[pin].reg;
^~~~~~~~~~~~~
rtc_io_desc
/Users/tarunpakala/Documents/ESP/esp-idf/examples/get-started/hello_world_arduino/components/arduino/cores/esp32/esp32-hal-gpio.c:90:24: note: each undeclared identifier is reported only once for each function it appears in
make[1]: *** [cores/esp32/esp32-hal-gpio.o] Error 1
make: *** [component-arduino-build] Error 2
tarunpakala@Taruns-MacBook-Pro hello_world_arduino %

@stale
Copy link

stale bot commented Nov 24, 2020

[STALE_SET] This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Status: Stale Issue is stale stage (outdated/stuck) label Nov 24, 2020
@stale
Copy link

stale bot commented Dec 8, 2020

[STALE_DEL] This stale issue has been automatically closed. Thank you for your contributions.

@stale stale bot closed this as completed Dec 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Stale Issue is stale stage (outdated/stuck)
Projects
None yet
Development

No branches or pull requests

2 participants