Dear all, I am trying to make working this example code for the slave: https://esp32tutorials.com/esp32-i2c-co ... Y2RHFZRQj8
But when trying to Build I receive the following error:
C:/Users/konec/sniffer_test2/main/main.c:51:5: error: implicit declaration of function 'gpio_pad_select_gpio'; did you mean 'esp_rom_gpio_pad_select_gpio'? [-Werror=implicit-function-declaration]
51 | gpio_pad_select_gpio(LED_PIN);
| ^~~~~~~~~~~~~~~~~~~~
| esp_rom_gpio_pad_select_gpio
C:/Users/konec/sniffer_test2/main/main.c:49:14: warning: unused variable 'on_command' [-Wunused-variable]
49 | uint8_t on_command[] = "LED_ON";
| ^~~~~~~~~~
cc1.exe: some warnings being treated as errors
[8/102] Performing build step for 'bootloader'
[1/1] cmd.exe /C "cd /D C:\Users\konec\sniffer_test2\build\bootloader\esp-idf\esptool_py && c:\Espressif\python_env\idf5.0_py3.8_env\Scripts\python.exe C:/Espressif/frameworks/esp-idf-v5.0.2-2/components/partition_table/check_sizes.py --offset 0x8000 bootloader 0x1000 C:/Users/konec/sniffer_test2/build/bootloader/bootloader.bin"
Bootloader binary size 0x6700 bytes. 0x900 bytes (8%) free.
[24/101] Building C object esp-idf/protocomm/CMakeFiles/__idf_protocomm.dir/src/security/security1.c.obj
ninja: build stopped: subcommand failed.
* The terminal process "C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe -Command ninja " terminated with exit code: 1.
Could someone help me what am I doing wrong, please ?
implicit declaration of function
-
- Posts: 1709
- Joined: Mon Oct 17, 2022 7:38 pm
- Location: Europe, Germany
Re: implicit declaration of function
Code: Select all
#include "rom/gpio.h"
However, using the higher-level GPIO API instead of the ROM function is likely the better option.
Re: implicit declaration of function
Thank youo. Looks it helped. I just replaced the "driver/gpio.h" with "rom/gpio.h".
Now I haveone one issue in Problmes saying "identifier "CONFIG_FREERTOS_HZ" is undefined C/C++(20) {LN 59, Col 86]" which is:
i2c_slave_read_buffer(i2c_slave_port, received_data, I2C_SLAVE_RX_BUF_LEN, 100 / portTICK_PERIOD_MS);
But that's probably a different story.
Now I haveone one issue in Problmes saying "identifier "CONFIG_FREERTOS_HZ" is undefined C/C++(20) {LN 59, Col 86]" which is:
i2c_slave_read_buffer(i2c_slave_port, received_data, I2C_SLAVE_RX_BUF_LEN, 100 / portTICK_PERIOD_MS);
But that's probably a different story.
-
- Posts: 1709
- Joined: Mon Oct 17, 2022 7:38 pm
- Location: Europe, Germany
Re: implicit declaration of function
Try
.
Code: Select all
#include "freertos/FreeRTOS.h"
Re: implicit declaration of function
Sorry for beginners questions. I tried to add but the issue still persist.
When I click the yellow bulb I am redirected to the IntelliSense Configurations and when scrolling bit lower I see there is some issue with the path:
Code: Select all
#include "freertos/FreeRTOS.h"
When I click the yellow bulb I am redirected to the IntelliSense Configurations and when scrolling bit lower I see there is some issue with the path:
-
- Posts: 1709
- Joined: Mon Oct 17, 2022 7:38 pm
- Location: Europe, Germany
Re: implicit declaration of function
Notice that there is a distinction to be made between what the compiler/build toolchain "sees" and what the IDE (/Intellisense) sees.
If you can successfully build your application then the build environment is set up correctly. Intellisense should be configured identically to the toolchain, otherwise it may show false warnings like in your case. - But even if Intellisense is set up correctly, it still won't see everything the way the compiler sees it during build, so spurious warnings in the IDE will keep popping up here and there.
That said, I don't know how the wrong paths ended up in your Intellisense configuration, or how to correct them and make sure they won't creep in again.
If you can successfully build your application then the build environment is set up correctly. Intellisense should be configured identically to the toolchain, otherwise it may show false warnings like in your case. - But even if Intellisense is set up correctly, it still won't see everything the way the compiler sees it during build, so spurious warnings in the IDE will keep popping up here and there.
That said, I don't know how the wrong paths ended up in your Intellisense configuration, or how to correct them and make sure they won't creep in again.
Who is online
Users browsing this forum: Baidu [Spider] and 112 guests