I created this topic in github, but I don’t know where is best place
This project ESP32-Oscilloscope/ESP32_Oscilloscope at main · Circuit-Digest/ESP32-Oscilloscope · GitHub
, i converted to PIO format for three ways:
- Classic C++: created file structure with .cpp and .h files
- All .ino files cobine in one big .cpp file
- Using PIO option “Import Arduino Project”.
In all three ways, i have the same error:
Linking .pio\build\esp32dev\firmware.elf
c:/users/user/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio\build\esp32dev\firmware.elf section `.dram0.bss' will not fit in region `dram0_0_seg'
c:/users/user/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: DRAM segment data does not fit.
c:/users/user/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: DRAM segment data does not fit.
c:/users/user/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: region `dram0_0_seg' overflowed by 488 bytes
collect2.exe: error: ld returned 1 exit status
*** [.pio\build\esp32dev\firmware.elf] Error 1
But in Arduino IDE its project compiling and working well.
If You want to check this project, keep in mind - its project for ESP32 1.xx version. For ESP32 versions 2.xx need the little change. The line:
i2s_read_bytes(I2S_NUM_0, (char*)&i2s_buff[i * NUM_SAMPLES], NUM_SAMPLES * sizeof(uint16_t), portMAX_DELAY);
change to:
size_t bytes = 0;
i2s_read(I2S_NUM_0, (char*)&i2s_buff[i * NUM_SAMPLES], NUM_SAMPLES * sizeof(uint16_t), &bytes, portMAX_DELAY);