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

cpu/esp32: add support for ESP32-S3 #18421

Merged
merged 8 commits into from
Aug 22, 2022

Conversation

gschorcht
Copy link
Contributor

@gschorcht gschorcht commented Aug 9, 2022

Contribution description

This PR is a split-off from PR #18185, which provides

  • the support for ESP32-S3 SoC
  • a common ESP32-S3 board definition
  • the board definition for the ESP32S3-DevKit board.

This PR requires PRs #18408, #18409, #18410 and #18411 to be compilable in CI. Furthermore the CI workers need an update with riotdocker #200

Testing procedure

Beside of Green CI some basic tests should work (Of course, I have already tested all of them and many more):

  • tests/shell
  • tests/periph_cpuid
  • tests/periph_gpio
  • tests/periph_hwrng
  • tests/periph_i2c
  • tests/periph_spi
  • tests/periph_rtt
  • tests/periph_timer
  • examples/gnrc_networking using esp_wifi as optional module.

Issues/PRs references

Depends on #18408
Depends on #18409
Depends on #18410
Depends on #18411

@github-actions github-actions bot added Area: boards Area: Board ports Area: CI Area: Continuous Integration of RIOT components Area: cpu Area: CPU/MCU ports Area: doc Area: Documentation Area: Kconfig Area: Kconfig integration Area: tools Area: Supplementary tools Platform: ESP Platform: This PR/issue effects ESP-based platforms labels Aug 9, 2022
@gschorcht gschorcht added Type: new feature The issue requests / The PR implemements a new feature for RIOT State: waiting for other PR State: The PR requires another PR to be merged first State: waiting for CI update State: The PR requires an Update to CI to be performed first labels Aug 9, 2022
@gschorcht gschorcht removed the State: waiting for other PR State: The PR requires another PR to be merged first label Aug 10, 2022
@gschorcht gschorcht force-pushed the cpu/esp32/add_esp32s3_cpu_support branch from e389aa0 to 55b1686 Compare August 10, 2022 16:00
@gschorcht gschorcht added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Aug 10, 2022
@gschorcht
Copy link
Contributor Author

@kaspar030 This PR requires an update of CI workers. Is there a plan when it is done next time? How is it coordinated?

@gschorcht gschorcht requested a review from benpicco August 11, 2022 06:51
@benpicco benpicco added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Aug 12, 2022
@gschorcht
Copy link
Contributor Author

@benpicco Do you think the CI workers are updated now?

@benpicco
Copy link
Contributor

Well it's worth a try. And with the current CI run times the compilation will happen during the night anyway.

If not we got something to point to showing that the automatic updates apparently do not work.

/**
* ESP32 specific sleep configuration (DO NOT CHANGE)
*/
#define CONFIG_ESP_SLEEP_RTC_BUS_ISO_WORKAROUND 1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this about?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be honest, I don't knwo. It's just a setting that comes from ESP-IDF's Kconfig without any explaination.

config ESP_SLEEP_RTC_BUS_ISO_WORKAROUND
        bool
        default y if IDF_TARGET_ESP32(=n) || IDF_TARGET_ESP32S2(=n) || IDF_TARGET_ESP32S3(=n)

Copy link
Contributor

@benpicco benpicco Aug 16, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting - better add a note that this is from the SDK and true for all XTensa ESPs

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, but this is actually the case for all CONFIG_* definitions in the sdkconfig*.h files. They all define configurations that are only required for compiling ESP-IDF sources and are set to the default values of ESP-IDF's Kconfig. Maybe it is better to move them to a directory cpu/esp32/esp-idf/include/config so that it becomes better clear what these files are for.

/**
* @brief Mapping configured ESP32 default clock to CLOCK_CORECLOCK define
*/
#define CLOCK_CORECLOCK (1000000UL * CONFIG_ESP32S3_DEFAULT_CPU_FREQ_MHZ)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#define CLOCK_CORECLOCK (1000000UL * CONFIG_ESP32S3_DEFAULT_CPU_FREQ_MHZ)
#define CLOCK_CORECLOCK MHZ(CONFIG_ESP32S3_DEFAULT_CPU_FREQ_MHZ)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would require to include RIOT's macros.h which leads to a number of naming conflicts when compiling ESP IDF sources, including the MHZ macro. sdkconfig_*.h are mainly used for the configuration of ESP-IDF with this only acception. A solution could be to move CLOCK_CORECLOCK to cpu_conf.h. It's just still there since it was added there with 5ae5c40f26de541c1ac804623520f67442588f83`.

Should I try to move it to cpu_conf.h for all ESP32x SoCs with this PR?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would make more sense in cpu_conf.h since it's not for configuring the SDK but for RIOT consumption only.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it be a separate PR which would require an additional rebase or could it be part of this PR?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really have a strong opinion there, whatever you prefer.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commit 066239d moves the define to the corresponding cpu_*.h files.

cpu/esp32/include/sdkconfig_esp32s3.h Outdated Show resolved Hide resolved
cpu/esp_common/esp-xtensa/thread_arch.c Outdated Show resolved Hide resolved
cpu/esp_common/esp-xtensa/thread_arch.c Outdated Show resolved Hide resolved
@gschorcht
Copy link
Contributor Author

