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

feat(esp32p4): Add initial ESP32-P4 support #10358

Merged
merged 28 commits into from
Sep 24, 2024
Merged
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
fcd64f7
feat(esp32p4): Initial changes required for ESP32-P4
Jason2866 Aug 20, 2024
a1c1ccb
fix(esp32p4): Fix lib builder errors
lucasssvaz Sep 19, 2024
ea83f5a
change(esp32p4): Unhide board
lucasssvaz Sep 19, 2024
bcc55ea
ci(esp32p4): Add ESP32-P4 to workflow
lucasssvaz Sep 19, 2024
394dd1b
change(esptool): Update esptool to 4.8.0
lucasssvaz Sep 19, 2024
03d6e32
fix(build): Fix redefinition errors
lucasssvaz Sep 19, 2024
5c22a28
fix(build): Remove old commands
lucasssvaz Sep 19, 2024
0a37668
change(esptool): Remove unsupported 32-bit tools
lucasssvaz Sep 19, 2024
979b16b
fix(get.py): Force exe generation
lucasssvaz Sep 19, 2024
26218d4
Revert "fix(get.py): Force exe generation"
lucasssvaz Sep 19, 2024
b23a2fb
fix(get.py): Fix system check
lucasssvaz Sep 19, 2024
488740b
change(tools): Push generated binaries to PR
github-actions[bot] Sep 19, 2024
72643fa
ci(esp32p4): Add missing ESP32-P4 entries
lucasssvaz Sep 19, 2024
e6cf7dc
fix(esp32p4): Add chip info
lucasssvaz Sep 20, 2024
62fef78
fix(esp32p4): Fix build commands
lucasssvaz Sep 20, 2024
149edfa
docs(esp32p4): Add missing references to P4
lucasssvaz Sep 20, 2024
e372320
fix(esp32p4): Fix clock sources definitions
lucasssvaz Sep 21, 2024
a8e1fdf
fix(esp32p4): Set CPU frequency to 360 MHz so it is stable in all chips
lucasssvaz Sep 21, 2024
fb3443d
refactor(esp32p4): Change preprocessor conditionals for maintainability
lucasssvaz Sep 21, 2024
f72fc69
fix(esp32p4): Add missing menu options
lucasssvaz Sep 22, 2024
f1b126c
fix(esp32p4): Mark as not in development json in readme
lucasssvaz Sep 24, 2024
b4f535a
fix(esp32p4): Add P4 to ci.json files
lucasssvaz Sep 24, 2024
24efbdd
ci(pre-commit): Apply automatic fixes
pre-commit-ci-lite[bot] Sep 24, 2024
09c0883
fix(get.py): Remove unused include
lucasssvaz Sep 24, 2024
50befb5
ci(pre-commit): Apply automatic fixes
pre-commit-ci-lite[bot] Sep 24, 2024
5913778
change(tools): Push generated binaries to PR
github-actions[bot] Sep 24, 2024
c882a84
ci(pre-commit): Apply automatic fixes
pre-commit-ci-lite[bot] Sep 24, 2024
148b633
fix(ci.json): Fix formatting
lucasssvaz Sep 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix(esp32p4): Fix clock sources definitions
  • Loading branch information
lucasssvaz committed Sep 21, 2024
commit e3723203f41c80c9e3e5c901ec129662d3f28fd0
23 changes: 13 additions & 10 deletions cores/esp32/esp32-hal-cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,13 +163,13 @@ bool removeApbChangeCallback(void *arg, apb_change_cb_t cb) {
}

static uint32_t calculateApb(rtc_cpu_freq_config_t *conf) {
#if CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32H2 || CONFIG_IDF_TARGET_ESP32P4
return APB_CLK_FREQ;
#else
#if CONFIG_IDF_TARGET_ESP32 || CONFIG_IDF_TARGET_ESP32S2
if (conf->freq_mhz >= 80) {
return 80 * MHZ;
}
return (conf->source_freq_mhz * MHZ) / conf->div;
#else
return APB_CLK_FREQ;
#endif
}

Expand Down Expand Up @@ -250,11 +250,8 @@ bool setCpuFrequencyMhz(uint32_t cpu_freq_mhz) {
}
#endif
//Update FreeRTOS Tick Divisor
#if CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 || CONFIG_IDF_TARGET_ESP32P4

#elif CONFIG_IDF_TARGET_ESP32S3

#else
#if CONFIG_IDF_TARGET_ESP32 || CONFIG_IDF_TARGET_ESP32S2
uint32_t fcpu = (conf.freq_mhz >= 80) ? (conf.freq_mhz * MHZ) : (apb);
_xt_tick_divisor = fcpu / XT_TICK_PER_SEC;
#endif
Expand All @@ -265,13 +262,19 @@ bool setCpuFrequencyMhz(uint32_t cpu_freq_mhz) {
#ifdef SOC_CLK_APLL_SUPPORTED
log_d(
"%s: %u / %u = %u Mhz, APB: %u Hz",
(conf.source == RTC_CPU_FREQ_SRC_PLL) ? "PLL"
: ((conf.source == RTC_CPU_FREQ_SRC_APLL) ? "APLL" : ((conf.source == RTC_CPU_FREQ_SRC_XTAL) ? "XTAL" : "8M")),
(conf.source == SOC_CPU_CLK_SRC_PLL) ? "PLL"
: ((conf.source == SOC_CPU_CLK_SRC_APLL) ? "APLL"
: ((conf.source == SOC_CPU_CLK_SRC_XTAL) ? "XTAL"
#ifdef CONFIG_IDF_TARGET_ESP32P4
: "17.5M"),
#else
: "8M")),
#endif
conf.source_freq_mhz, conf.div, conf.freq_mhz, apb
);
#else
log_d(
"%s: %u / %u = %u Mhz, APB: %u Hz", (conf.source == RTC_CPU_FREQ_SRC_PLL) ? "PLL" : ((conf.source == RTC_CPU_FREQ_SRC_XTAL) ? "XTAL" : "17.5M"),
"%s: %u / %u = %u Mhz, APB: %u Hz", (conf.source == SOC_CPU_CLK_SRC_PLL) ? "PLL" : ((conf.source == SOC_CPU_CLK_SRC_XTAL) ? "XTAL" : "17.5M"),
conf.source_freq_mhz, conf.div, conf.freq_mhz, apb
);
#endif
Expand Down