Skip to content

Commit

Permalink
Merge branch 'bugfix/fix_mspi_timing_tuning_psram_timing_issue' into …
Browse files Browse the repository at this point in the history
…'master'

mspi_tuning: fix psram timing tuning bug

Closes IDF-6457

See merge request espressif/esp-idf!21536
  • Loading branch information
Icarus113 committed Dec 15, 2022
2 parents 67cfef0 + 25114b7 commit 34e5a80
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Expand Up @@ -2,6 +2,7 @@ CONFIG_IDF_TARGET="esp32s3"

CONFIG_ESP32S3_SPIRAM_SUPPORT=y
CONFIG_SPIRAM_MODE_OCT=y
CONFIG_SPIRAM_SPEED_80M=y
CONFIG_SPIRAM_FETCH_INSTRUCTIONS=y
CONFIG_SPIRAM_RODATA=y

Expand Down
6 changes: 6 additions & 0 deletions components/spi_flash/spi_flash_timing_tuning.c
Expand Up @@ -392,6 +392,9 @@ static void clear_timing_tuning_regs(bool control_spi1)
} else {
//Won't touch SPI1 registers
}

spi_timing_config_psram_set_din_mode_num(0, 0, 0);
spi_timing_config_psram_set_extra_dummy(0, 0);
}
#endif //#if SPI_TIMING_FLASH_NEEDS_TUNING || SPI_TIMING_PSRAM_NEEDS_TUNING

Expand All @@ -414,6 +417,9 @@ void spi_timing_enter_mspi_low_speed_mode(bool control_spi1)
spi_timing_config_set_flash_clock(1, 4);
}

//Set PSRAM module clock
spi_timing_config_set_psram_clock(0, 4);

#if SPI_TIMING_FLASH_NEEDS_TUNING || SPI_TIMING_PSRAM_NEEDS_TUNING
clear_timing_tuning_regs(control_spi1);
#endif
Expand Down

0 comments on commit 34e5a80

Please sign in to comment.