Want to define variables in PSRAM via linker script; compilation succeeds but flashing fails

image

attribute((section(“.l2_ret_bss”))) uint8_t audio_buffer[4800];

The environment is Ubuntu 25.10, the SDK is the latest version recently cloned and downloaded, and the development board is the 56 development board purchased from a Taobao store. Seeking help from experts for advice.

Could you please provide the specific model of the development board and the command used for compilation?


I didn’t change any commands; it’s just the normal compilation and download for the standard ESP32 board.
As long as I remove that variable, everything works fine.
But when I include it, the code compiles successfully yet fails to download to the chip.
Before the failure, I also get the提示 on the last line of the image below :upside_down_face:

The entire related code is shown below:

I tried to reproduce it, and it should be an issue with this declaration method. You can try the following declaration method:

#include “mem_section.h”

L2_RET_BSS_SECT_BEGIN(audio_buffer)

static uint8_t audio_buffer[4800] L2_RET_BSS_SECT(audio_buffer);

L2_RET_BSS_SECT_END

1 Like

Solved. Judging from the returned address, it’s indeed defined in PSRAM. Many thanks! It’s really heartwarming to have questions answered promptly. Wishing your company’s open-source community continued growth and success :smiley: