The ESP-IDF documentation for PSRAM is at Support for External RAM - ESP32 - — ESP-IDF Programming Guide latest documentation.
Since you are using ESP-IDF you should be using the pio run -t menuconfig command as documented here, e.g. in a CLI, to access the ESP-IDF configuration. You should not be using direct -DCONFIG_ESP32_ECO3_CACHE_LOCK_FIX etc macros (although that would have the same effect, but is not the intended way and can conflict).
Once you are in the menuconfig you can navigate the menus to
Activate that and save the changes (q to quit), given the standard pin numbers in the “SPI RAM config” submenu are correct, it should find the PSRAM. The initial UART boot log should be logging something about it, at least.


