How to setting PSRAM in AMB23?

There are 4 Mb PSRAM in AMB23. Due to the big size of Wifi / FreeRTOS and LVGL v8 in our project. How can we configure the GCC config. files so that we can utilitize PSRAM as the interal ram like SRAM did ?

What we want to do is very similar to the following example,Thanks.

https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/system/mem_alloc.html?highlight=spiram

From standard sdk, there is ambd_sdk/component/os/os_dep/psram_reserve.c for configuring PSRAM.

Upon searching for the keyword configUSE_PSRAM_FOR_HEAP_REGION as indicated below:

We could find FreeRTOSConfig.h for configuring the size of PSRAM:

Hope it could help. Thanks

Thanks for your information, I’ll try to adapt it into my project.

目前是用這招解決,可以在Arduino 的開發環境中使用PSRAM。

I am using this code to initial PSRAM in Arduino Environment. It works but not know if it is a right way to do.

void setup()
{
  /// ------------------------- Enable PSRAM  ---------------------------------------------------------
    app_init_psram();

  //user code 
}



void app_init_psram(void)
{
    u32 temp;
    PCTL_InitTypeDef PCTL_InitStruct;

    /*set rwds pull down*/
    temp = HAL_READ32(PINMUX_REG_BASE, 0x104);
    temp &= ~(PAD_BIT_PULL_UP_RESISTOR_EN | PAD_BIT_PULL_DOWN_RESISTOR_EN);
    temp |= PAD_BIT_PULL_DOWN_RESISTOR_EN;
    HAL_WRITE32(PINMUX_REG_BASE, 0x104, temp);

    PSRAM_CTRL_StructInit(&PCTL_InitStruct);
    PSRAM_CTRL_Init(&PCTL_InitStruct);

    PSRAM_PHY_REG_Write(REG_PSRAM_CAL_PARA, 0x02030310);

    /*check psram valid*/
    HAL_WRITE32(PSRAM_BASE, 0, 0);
    assert_param(0 == HAL_READ32(PSRAM_BASE, 0));

    if (SYSCFG_CUT_VERSION_A != SYSCFG_CUTVersion())
    {
        if (_FALSE == PSRAM_calibration())
            return;

        if (FALSE == psram_dev_config.psram_dev_cal_enable)
        {
            temp = PSRAM_PHY_REG_Read(REG_PSRAM_CAL_CTRL);
            temp &= (~BIT_PSRAM_CFG_CAL_EN);
            PSRAM_PHY_REG_Write(REG_PSRAM_CAL_CTRL, temp);
        }
    }

    /*init psram bss area*/
    memset(__psram_bss_start__, 0, __psram_bss_end__ - __psram_bss_start__);
}