Skip to content

Commit

Permalink
esp32h2: fix xtal frequency value
Browse files Browse the repository at this point in the history
This fixes following error observed on ESP32-H2 MP:
A fatal error occurred: The eFuse supports only xtal=40M (xtal was 32)

Tested successful EFuse writes after this fix.
  • Loading branch information
mahavirj committed Feb 10, 2023
1 parent e93136f commit 9929978
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion espefuse/efuse/esp32h2/emulate_efuse_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def get_minor_chip_version(self):
return 0

def get_crystal_freq(self):
return 40 # MHz (common for all chips)
return 32 # MHz

def get_security_info(self):
return {
Expand Down
5 changes: 3 additions & 2 deletions espefuse/efuse/esp32h2/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,10 @@ def set_efuse_timing(self):
"""Set timing registers for burning efuses"""
# Configure clock
apb_freq = self.get_crystal_freq()
if apb_freq != 40:
# Based on `CONFIG_SOC_XTAL_SUPPORT_32M=y` for this target from ESP-IDF configuration
if apb_freq != 32:
raise esptool.FatalError(
"The eFuse supports only xtal=40M (xtal was %d)" % apb_freq
"The eFuse supports only xtal=32M (xtal was %d)" % apb_freq
)

self.update_reg(
Expand Down

0 comments on commit 9929978

Please sign in to comment.