Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 80ea521

Browse filesBrowse files
authored
Add support for 160MHz rated CPUs (espressif#3135)
Some ESP32 chips are rated only to 160MHz. This change adds support for them and does not allow frequency to be switched to 240MHz
1 parent 5c04de6 commit 80ea521
Copy full SHA for 80ea521

File tree

1 file changed

+10
-0
lines changed
Filter options

1 file changed

+10
-0
lines changed

‎cores/esp32/esp32-hal-cpu.c

Copy file name to clipboardExpand all lines: cores/esp32/esp32-hal-cpu.c
+10Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include "soc/rtc_cntl_reg.h"
2424
#include "rom/rtc.h"
2525
#include "soc/apb_ctrl_reg.h"
26+
#include "soc/efuse_reg.h"
2627
#include "esp32-hal.h"
2728
#include "esp32-hal-cpu.h"
2829

@@ -150,6 +151,15 @@ bool setCpuFrequencyMhz(uint32_t cpu_freq_mhz){
150151
}
151152
return false;
152153
}
154+
//check if cpu supports the frequency
155+
if(cpu_freq_mhz == 240){
156+
//Check if ESP32 is rated for a CPU frequency of 160MHz only
157+
if (REG_GET_BIT(EFUSE_BLK0_RDATA3_REG, EFUSE_RD_CHIP_CPU_FREQ_RATED) &&
158+
REG_GET_BIT(EFUSE_BLK0_RDATA3_REG, EFUSE_RD_CHIP_CPU_FREQ_LOW)) {
159+
log_e("Can not switch to 240 MHz! Chip CPU frequency rated for 160MHz.");
160+
cpu_freq_mhz = 160;
161+
}
162+
}
153163
//Get current CPU clock configuration
154164
rtc_clk_cpu_freq_get_config(&cconf);
155165
//return if frequency has not changed

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.