Skip to content

Commit

Permalink
Fix compat tests due to esp-idf moving include files
Browse files Browse the repository at this point in the history
Peripheral register definitions were moved to a new directory
inside the ESP-IDF: components/soc/{cpu_type}/register.

This change caused our compat tests to fail because they
depended on predefined register constants.

This commit resolves the issue by adding the new directory to
GCC's include search path using the -I option.

Additionally, all header files in this new directory are now
added to the DefinesDB for the compat tests with RTC macros.

Fixes micropython#100.
  • Loading branch information
wnienhaus committed Dec 15, 2024
1 parent 37e68c5 commit 9be4dc0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/01_compat_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ run_tests_for_cpu() {

echo -e "\tBuilding using binutils ($cpu)"
gcc -I esp-idf/components/soc/$cpu/include -I esp-idf/components/esp_common/include \
-I esp-idf/components/soc/$cpu/register \
-x assembler-with-cpp \
-E -o ${pre_file} $src_file
esp32ulp-elf-as --mcpu=$cpu -o $obj_file ${pre_file}
Expand Down
2 changes: 2 additions & 0 deletions tests/02_compat_rtc_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ build_defines_db() {
rm -f "${defines_db}"
micropython -m esp32_ulp.parse_to_db \
esp-idf/components/soc/$cpu/include/soc/*.h \
esp-idf/components/soc/$cpu/register/soc/*.h \
esp-idf/components/esp_common/include/*.h 1>$log_file

# cache defines.db
Expand Down Expand Up @@ -184,6 +185,7 @@ run_tests_for_cpu() {

echo -e "\tBuilding using binutils ($cpu)"
gcc -I esp-idf/components/soc/$cpu/include -I esp-idf/components/esp_common/include \
-I esp-idf/components/soc/$cpu/register \
-x assembler-with-cpp \
-E -o ${pre_file} $src_file
esp32ulp-elf-as --mcpu=$cpu -o $obj_file ${pre_file}
Expand Down

0 comments on commit 9be4dc0

Please sign in to comment.