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

I2S clock initializer order error, compiler error on any I2S code (IDFGH-14660) #15405

Closed
3 tasks done
earlephilhower opened this issue Feb 16, 2025 · 0 comments
Closed
3 tasks done
Assignees
Labels
Resolution: NA Issue resolution is unavailable Status: Done Issue is done internally Type: Bug bugs in IDF

Comments

@earlephilhower
Copy link

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.

idf-release_v5.3-489d7a2b-v1

Operating System used.

Linux

How did you build your project?

Other (please specify in More Information)

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

None

What is the expected behavior?

Compiling the following should succeed:

int freq = 44100;
i2s_std_clk_config_t clk_cfg = I2S_STD_CLK_DEFAULT_CONFIG((uint32_t)freq);

What is the actual behavior?

The fields are initialized out of order in the #define macro leading to a compilation failure:

/home/earle/.arduino15/packages/esp32/tools/esp-rv32/2405/bin/riscv32-esp-elf-g++ -MMD -c @/home/earle/.arduino15/packages/esp32/tools/esp32-arduino-libs/idf-release_v5.3-489d7a2b-v1/esp32c6/flags/cpp_flags -Wall -Wextra -Og -g3 -Werror=return-type -DF_CPU=160000000L -DARDUINO=10607 -DARDUINO_ESP32C6_DEV -DARDUINO_ARCH_ESP32 "-DARDUINO_BOARD=\"ESP32C6_DEV\"" "-DARDUINO_VARIANT=\"esp32c6\"" -DARDUINO_PARTITION_default "-DARDUINO_HOST_OS=\"linux\"" "-DARDUINO_FQBN=\"esp32:esp32:esp32c6:UploadSpeed…ease_v5.3-489d7a2b-v1/esp32c6/include/esp_driver_i2s/include/driver/i2s_std.h:220:1: error: designator order for field 'i2s_std_clk_config_t::ext_clk_freq_hz' does not match declaration order in 'i2s_std_clk_config_t'
  220 | }
      | ^
/home/earle/Arduino/libraries/BackgroundAudio/src/ESP32I2SAudio.h:127:23: note: in expansion of macro 'I2S_STD_CLK_DEFAULT_CONFIG'
  127 |             clk_cfg = I2S_STD_CLK_DEFAULT_CONFIG((uint32_t)freq);
      |                       ^~~~~~~~~~~~~~~~~~~~~~~~~~

Steps to reproduce.

  1. Install Arduino-ESP32 3.1.2 (latest as of this writing)
  2. Build simple script in Arduino
#include <driver/i2s_std.h>
void setup() {
int freq = 44100;
i2s_std_clk_config_t clk_cfg = I2S_STD_CLK_DEFAULT_CONFIG((uint32_t)freq);
}
void loop() {
}
  1. Error will appear /home/earle/.arduino15/packages/esp32/tools/esp32-arduino-libs/idf-release_v5.3-489d7a2b-v1/esp32c6/include/esp_driver_i2s/include/driver/i2s_std.h:220:1: error: designator order for field 'i2s_std_clk_config_t::ext_clk_freq_hz' does not match declaration order in 'i2s_std_clk_config_t'

Build or installation Logs.


More Information.

This was seen using the Arduino-ESP32 3.1.2 release but is coming from the IDF library headers they distribute. However, it is using the IDF raw driver for I2S access and this should show on bare cmake built applications.

This was also seen and reported here (but in a closed issue so maybe missed): #15271 (comment)

@earlephilhower earlephilhower added the Type: Bug bugs in IDF label Feb 16, 2025
@github-actions github-actions bot changed the title I2S clock initializer order error, compiler error on any I2S code I2S clock initializer order error, compiler error on any I2S code (IDFGH-14660) Feb 16, 2025
@espressif-bot espressif-bot added the Status: Opened Issue is new label Feb 16, 2025
@espressif-bot espressif-bot added Status: Reviewing Issue is being reviewed Status: Done Issue is done internally Resolution: NA Issue resolution is unavailable and removed Status: Opened Issue is new Status: Reviewing Issue is being reviewed labels Feb 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: NA Issue resolution is unavailable Status: Done Issue is done internally Type: Bug bugs in IDF
Projects
None yet
Development

No branches or pull requests

3 participants