You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
According to TRM, the instruction 754ff4 generated by both function is consistent and correct.
But now only the non-inline version works.
I inserted a large number of nop instructions into the inline version, considering that there may be some delay in function calls. But that didn't work:
// inline version with nop. NOT WORKstaticinlinevoidsetHigh()
{
__asm__ __volatile__ ("ee.set_bit_gpio_out 0xff" );
__asm__ __volatile__ ("nop" );
__asm__ __volatile__ ("nop" );
// more than 10 nop here
}
Also, calling the cpu_ll_write_dedic_gpio_mask function in esp-idf has the same behavior, and once the inline attribute of cpu_ll_write_dedic_gpio_mask is removed, everything works fine.
What is the actual behavior?
See above.
Steps to reproduce.
See above.
Debug Logs.
More Information.
No response
The text was updated successfully, but these errors were encountered:
github-actionsbot
changed the title
Dedicated GPIO not work with inline assembly function on ESP32S3
Dedicated GPIO not work with inline assembly function on ESP32S3 (IDFGH-14544)
Jan 30, 2025
Do you mean, you can't see the GPIO being "toggle/set/clear" by the CPU instruction? Could you please share a minimal project for us to reproduce? Because we also want to see if you have setup the GPIO correctly.
Do you mean, you can't see the GPIO being "toggle/set/clear" by the CPU instruction? Could you please share a minimal project for us to reproduce? Because we also want to see if you have setup the GPIO correctly.
It looks like the time it takes to run inline and non-inline instructions is different, which messes up the timing a bit. I need to insert more nop instructions than expected to make the non-inline version work.
The TRM and esp-idf documentation doesn't say what is the typical time to execute this instruction, i.e. what is the fastest rate of the Dedicated GPIO. I'll verify this with a logic analyzer after the holidays.
Answers checklist.
IDF version.
v4.4.2
Espressif SoC revision.
ESP32S3
Operating System used.
Linux
How did you build your project?
Command line with idf.py
If you are using Windows, please specify command line type.
None
Development Kit.
ESP32S3
Power Supply used.
USB
What is the expected behavior?
I'm trying to use Dedicated GPIO and I've found that inline assembly functions produce different results than non-inline assembly functions:
Use objdump to see the results of the non-inline and inline versions separately:
According to TRM, the instruction
754ff4
generated by both function is consistent and correct.But now only the non-inline version works.
I inserted a large number of
nop
instructions into the inline version, considering that there may be some delay in function calls. But that didn't work:Also, calling the
cpu_ll_write_dedic_gpio_mask
function in esp-idf has the same behavior, and once theinline
attribute ofcpu_ll_write_dedic_gpio_mask
is removed, everything works fine.What is the actual behavior?
See above.
Steps to reproduce.
See above.
Debug Logs.
More Information.
No response
The text was updated successfully, but these errors were encountered: