mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-02 11:10:54 +03:00
Merge branch 'fix/esp_psram_init_fix_v5.5' into 'release/v5.5'
fix(esp_psram): repeated call to init should return invalid state error (v5.5) See merge request espressif/esp-idf!50275
This commit is contained in:
@@ -454,6 +454,10 @@ esp_err_t esp_psram_chip_init(void)
|
|||||||
|
|
||||||
esp_err_t esp_psram_init(void)
|
esp_err_t esp_psram_init(void)
|
||||||
{
|
{
|
||||||
|
if (s_psram_ctx.is_initialised) {
|
||||||
|
return ESP_ERR_INVALID_STATE;
|
||||||
|
}
|
||||||
|
|
||||||
esp_err_t ret = ESP_FAIL;
|
esp_err_t ret = ESP_FAIL;
|
||||||
|
|
||||||
if (!s_psram_ctx.is_chip_initialised) {
|
if (!s_psram_ctx.is_chip_initialised) {
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ TEST_CASE("test psram no boot init", "[psram_no_boot_init]")
|
|||||||
#endif /* CONFIG_SPIRAM_PRE_CONFIGURE_MEMORY_PROTECTION */
|
#endif /* CONFIG_SPIRAM_PRE_CONFIGURE_MEMORY_PROTECTION */
|
||||||
|
|
||||||
TEST_ESP_OK(esp_psram_init());
|
TEST_ESP_OK(esp_psram_init());
|
||||||
|
TEST_ESP_ERR(ESP_ERR_INVALID_STATE, esp_psram_init());
|
||||||
|
|
||||||
#if CONFIG_SPIRAM_PRE_CONFIGURE_MEMORY_PROTECTION
|
#if CONFIG_SPIRAM_PRE_CONFIGURE_MEMORY_PROTECTION
|
||||||
size_t final_psram_heap = esp_psram_get_heap_size_to_protect();
|
size_t final_psram_heap = esp_psram_get_heap_size_to_protect();
|
||||||
|
|||||||
Reference in New Issue
Block a user