mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-02 04:04:31 +02:00
esp32s2/fpga: Fix a clock configure in bootloader
This commit is contained in:
committed by
bot
parent
f2c9c1e4ab
commit
48c498bdca
@@ -25,9 +25,15 @@ void bootloader_clock_configure(void)
|
|||||||
{
|
{
|
||||||
esp_rom_uart_tx_wait_idle(0);
|
esp_rom_uart_tx_wait_idle(0);
|
||||||
|
|
||||||
uint32_t clock = 40000000;
|
uint32_t xtal_freq_mhz = 40;
|
||||||
ets_update_cpu_frequency(clock / 1000000);
|
#ifdef CONFIG_IDF_TARGET_ESP32S2
|
||||||
REG_WRITE(RTC_CNTL_STORE5_REG, (clock >> 12) | ((clock >> 12) << 16));
|
uint32_t apb_freq_hz = 20000000;
|
||||||
|
#else
|
||||||
|
uint32_t apb_freq_hz = 40000000;
|
||||||
|
#endif // CONFIG_IDF_TARGET_ESP32S2
|
||||||
|
ets_update_cpu_frequency(apb_freq_hz / 1000000);
|
||||||
|
REG_WRITE(RTC_CNTL_STORE5_REG, (apb_freq_hz >> 12) | ((apb_freq_hz >> 12) << 16));
|
||||||
|
REG_WRITE(RTC_CNTL_STORE4_REG, (xtal_freq_mhz) | ((xtal_freq_mhz) << 16));
|
||||||
}
|
}
|
||||||
|
|
||||||
void bootloader_fill_random(void *buffer, size_t length)
|
void bootloader_fill_random(void *buffer, size_t length)
|
||||||
|
Reference in New Issue
Block a user