Skip to content
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

ESP32-S3 ROM not provide gpio_input_get_high and gpio_output_set_high function? (IDFGH-8773) #10205

Closed
3 tasks done
imliubo opened this issue Nov 18, 2022 · 4 comments
Closed
3 tasks done
Labels
Resolution: Done Issue is done internally Status: Done Issue is done internally Type: Bug bugs in IDF

Comments

@imliubo
Copy link

imliubo commented Nov 18, 2022

Answers checklist.

  • I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
  • I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
  • I have searched the issue tracker for a similar issue and not found a similar issue.

IDF version.

v4.4.2(1b16ef6) and v5.1-dev-1264-g1c84cfde14d

Operating System used.

Linux

How did you build your project?

Command line with CMake

If you are using Windows, please specify command line type.

No response

What is the expected behavior?

build success.

What is the actual behavior?

undefined reference to ‘gpio_output_set_high' and ‘gpio_input_get_high’.

Is this not support or missing?

Steps to reproduce.

  1. pull
  2. write simple code
  3. build with idf.py
    ...

Build or installation Logs.

/path/to/.espressif/tools/xtensa-esp32s3-elf/esp-2022r1-11.2.0/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/11.2.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/main/libmain.a(test.c.obj):(.literal.app_main+0x0): undefined reference to `gpio_input_get_high'
/path/to/.espressif/tools/xtensa-esp32s3-elf/esp-2022r1-11.2.0/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/11.2.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/main/libmain.a(test.c.obj):(.literal.app_main+0x4): undefined reference to `gpio_output_set_high'

More Information.

#include <stdio.h>
#include "esp32s3/rom/gpio.h"

void app_main(void)
{
    gpio_input_get_high();
    gpio_output_set_high(0, 0, 0, 0);
}
@imliubo imliubo added the Type: Bug bugs in IDF label Nov 18, 2022
@espressif-bot espressif-bot added the Status: Opened Issue is new label Nov 18, 2022
@github-actions github-actions bot changed the title ESP32-S3 ROM not provide gpio_input_get_high and gpio_output_set_high function? ESP32-S3 ROM not provide gpio_input_get_high and gpio_output_set_high function? (IDFGH-8773) Nov 18, 2022
@espressif-bot espressif-bot added Status: In Progress Work is in progress and removed Status: Opened Issue is new labels Nov 21, 2022
@suda-morris
Copy link
Collaborator

ROM functions are usually not considered public. It's common that some function exists on ESP32 but disappears in the future chips.

Can we know the reason why use the ROM functions instead of using the GPIO driver API like gpio_get_level? Are you expecting a function to read multiple adjacent GPIO values?

@imliubo
Copy link
Author

imliubo commented Nov 21, 2022

In fact, in this project, we use a script to parse and convert the function definition of gpio.h into micropython method. Since these two functions only have definitions and no actual function bodies, an error will be reported during the linking stage. But esp32 rom has provide this so just wanna make sure this is not support or missing, if not support in esp32-s3 we will solve this error in another way.

Related issue: here

@gm-jiang
Copy link
Collaborator

gm-jiang commented Nov 21, 2022

@imliubo Yes, in fact, the ROM code of the S3 also contains the functions gpio_input_get_high() and gpio_output_set_high but it is not exported through the ROM ld interface, I think we can add these two functions as S3 ROM patch,but a little RAM consumption.
one more things, ESP32/S2/S3/C6 ROM support gpio_input_get_high() and gpio_output_set_high since the gpio num of these chips is greater than 32. ESP32-C2/C3/H2(MP) ROM does not support, maybe we should remove the definitions from gpio.h.

@imliubo
Copy link
Author

imliubo commented Nov 22, 2022

Hi @gm-jiang ,

es, in fact, the ROM code of the S3 also contains the functions gpio_input_get_high() and gpio_output_set_high but it is not exported through the ROM ld interface, I think we can add these two functions as S3 ROM patch,but a little RAM consumption.

So this need update idf or something?Then we use this two function with esp32-s3?

one more things, ESP32/S2/S3/C6 ROM support gpio_input_get_high() and gpio_output_set_high since the gpio num of these chips is greater than 32. ESP32-C2/C3/H2(MP) ROM does not support, maybe we should remove the definitions from gpio.h.

If ESP32-C2/C3/H2(MP) not support i think remove the definitions from gpio.h is better, but this is your guys decision. For us just want build no error.

@espressif-bot espressif-bot added Resolution: NA Issue resolution is unavailable Status: Done Issue is done internally Resolution: Done Issue is done internally and removed Status: In Progress Work is in progress Resolution: NA Issue resolution is unavailable labels Dec 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Done Issue is done internally Status: Done Issue is done internally Type: Bug bugs in IDF
Projects
None yet
Development

No branches or pull requests

4 participants