Xtensa-freertos wiki lazarus / 77-Embedded ---------------------------------------------------------------------- ccrause · 2022-01-04 12:06 The wiki instructions for xtensa-freertos has been updated.  Please review and update if anything is unclear, misleading or wrong. Note that the information is Linux focused, please update/add information as required for other OSs. Alternatively discuss issues with the information on the wiki page in this thread so that the usability of the page can be improved. ---------------------------------------------------------------------- botster · 2022-01-04 19:09 It is much more clear now. Thank you very much. I did notice that you included an example 'hello world' program in the ESP8266 section, but not in the ESP32 section. And, the example fpc directory path (eg. ~/fpc/main) was just "~/fpc" in the ESP8266 section. I corrected the example path in the ESP8266 section and included the example "hello world" program in the ESP32 section. Now, one more question. When it says, "Create a hello world program [...] in the fpc dir", I am assuming that is for simplicity, and one could put the program in a directory of their choice providing the paths in the compiler command line are adjusted appropriately. Correct? I ask because, personally, I would not want to clutter up my fpc source directory. ---------------------------------------------------------------------- botster · 2022-01-04 23:43 I believe there is an error in the test program compiler command for the ESP8266 Compile and run test program. The last option is: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i -Fl~/esp/xtensa-lx106-elf/xtensa-lx106-elf/sysroot/lib/However, there is no 'sysroot' directory in ~/esp/xtensa-lx106-elf/xtensa-lx106-elf Changing the option to: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i -Fl~/esp/xtensa-lx106-elf/xtensa-lx106-elf/lib/allowed the linker to find libstdc++.a ---------------------------------------------------------------------- ccrause · 2022-01-05 07:25 Quote from: botster on January 04, 2022, 08:09:53 pmIt is much more clear now. Thank you very much. I did notice that you included an example 'hello world' program in the ESP8266 section, but not in the ESP32 section. And, the example fpc directory path (eg. ~/fpc/main) was just "~/fpc" in the ESP8266 section. I corrected the example path in the ESP8266 section and included the example "hello world" program in the ESP32 section. Thanks for updating this. QuoteNow, one more question. When it says, "Create a hello world program [...] in the fpc dir", I am assuming that is for simplicity, and one could put the program in a directory of their choice providing the paths in the compiler command line are adjusted appropriately. Correct? I ask because, personally, I would not want to clutter up my fpc source directory. Yes, you are correct, updated. ---------------------------------------------------------------------- af0815 · 2022-01-05 09:23 Can the chapter 1.3.1 up to 1.3.4 declared a linux area. Because the commandlines are Linux only IMHO. Actual there is no working version for windows as far as i know. ---------------------------------------------------------------------- botster · 2022-01-05 17:43 Quote from: ccrause on January 05, 2022, 08:25:15 amQuoteNow, one more question. When it says, "Create a hello world program [...] in the fpc dir", I am assuming that is for simplicity, and one could put the program in a directory of their choice providing the paths in the compiler command line are adjusted appropriately. Correct? I ask because, personally, I would not want to clutter up my fpc source directory. Yes, you are correct, updated. I don't want to second-guess you in case I am incorrect. But, shouldn't Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i ~/fpc/main/compiler/ppcrossxtensa -Furtl/units/xtensa-freertos/ -Tfreertos -XPxtensa-lx106-elf- -O3 -Wpesp8266 hello -Fl~/esp/xtensa- lx106-elf-libs/ -Fl$IDF_PATH/components/esp8266/lib -Fl$IDF_PATH/components/newlib/newlib/lib -Fl~/esp/xtensa- lx106-elf/xtensa-lx106-elf/lib/be Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i ~/fpc/main/compiler/ppcrossxtensa -Fu~/fpc/main/rtl/units/xtensa- freertos/ -Tfreertos -XPxtensa-lx106-elf- -O3 -Wpesp8266 hello -Fl~/esp/xtensa-lx106-elf-libs/ -Fl$IDF_PATH/components/esp8266/lib -Fl$IDF_PATH/components/newlib/newlib/lib -Fl~/esp/xtensa- lx106-elf/xtensa-lx106-elf/lib/(ie. "-Fu~/fpc/main/rtl/units/xtensa- freertos/")? ---------------------------------------------------------------------- ccrause · 2022-01-05 17:51 Quote from: botster on January 05, 2022, 06:43:44 pmI don't want to second-guess you in case I am incorrect. But, shouldn't Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i ~/fpc/main/compiler/ppcrossxtensa -Furtl/units/xtensa-freertos/ -Tfreertos -XPxtensa-lx106-elf- -O3 -Wpesp8266 hello -Fl~/esp/xtensa- lx106-elf-libs/ -Fl$IDF_PATH/components/esp8266/lib -Fl$IDF_PATH/components/newlib/newlib/lib -Fl~/esp/xtensa- lx106-elf/xtensa-lx106-elf/lib/be Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i ~/fpc/main/compiler/ppcrossxtensa -Fu~/fpc/main/rtl/units/xtensa- freertos/ -Tfreertos -XPxtensa-lx106-elf- -O3 -Wpesp8266 hello -Fl~/esp/xtensa-lx106-elf-libs/ -Fl$IDF_PATH/components/esp8266/lib -Fl$IDF_PATH/components/newlib/newlib/lib -Fl~/esp/xtensa- lx106-elf/xtensa-lx106-elf/lib/(ie. "-Fu~/fpc/main/rtl/units/xtensa- freertos/")? You are correct, please feel free to edit the wiki.  Thanks for checking the content. ---------------------------------------------------------------------- botster · 2022-01-06 00:33 @ccrause, you're correct. As you mentioned in another thread, there is a note about using -WP to specify the SDK version number. I did not see it before; probably from reading too fast. May I suggest the individual notes be put near the paragraph to which they pertain? For example, the note about -WP would go directly underneath the compiler command. Or, do you think this would make things look more cluttered? ---------------------------------------------------------------------- ccrause · 2022-01-06 05:15 Quote from: botster on January 06, 2022, 01:33:53 am@ccrause, you're correct. As you mentioned in another thread, there is a note about using -WP to specify the SDK version number. I did not see it before; probably from reading too fast. May I suggest the individual notes be put near the paragraph to which they pertain? For example, the note about -WP would go directly underneath the compiler command. Or, do you think this would make things look more cluttered? The presentation format is not ideal at the moment.  I would prefer not to repeat common information, but the page is quite busy so it is easy to miss details like using the -WP option.  I tend to agree that one should probably treat each paragraph (or at least subsection) as standalone, so all information should be presented where applicable. ---------------------------------------------------------------------- ccrause · 2024-03-17 17:24 Quote from: kassane on March 17, 2024, 05:53:28 pmCool, it's great to see more languages supporting this architecture. FPC supports it without using LLVM (espressif-fork). The wiki doesn't specify if esp32-s2 and esp32-s3 are also supported. Not yet, but in principle this should not be too challenging. QuoteDoes anyone have experience with idf v5.x? 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. ---------------------------------------------------------------------- ccrause · 2024-03-18 09:47 Quote from: ccrause on March 17, 2024, 06:24:21 pmQuote from: kassane on March 17, 2024, 05:53:28 pmDoes anyone have experience with idf v5.x? 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. 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 · 2024-10-04 18:27 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 · 2024-10-04 20:34 Quote from: znagy on October 04, 2024, 08:27:37 pmHi, may I ask you, does the compiler support placing variables into external RAM, like the EXT_MEM_ATTR in C for ESP32? Thx. 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  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i 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 · 2024-10-05 07:48 Quote from: ccrause on October 04, 2024, 10:34:23 pmQuote from: znagy on October 04, 2024, 08:27:37 pmHi, may I ask you, does the compiler support placing variables into external RAM, like the EXT_MEM_ATTR in C for ESP32? Thx. 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  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i 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. 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 · 2024-10-07 14:54 Thank you very much, it works perfectly! When declaring the variable in a unit, section '.ext_ram_noinit' can be used. ---------------------------------------------------------------------- ccrause · 2024-10-08 04:53 I'm glad it is working.!