pSRAM detection in Wrover standalone chip

Hi all,
System :

  1. ESP32 Wrover Kit ( Standalone)
  2. Arduino Framework
  3. Board configuration : ESP32 Wrover , 115200 .

I was trying to detect the pSRAM by following test code.

#include <SPI.h>

#include <Arduino.h>
#include<esp32-hal.h>



void setup() {
  
  Serial.begin(115200);
  //delay(2000);
// pinMode(3,OUTPUT);
// delay(200);
//
//  digitalWrite(3,HIGH);
//  delay(500);

  
  
 // Serial.setDebugOutput(true);
  
}

void loop() {
  Serial.print("Total heap:");
  Serial.println(ESP.getHeapSize());
  Serial.print("Free heap: ");
  Serial.println(ESP.getFreeHeap());
//  Serial.print("TOtal psram size : ");
//  Serial.println(esp_spiram_get_size());
  Serial.print("PSRAM INIT : ");
  Serial.println(psramInit());
   Serial.print("PSRAM Found : ");
  Serial.println(psramFound());
if(psramFound()){
    
//  Serial.print("Total PSRAM using caps:");
//  Serial.println(heap_caps_get_free_size(MALLOC_CAP_SPIRAM));
  Serial.print("Total PSRAM:");
  Serial.println(ESP.getPsramSize());
  Serial.print("Free PSRAM: ");
  Serial.println(ESP.getFreePsram());
  
  }
  delay(2000);
  }

It was flashed successfully and showing the psram found and enabled.
But psram size is showing 0.

Please help me with solution.
Second test I performed on ESP-IDF, in that psram was detected and size was displayed.

Please help me …I’m stuck

This article appears to be quite good: https://thingpulse.com/esp32-how-to-use-psram/ There is a special configuration if you are using PlatformIO (if that’s what you meant by Arduino framework)

6v6gt:
This article appears to be quite good: ESP32 - How To Use PSRAM • ThingPulse
There is a special configuration if you are using PlatformIO (if that’s what you meant by Arduino framework)

Hi,
Thanks for the suggestion but I have already tried that.
Issue is when I’m trying with idf its showing me psram memory size = 8388608
But when I jumped to arduino…Its showing 0 .