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

ESP32 set clock frequency in mos.yml? #538

Open
Harvie opened this issue Apr 21, 2020 · 1 comment
Open

ESP32 set clock frequency in mos.yml? #538

Harvie opened this issue Apr 21, 2020 · 1 comment

Comments

@Harvie
Copy link

Harvie commented Apr 21, 2020

I've noticed that ESP32 can run under various speeds 40MHz, 80MHz, 160MHz, 240MHz.
Can this be set in mos.yml ?

Can this be set during runtime? I've noticed esp-idf has api for this, but i am not sure if nothing will break on mongoose side when i use it...

@rojer
Copy link
Collaborator

rojer commented Apr 21, 2020

it can be set in mos.yml via SDK options.
for example, to run at 240 mhz:

ESP_IDF_SDKCONFIG_OPTS: "${build_vars.ESP_IDF_SDKCONFIG_OPTS} CONFIG_ESP32_DEFAULT_CPU_FREQ_80= CONFIG_ESP32_DEFAULT_CPU_FREQ_160= CONFIG_ESP32_DEFAULT_CPU_FREQ_240=y CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ=240"

changing frequency at runtime should be possible as long as APB frequency stays constant, otherwise peripheral frequency dividers need to be adjusted, which is not currently done.

you need to keep in mind that not all chips are qualified to run at 240 mhz. ones that are, have special efuse set and if it's not set, it will refuse to run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants