Recent

Author Topic: Setting up Xtensa-FreeRTOS for ESP8266  (Read 21262 times)

ccrause

  • Hero Member
  • *****
  • Posts: 668
Re: Setting up Xtensa-FreeRTOS for ESP8266
« Reply #45 on: August 19, 2022, 07:44:47 am »
at which folder of this fpc.cfg must be change? i already to include that containing folder via project option but no luck  :)

Looking at your fpc.cfg for LX6 shows some missing entries.  Here is my fpc.cfg, generated by fpcupdeluxe (development version) on Linux (which does work):
Code: Text  [Select][+][-]
  1. # begin fpcup do not remove xtensa-freertos
  2. # Inserted by fpcup 18-8-22 07:24:59
  3. # Cross compile settings dependent on both target OS and target CPU
  4. #IFDEF FPC_CROSSCOMPILING
  5. #IFDEF FREERTOS
  6. #IFDEF CPUXTENSA
  7. #IFDEF CPULX6
  8. -Cfhard
  9. -FD/home/christo/fpcupdeluxe/working/cross/bin/xtensa-freertos/bin/
  10. -XPxtensa-esp32-elf-
  11. -Wpesp32
  12. -Ff/home/christo/fpcupdeluxe/working/cross/bin/xtensa-freertos/esp-idf-4.3.2
  13. -Fl/home/christo/fpcupdeluxe/working/cross/bin/xtensa-freertos/esp-idf-4.3.2/components/esp_rom/esp32/ld/
  14. -Fl/home/christo/fpcupdeluxe/working/cross/bin/xtensa-freertos/esp-idf-4.3.2/components/esp32/ld/
  15. -Fl/home/christo/fpcupdeluxe/working/cross/lib/xtensa-freertos/lx6/
  16. -WP4.3.2
  17. #ENDIF CPULX6

The missing entries in your config seem to refer to cross\bin\xtensa-freertos\esp-idf-4.3.2/.  Can you confirm that this folder exists in your fpcupdeluxe folder?

As far as I know the precompiled libraries for esp-idf is not available on Windows, see this post.  The reason is that the current script used to automatically generate the SDK snapshots are POSIX (Linux/MacOS) specific.

Mongkey

  • Sr. Member
  • ****
  • Posts: 278
Re: Setting up Xtensa-FreeRTOS for ESP8266
« Reply #46 on: August 19, 2022, 12:02:46 pm »
the folder no exists -> cross\bin\xtensa-freertos\esp-idf-4.3.2/ .
i included from Fl project option, got bad value.

ccrause

  • Hero Member
  • *****
  • Posts: 668
Re: Setting up Xtensa-FreeRTOS for ESP8266
« Reply #47 on: August 19, 2022, 12:31:46 pm »
the folder no exists -> cross\bin\xtensa-freertos\esp-idf-4.3.2/ .

I will try to build a Windows snapshot of esp-idf this weekend.  This will take a while, since I mainly work on Linux.  The Windows PC I have access to is old and slow...

Mongkey

  • Sr. Member
  • ****
  • Posts: 278
Re: Setting up Xtensa-FreeRTOS for ESP8266
« Reply #48 on: August 19, 2022, 01:13:56 pm »
Thank you, ccrause. i built a lot esp based project but using c++, i did not know if got fpc-idf, i hope i could replace my c++ esp code with pascal soon.

I already tried pi pico on fpc, it has good hex size compared to arduino based.
« Last Edit: August 19, 2022, 01:18:06 pm by Mongkey »

ccrause

  • Hero Member
  • *****
  • Posts: 668
Re: Setting up Xtensa-FreeRTOS for ESP8266
« Reply #49 on: August 20, 2022, 11:01:30 pm »
As a start, you can install esp-idf following these instructions. For now select esp-idf version 4.3.3, this is virtually the same as v 4.3.2 tested with fpcupdeluxe.  The newer release 4.4 should also work, but was not tested as much.

Then build the blink example in the esp-idf/examples/get-started/blink for esp32, starting with one of the preconfigured ESP-IDF 4.3 CMD or ESP-IDF 4.3 PowerShell shortcuts to configure the environment. Use the build command idf.py build.

Copy all the libraries in the examples\get-started\blink\build\esp-idf  folder into a separate blink\build\libs folder (an easy way is to open the blink\build\esp-idf folder in file explorer, search for *.a, copy the search results into a folder named blink\build\libs).

Also copy the following files (used later to flash the bootloader and flash partition scheme) into libs:
blink\build\bootloader\bootloader.bin
blink\build\partition_table\partition-table.bin

And these files to libs:
blink\build\esp-idf\esp32\esp32_out.ld
blink\build\esp-idf\esp32\ld\esp32.project.ld
blink\build\config\sdkconfig.h

Copy other libraries from the esp-idf\components folder (for my install settings : C:\Espressif\frameworks\esp-idf-v4.3.3\components) to libs:
components\esp_wifi\lib\esp32\*.a
components\xtensa\esp32\libxt_hal.a

Now modify the CPULX6 section in fpc.cfg to point to this new libs folder.  Also change some other settings to point to the Espressif installed bin tools and point the compiler to the esp-idf folder:
Code: Text  [Select][+][-]
  1. #IFDEF CPULX6
  2. -Cfhard
  3. -FDC:\Espressif\tools\xtensa-esp32-elf\esp-2021r2-patch3-8.4.0\xtensa-esp32-elf\bin
  4. -XPxtensa-esp32-elf-
  5. -Wpesp32
  6. -FlC:\fpcupdeluxe\cross\lib\xtensa-freertos\lx6\
  7. -WP4.3.3
  8.  
  9. # Library paths to GCC supplied libraries
  10. -FlC:\Espressif\tools\xtensa-esp32-elf\esp-2021r2-patch3-8.4.0\xtensa-esp32-elf\lib\gcc\xtensa-esp32-elf\8.4.0\no-rtti
  11. -FlC:\Espressif\tools\xtensa-esp32-elf\esp-2021r2-patch3-8.4.0\xtensa-esp32-elf\xtensa-esp32-elf\lib\no-rtti
  12.  
  13. # Custom folder with esp-idf libs
  14. -FlC:\Espressif\frameworks\esp-idf-v4.3.3\examples\get-started\blink\build\libs
  15.  
  16. # Set path to esp-idf root
  17. -FfC:\Espressif\frameworks\esp-idf-v4.3.3
  18. #ENDIF CPULX6

Note that these folders are specific to my esp-idf installation, adjust as necessary for your installation.

This is obviously a lot of work and easy to miss a file required for successful compilation and linking in FPC.  I am busy writing a batch script to automate this process and build a release that can be installed by fpcupdeluxe, but it will be a couple of days to get all of this sorted out.

Mongkey

  • Sr. Member
  • ****
  • Posts: 278
Re: Setting up Xtensa-FreeRTOS for ESP8266
« Reply #50 on: August 23, 2022, 02:59:08 am »
OK and thank you for your time replying this thread, soon i would report my progress here.  :D

ccrause

  • Hero Member
  • *****
  • Posts: 668
Re: Setting up Xtensa-FreeRTOS for ESP8266
« Reply #51 on: August 28, 2022, 01:33:11 pm »
You can download a snapshot of esp-idf v4.3.3 here: https://github.com/ccrause/fpc-esp-freertos/raw/master/snapshot/esp-idf-4.3.3-win64-20220828.zip

Please follow the instructions in the included README file to update an xtensa-freertos installation by fpcupdeluxe.  Good luck, and please give feedback, if this snapshot is working I can ask that this is included in newer versions of fpcupdeluxe.

Mongkey

  • Sr. Member
  • ****
  • Posts: 278
Re: Setting up Xtensa-FreeRTOS for ESP8266
« Reply #52 on: September 03, 2022, 01:00:50 am »
i surrender  :D, c++ is more easy  :D

This one is example of my hardware developed with c++ esp based, and for the android client using fpc-LAMW

ccrause

  • Hero Member
  • *****
  • Posts: 668
Re: Setting up Xtensa-FreeRTOS for ESP8266
« Reply #53 on: September 03, 2022, 07:42:27 am »
i surrender  :D, c++ is more easy  :D
Do you mean C++ is easier to program in, or that using the native esp-idf build environment is easier to use?  I guess it is the latter case, else you wouldn't have used LAMW for the Android app?

Have you tried the esp-idf library snapshot in my previous post?

Mongkey

  • Sr. Member
  • ****
  • Posts: 278
Re: Setting up Xtensa-FreeRTOS for ESP8266
« Reply #54 on: September 03, 2022, 08:49:40 am »
I already test, but not succed, c++ is easy because a lots contributor n examples + easy environment, pascal not easy in setting up environment, if were ready to use lazarus IDE packed with ready to use environment would be much easier for noobie like me. This situation is just like first time LAMW launch, no one succed to use it, but now just got better n better.
« Last Edit: September 03, 2022, 09:10:07 am by Mongkey »

Mongkey

  • Sr. Member
  • ****
  • Posts: 278
Re: Setting up Xtensa-FreeRTOS for ESP8266
« Reply #55 on: October 01, 2022, 08:26:24 am »
Hello friend, i go this message on my newly updated ubuntu, on ubuntu 18 libgc 2.6 cannot be installed so i upgraded my linux and got this message:
refreshing outdated venv, if you see this on every compile then create an issue on https://github.com/michael-ring/espsdk4fpc/issues

env. ubuntu 20, pip already install but cannot detect.

Thank you.

ccrause

  • Hero Member
  • *****
  • Posts: 668
Re: Setting up Xtensa-FreeRTOS for ESP8266
« Reply #56 on: October 01, 2022, 08:36:54 am »
Hello friend, i go this message on my newly updated ubuntu, on ubuntu 18 libgc 2.6 cannot be installed so i upgraded my linux and got this message:
refreshing outdated venv, if you see this on every compile then create an issue on https://github.com/michael-ring/espsdk4fpc/issues

env. ubuntu 20, pip already install but cannot detect.

Thank you.
It is possible that some of the required python packages were not installed or at an older version, so it may update on first compile.  Do you see the message one every compile? 

Also can you copy the whole message, including the python/pip related output?

Mongkey

  • Sr. Member
  • ****
  • Posts: 278
Re: Setting up Xtensa-FreeRTOS for ESP8266
« Reply #57 on: October 01, 2022, 11:38:24 am »
Hello friend, i go this message on my newly updated ubuntu, on ubuntu 18 libgc 2.6 cannot be installed so i upgraded my linux and got this message:
refreshing outdated venv, if you see this on every compile then create an issue on https://github.com/michael-ring/espsdk4fpc/issues

env. ubuntu 20, pip already install but cannot detect.

Thank you.
It is possible that some of the required python packages were not installed or at an older version, so it may update on first compile.  Do you see the message one every compile? 

Also can you copy the whole message, including the python/pip related output?

i thought this was because of libgc 2.65, i upgraded all my ubuntu from 18 to 20, tried installing new lazarus + new cross + subarchs, arm + avr are OK but i got this on extensa:

this are my 6th install for this day, and has no luck  %), may be windows are my best friend for mcu programming.

