Eclipse ESP-IDF Indexer Issue: Symbol could not be resolved

akotowski
Posts: 16
Joined: Sat Sep 01, 2018 2:54 pm

Eclipse ESP-IDF Indexer Issue: Symbol could not be resolved

Postby akotowski » Wed Jun 15, 2022 12:34 am

In building "https://github.com/manuelbl/ttn-esp32" examples I have run across symbol or field could not be resolved errors. The programs seem to execute correctly so it appears this is an indexer issue. A particular symbol is "max_transfer_sz." It is found in C:/Espressif/frameworks/esp-idf-v4.4.1/components/driver/include/driver/spicommon.h but not in the project/esp_idf_components directory.
The errors go away when I enable "Index source and header files opened in editor" and open the spicommon.h file above.
I have not found an option to include this for the indexer nor can I get it to work by adding the directory to the include directories.
I'm not sure if this is a bug, or I just need to find the correct options.
This is on Windows 11
ESP IDE Version: 2.4.2 Build id: 20220308-1406
Eclipse C/C++ Development Tools Version: 10.5.0.202112012329 Build id: 20211201-2329

ESP_kondalkolipaka
Posts: 188
Joined: Wed Jul 17, 2019 5:26 pm

Re: Eclipse ESP-IDF Indexer Issue: Symbol could not be resolved

Postby ESP_kondalkolipaka » Thu Jun 23, 2022 12:34 pm

Hello,

I quickly configured the setup with the repo you mentioned.

As I see max_transfer_sz is defined in the spi_common and spi_slave so the indexer is unable to resolve conflict correctly. Let us look into this and provide a fix.

Could you also provide a small snippet of how you're using code with max_transfer_sz variable.

Thanks

akotowski
Posts: 16
Joined: Sat Sep 01, 2018 2:54 pm

Re: Eclipse ESP-IDF Indexer Issue: Symbol could not be resolved

Postby akotowski » Thu Jun 23, 2022 1:50 pm

The snippet is:

Code: Select all

extern "C" void app_main(void)
{
	initArduino();
    esp_err_t err;
    // Initialize the GPIO ISR handler service
    err = gpio_install_isr_service(ESP_INTR_FLAG_IRAM);
    ESP_ERROR_CHECK(err);

    // Initialize the NVS (non-volatile storage) for saving and restoring the keys
    err = nvs_flash_init();
    ESP_ERROR_CHECK(err);

    // Initialize SPI bus
    spi_bus_config_t spi_bus_config;
    spi_bus_config.miso_io_num = TTN_PIN_SPI_MISO;
    spi_bus_config.mosi_io_num = TTN_PIN_SPI_MOSI;
    spi_bus_config.sclk_io_num = TTN_PIN_SPI_SCLK;
    spi_bus_config.quadwp_io_num = -1;
    spi_bus_config.quadhd_io_num = -1;
    spi_bus_config.max_transfer_sz = 0;
    err = spi_bus_initialize(TTN_SPI_HOST, &spi_bus_config, TTN_SPI_DMA_CHAN);
    ESP_ERROR_CHECK(err);

    // Configure the SX127x pins
    ttn.configurePins(TTN_SPI_HOST, TTN_PIN_NSS, TTN_PIN_RXTX, TTN_PIN_RST, TTN_PIN_DIO0, TTN_PIN_DIO1);
The only part I added here is initArduino().
All the spi_bus... symbols have the same error.
I don't believe spi_slave mode is necessary for this code.
Thanks for your response.

ESP_kondalkolipaka
Posts: 188
Joined: Wed Jul 17, 2019 5:26 pm

Re: Eclipse ESP-IDF Indexer Issue: Symbol could not be resolved

Postby ESP_kondalkolipaka » Mon Jun 27, 2022 4:54 am

Hello,

Can you try turning off "Allow heuristic resolution of includes" from the Indexer preferences? I see all symbols and includes are resolved after this. Please find the screenshots.

https://www.esp32.com/download/file.php ... ew&id=9470
https://www.esp32.com/download/file.php ... ew&id=9469
Attachments
Screenshot 2022-06-27 at 10.18.34 AM.png
Editor
Screenshot 2022-06-27 at 10.18.34 AM.png (903.67 KiB) Viewed 8582 times
Screenshot 2022-06-27 at 10.20.15 AM.png
Indexer preferences page
Screenshot 2022-06-27 at 10.20.15 AM.png (1.05 MiB) Viewed 8582 times

akotowski
Posts: 16
Joined: Sat Sep 01, 2018 2:54 pm

Re: Eclipse ESP-IDF Indexer Issue: Symbol could not be resolved

Postby akotowski » Mon Jun 27, 2022 2:29 pm

That definitely helps. The errors disappear. They reappear when I change the editor window to another file and then back to main. This solves my problem, I don't have to sort through false errors.
Thanks for your help

Who is online

Users browsing this forum: No registered users and 16 guests