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: activate automatic XTAL detection #13059

Merged
merged 1 commit into from
Jan 31, 2020

Conversation

gschorcht
Copy link
Contributor

Contribution description

This PR changes the configuration of the ESP crystal frequency from a fix value of 40 MHz to crystal auto detection.

ESP32 can be clocked with either a 40 MHz or 26 MHz crystal. Since most boards use a 40 MHz crystal and the ESP32 design rules recommend a crystal frequency of 40 MHz, the configuration was previously set to 40 MHz. This commit changes the crystal configuration from 40 MHz to automatic detection, which allows also to use boards with a 26 MHz crystal like the Sparkfun ESP32 Thing DEV.

Testing procedure

If there is a board with a 26 MHz crystal at hand (I only know the Sparcfun ESP32 Thing DEV), flash and test any shell based application:

make BOARD=esp32-wroom-32 -C tests/shell

Without this PR, this should result into garbage at the console with the default UART console speed of 115200 baud but should work with an UART console speed of 74800 baud.

With this PR, the console should work with the default UART console speed of 115200.

If no board with 26 MHz is available, it should be sufficient to test that the board works as before.

Issues/PRs references

ESP32 can be clocked with either a 40 MHz or 26 MHz crystal. Since most boards use a 40 MHz crystal, the configuration was previously fixed to a 40 MHz crystal. This commit changes the crystal from 40 MHz to automatic detection, allowing boards with a 26 MHz crystal like the Sparkfun ESP32 Thing DEV to be used.
@gschorcht gschorcht added Area: cpu Area: CPU/MCU ports 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: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation labels Jan 9, 2020
@benpicco benpicco added the Reviewed: 3-testing The PR was tested according to the maintainer guidelines label Jan 31, 2020
Copy link
Contributor

@benpicco benpicco left a comment

Choose a reason for hiding this comment

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

Still works fine on esp32-wroom-32.
Are the bootloader changes always necessary when changing that define?
If so, that should be documented.

@gschorcht
Copy link
Contributor Author

Still works fine on esp32-wroom-32.
Are the bootloader changes always necessary when changing that define?
If so, that should be documented.

No, I just had to change it the XTAL freqency detection in bootloaders to automatic to get it also working during the RIOT startup. Changing the define for RIOT back to a fix value has no affect on the bootloaders.

@benpicco benpicco merged commit 57db6b7 into RIOT-OS:master Jan 31, 2020
@gschorcht
Copy link
Contributor Author

@benpicco Thanks for reviewing, testing and merging.

@gschorcht gschorcht deleted the cpu/esp32/fix_xtal_freq branch January 31, 2020 07:43
@leandrolanzieri leandrolanzieri added the Impact: minor The PR is small in size and might only require a quick look of a knowledgeable reviewer label Feb 20, 2020
@leandrolanzieri leandrolanzieri added this to the Release 2020.04 milestone Feb 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: cpu Area: CPU/MCU ports CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Impact: minor The PR is small in size and might only require a quick look of a knowledgeable reviewer Platform: ESP Platform: This PR/issue effects ESP-based platforms Reviewed: 3-testing The PR was tested according to the maintainer guidelines Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants