logo elektroda
logo elektroda
X
logo elektroda

[Solved] Problem with switching on the PSRAM on the ESP32 WEMOS LOLIN LIGHT board

speedy9 1515 4
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 20770448
    speedy9
    Helpful for users
    Hi. I have added myself a PSRAM (8MB, APS6404L) to the WEMOS LOLIN 32 Light board. I just need to enable the support. I'm using Arduino IDE 2. There is an option in the menu to enable/disable PSRAM support, but it only appears on boards that have PSRAM as standard.
    I don't know how to do it in Arduino for a board that doesn't have PSRM as standard. Theoretically in sdkconfig the entries are:
    
    #
    # SPI RAM config
    #
    CONFIG_SPIRAM_TYPE_AUTO=y
    # CONFIG_SPIRAM_TYPE_ESPPSRAM16 is not set
    # CONFIG_SPIRAM_TYPE_ESPPSRAM32 is not set
    # CONFIG_SPIRAM_TYPE_ESPPSRAM64 is not set
    CONFIG_SPIRAM_SIZE=-1
    # CONFIG_SPIRAM_SPEED_40M is not set
    CONFIG_SPIRAM_SPEED_80M=y
    CONFIG_SPIRAM=y
    # CONFIG_SPIRAM_BOOT_INIT is not set
    # CONFIG_SPIRAM_USE_MEMMAP is not set
    # CONFIG_SPIRAM_USE_CAPS_ALLOC is not set
    CONFIG_SPIRAM_USE_MALLOC=y
    CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=4096
    # CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP is not set
    CONFIG_SPIRAM_MALLOC_RESERVE_INTERNAL=0
    # CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY is not set
    # CONFIG_SPIRAM_ALLOW_NOINIT_SEG_EXTERNAL_MEMORY is not set
    CONFIG_SPIRAM_CACHE_WORKAROUND=y


    However, the SPI RAM is not initialised for my board. I think this is due to the way the board itself is defined in Arduino.
    I did the SPI RAM addition according to this description: https://blog.pagefault-limited.co.uk/lolin32-lite-esp32-8mb-psram-upgrade-mod
    According to the description here: https://arduinojson.org/v6/how-to/use-external-ram-on-esp32/ for Arduino you don't need to configure anything and the SPI RAM should supposedly be detected by itself. But it seems to me that it depends on the board definition.
    I even set in sdkconfig:
    CONFIG_SPIRAM_BOOT_INIT =y
    CONFIG_SPIRAM_USE_MEMMAP =y

    After reset I see only these entries:
    PSRAM found: 0
    PSRAM not found, inputBufferSize: 6399 bytes

    Any ideas?
  • ADVERTISEMENT
  • #2 20770486
    Anonymous
    Level 1  
  • ADVERTISEMENT
  • #3 20770530
    speedy9
    Helpful for users
    I haven't tried. And it's not like even if it "fixes" PSRAM for me it messes up other things?
    Maybe rather to the compiler pass -DBOARD_HAS_PSRAM
  • ADVERTISEMENT
  • #4 20770539
    Anonymous
    Level 1  
  • #5 20778332
    speedy9
    Helpful for users
    Successful. I edited the file C:³³³[user]³³³³AppData³³³ocalArduino15.0.11.11.txt adding in the LOLIN32 LIGHT board part such an entry:

    lolin32-lite.build.defines=-DBOARD_HAS_PSRAM

    It compiled, uploaded to the board and:
    20:28:04.276 -> [ 459][I][esp32-hal-psram.c:96] psramInit(): PSRAM enabled
    20:28:04.318 -> [ 495][D][esp32-hal-cpu.c:244] setCpuFrequencyMhz(): PLL: 480 / 2 = 240 Mhz, APB: 80000000 Hz
    20:28:04.351 -> [ 527][I][esp32-hal-i2c.c:75] i2cInit(): Initialising I2C Master: PSRAM INIT: 1
    20:28:04.351 -> PSRAM found: 1

    20:28:06.590 -> PSRAM found, inputBufferSize: 283615 bytes
ADVERTISEMENT