Code: Pascal  [Select][+][-]
  1. Going to install a cross-compiler from available sources.
  2. Fpcupdeluxe: FPC cross-builder: Building compiler for freertos-xtensa [CROSSOPT: -Cfhard] {SUBARCH: lx6}.
  3. FPCUP(deluxe) is starting up.
  4.  
  5. FPCupdeluxe basedir:       /home/ubuntu/fpcupdeluxe
  6. Bootstrap dir:             /home/ubuntu/fpcupdeluxe/fpcbootstrap
  7.  
  8. FPC URL:                   https://gitlab.com/freepascal.org/fpc/source
  9. FPC source directory:      /home/ubuntu/fpcupdeluxe/fpcsrc
  10. FPC install directory:     /home/ubuntu/fpcupdeluxe/fpc
  11. FPC options:              
  12.  
  13. Lazarus URL:               https://gitlab.com/freepascal.org/lazarus/lazarus
  14. Lazarus source directory:  /home/ubuntu/fpcupdeluxe/lazarus
  15. Lazarus install directory: /home/ubuntu/fpcupdeluxe/lazarus
  16. Lazarus options:           -g -gl -O1
  17.  
  18. Please stand back and enjoy !
  19.  
  20. 1-10-22 16:35:46: fpcupdeluxe: V438 (20220928) started.
  21. FPCUPdeluxe V2.2.0m for x86_64-linux running on Ubuntu
  22. Build with: FPC 3.2.2 on Win10 x86_64
  23.  
  24. Found valid as application.
  25. Found valid gunzip application.
  26. Found valid tar application.
  27. Found valid make application.
  28. fpcupdeluxe: info: FPCCrossInstaller (CleanModule: FPC): Running make compiler_distclean,rtl_distclean twice for target xtensa-freertos
  29. fpcupdeluxe: Executing: /usr/bin/make FPC=/home/ubuntu/fpcupdeluxe/fpc/bin/x86_64-linux/ppcx64 --directory=/home/ubuntu/fpcupdeluxe/fpcsrc FPCMAKE=/home/ubuntu/fpcupdeluxe/fpc/bin/x86_64-linux/fpcmake PPUMOVE=/home/ubuntu/fpcupdeluxe/fpc/bin/x86_64-linux/ppumove FPCDIR=/home/ubuntu/fpcupdeluxe/fpcsrc PREFIX=/home/ubuntu/fpcupdeluxe/fpc INSTALL_PREFIX=/home/ubuntu/fpcupdeluxe/fpc INSTALL_BINDIR=/home/ubuntu/fpcupdeluxe/fpc/bin/x86_64-linux OS_TARGET=freertos CPU_TARGET=xtensa SUBARCH=lx6 compiler_distclean rtl_distclean (working dir: /home/ubuntu/fpcupdeluxe/fpcsrc)
  30. Makefile:215: *** The Makefile doesn't support target xtensa-freertos, please run fpcmake first.  Stop.
  31.  
  32.  
  33. ERROR: Fpcupdeluxe fatal error !
  34. Sequencer (FPCCleanBuildOnly): Failure running fpcupdeluxe: error executing sequence FPCCleanBuildOnly
  35. Sequencer (Only): Failure running fpcupdeluxe: error executing sequence Only
  36. Building cross-tools failed. Aborting.
  37.  
« Last Edit: October 01, 2022, 11:44:27 am by Mongkey »

ccrause

  • Hero Member
  • *****
  • Posts: 668
Re: Setting up Xtensa-FreeRTOS for ESP8266
« Reply #58 on: October 01, 2022, 01:06:27 pm »
Code: Pascal  [Select][+][-]
  1. Makefile:215: *** The Makefile doesn't support target xtensa-freertos, please run fpcmake first.  Stop.
Did you select trunk for the FPC version on the Basic tab of fpcupdeluxe?  Xtensa-freertos is only supported in trunk (also called main).

Mongkey

  • Sr. Member
  • ****
  • Posts: 278
Re: Setting up Xtensa-FreeRTOS for ESP8266
« Reply #59 on: October 02, 2022, 03:03:41 am »
Code: Pascal  [Select][+][-]
  1. Makefile:215: *** The Makefile doesn't support target xtensa-freertos, please run fpcmake first.  Stop.
Did you select trunk for the FPC version on the Basic tab of fpcupdeluxe?  Xtensa-freertos is only supported in trunk (also called main).

i used stable one, let me try get ride fpc linux extesa once again this day  :o

 

TinyPortal © 2005-2018