Well it's worth a try. And with the current CI run times the compilation will happen during the night anyway.

If not we got something to point to showing that the automatic updates apparently do not work.

The toolchain is still missing 😟

@gschorcht gschorcht removed the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Aug 13, 2022
@gschorcht
Copy link
Contributor Author

Well it's worth a try. And with the current CI run times the compilation will happen during the night anyway.
If not we got something to point to showing that the automatic updates apparently do not work.

The toolchain is still missing worried

The question is how we can get the CI worker up to date.

@benpicco
Copy link
Contributor

I'd keep the ready for build label set - makes it easier to complain about it on Matrix 😄

@benpicco benpicco added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Aug 13, 2022
@gschorcht gschorcht force-pushed the cpu/esp32/add_esp32s3_cpu_support branch 2 times, most recently from 211f299 to 07e484c Compare August 17, 2022 13:50
@gschorcht
Copy link
Contributor Author

gschorcht commented Aug 17, 2022

CI is not happy anymore

undefined reference to `cpu_coreclk'

worried Hm, I compiled some tests before pushing the changes. That is, we need an extra CI compilation cycle, quite annoying.

I have moved CLOCK_CORECLOCK definition to periph_cpu.h, see commit e7bf789. Let's hope that it doesn't cause other compilation problems.

This define does not belong to the defines in `sdkconfig_*.h` that are used for the ESP-IDF SDK. It is therefore moved to the corresponding `periph_cpu_*.h` file.
@gschorcht gschorcht force-pushed the cpu/esp32/add_esp32s3_cpu_support branch from 07e484c to e7bf789 Compare August 17, 2022 13:58
@benpicco benpicco added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Aug 17, 2022
@gschorcht
Copy link
Contributor Author

@benpicco I am getting desperate as I am getting another unrelated error in the CI compilation. I was hoping to merge the PR today to be able to provide the PRs based on it for the ESP32-S3 before my vacation starting tomorrow 😟

@maribu
Copy link
Member

maribu commented Aug 18, 2022

The current CI run will fail due to unrelated issues. Failures that look like

-- running on worker breeze thread 3, build number 316686.
make: Entering directory '/tmp/dwq.0.3566048456678582/1bc9f0dc6a1abbb862a0fb9058807d10/tests/driver_sam0_eth'
make: Leaving directory '/tmp/dwq.0.3566048456678582/1bc9f0dc6a1abbb862a0fb9058807d10/tests/driver_sam0_eth'
make: Entering directory '/tmp/dwq.0.3566048456678582/1bc9f0dc6a1abbb862a0fb9058807d10/tests/driver_sam0_eth'
Building application "tests_driver_sam0_eth" for "same54-xpro" with MCU "samd5x".

sha1sum /tmp/dwq.0.3566048456678582/1bc9f0dc6a1abbb862a0fb9058807d10/build/tests_driver_sam0_eth.bin > /tmp/dwq.0.3566048456678582/1bc9f0dc6a1abbb862a0fb9058807d10/build/test-input-hash.sha1
   text	   data	    bss	    dec	    hex	filename
  19468	    180	  16932	  36580	   8ee4	/tmp/dwq.0.3566048456678582/1bc9f0dc6a1abbb862a0fb9058807d10/build/tests_driver_sam0_eth.elf
make: Leaving directory '/tmp/dwq.0.3566048456678582/1bc9f0dc6a1abbb862a0fb9058807d10/tests/driver_sam0_eth'
32d31
< netdev_legacy_api
{"build/": 112}

will be fixed by #18466

@MrKevinWeiss MrKevinWeiss added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Aug 18, 2022
@MrKevinWeiss
Copy link
Contributor

If it is passing mudock and acked there is no reason it can't be merged today or even after your vacation. Maybe we want to enable automerge?

@maribu maribu enabled auto-merge August 18, 2022 08:34
@benpicco benpicco added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Aug 18, 2022
@benpicco
Copy link
Contributor

Sorry this didn’t make it, enjoy your vacation! Let’s hope we’re getting CI fixed by the time you’re back 😄

@MrKevinWeiss MrKevinWeiss disabled auto-merge August 22, 2022 08:09
@benpicco benpicco added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Aug 22, 2022
@MrKevinWeiss MrKevinWeiss removed the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Aug 22, 2022
@MrKevinWeiss
Copy link
Contributor

I will build once we fix the CI

@benpicco benpicco added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Aug 22, 2022
@benpicco benpicco enabled auto-merge August 22, 2022 14:42
@benpicco benpicco merged commit 00ede8f into RIOT-OS:master Aug 22, 2022
@gschorcht
Copy link
Contributor Author

Thanks for reviewing and merging.

@gschorcht gschorcht deleted the cpu/esp32/add_esp32s3_cpu_support branch August 23, 2022 15:22
@maribu maribu added this to the Release 2022.10 milestone Oct 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: boards Area: Board ports Area: CI Area: Continuous Integration of RIOT components Area: cpu Area: CPU/MCU ports Area: doc Area: Documentation Area: Kconfig Area: Kconfig integration Area: tools Area: Supplementary tools CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Platform: ESP Platform: This PR/issue effects ESP-based platforms Type: new feature The issue requests / The PR implemements a new feature for RIOT
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants