Forum > Embedded
Xtensa-freertos wiki
ccrause:
--- Quote from: ccrause on March 17, 2024, 06:24:21 pm ---
--- Quote from: kassane on March 17, 2024, 05:53:28 pm ---Does anyone have experience with idf v5.x?
--- End quote ---
I have tried a few times to link an fpc example against esp-idf 5.0 & 5.2, but I've run into a problem where xtensa-esp32-elf-ld reported it cannot locate the precompiled esp-idf libraries, even though the path information was correct.
--- End quote ---
I checked again and have successfully linked a simple project against esp-idf 5.2 (using bintools xtensa-esp32-elf-gcc11_2_0-esp-2022r1). Unfortunately there is a deadlock on startup of the generated binary, so some further tweaks are required.
znagy:
Hi, may I ask you, does the compiler support placing variables into external RAM, like the EXT_MEM_ATTR in C for ESP32? Thx.
ccrause:
--- Quote from: znagy on October 04, 2024, 08:27:37 pm ---Hi, may I ask you, does the compiler support placing variables into external RAM, like the EXT_MEM_ATTR in C for ESP32? Thx.
--- End quote ---
In principle it should be possible, but then esp-idf must be configured with the Support for external, SPI-connected RAM option via menuconfig and rebuild as described in the wiki. Then you can tell FPC to place variables there using the section directive:
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---var i: integer; section '.ext_ram.bss';Note that it is necessary to copy the new esp32_out.ld and esp32.project.ld linker scripts (renamed to memory.ld and sections.ld since esp-idf v4.4) into the libraries folder, since these get updated with the PSRAM settings.
ccrause:
--- Quote from: ccrause on October 04, 2024, 10:34:23 pm ---
--- Quote from: znagy on October 04, 2024, 08:27:37 pm ---Hi, may I ask you, does the compiler support placing variables into external RAM, like the EXT_MEM_ATTR in C for ESP32? Thx.
--- End quote ---
In principle it should be possible, but then esp-idf must be configured with the Support for external, SPI-connected RAM option via menuconfig and rebuild as described in the wiki. Then you can tell FPC to place variables there using the section directive:
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---var i: integer; section '.ext_ram.bss';Note that it is necessary to copy the new esp32_out.ld and esp32.project.ld linker scripts (renamed to memory.ld and sections.ld since esp-idf v4.4) into the libraries folder, since these get updated with the PSRAM settings.
--- End quote ---
PS: You probably (untested) also need to link (-Fl) against the PSRAM aware system libraries (libc, libgcc etc.) located in the tools folder (if following the wiki instructions). On my PC the relevant folders are located here:
~/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/lib/gcc/xtensa-esp-elf/13.2.0/esp32/psram/no-rtti
and
~/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/xtensa-esp-elf/lib/esp32/psram/no-rtti
The binutils version in the paths above will depend on the esp-idf version you installed.
znagy:
Thank you very much, it works perfectly! When declaring the variable in a unit, section '.ext_ram_noinit' can be used.
Navigation
[0] Message Index
[#] Next page
[*] Previous page