[fpc-devel] Problems building xtensa-freertos RTL in trunk

Florian Klämpfl florian at freepascal.org
Sat Apr 4 19:44:41 CEST 2020


Am 04.04.20 um 16:06 schrieb Christo Crause via fpc-devel:
> I'm keen to test the xtensa-freertos target, but it seems there are a 
> couple of patches missing from trunk.
> 
> It is possible to build an xtensa cross compiler, but the make files 
> doesn't know the xtensa-freertos target. To get the make files in rtl  
> updated, one needs to rebuild fpcmake, edit rtl/MakeFile.fpc and add 
> "dirs_freertos=freertos" to the target list, then run fpcmake. At this 
> point the the following make command proceeds up to sysutils:
> make rtl FPC=~/fpc/3.3.1/compiler/ppcrossxtensa CPU_TARGET=xtensa 
> OS_TARGET=freertos BINUTILSPREFIX=xtensa-esp32-elf-
> 
> where the following errors crop up:
> syssbh.inc(43,41) Error: Identifier not found "Double"
> syssbh.inc(49,41) Error: Identifier not found "Single" etc.
> 
> I trust someone (Florian...) has a working build?
> 

I sent Michael recently some instructions but I am not sure if they are 
still working. As Pierre got qemu-xtensa working I am pushing the linux 
port so we can test more easily the compiler.

- install esp-idf and execute
   source ~/eps/esp-idf/export.sh
   to get the pathes and environment set (namely tools path and 
$IDF_PATH are needed)
- use the lazarus project fpc/compiler/ppcxtens.lpt to build an xtensa 
compiler
- build the rtl (breaks currently at sysutils, doesn't matter):
cd rtl/freertos
make FPC=../../compiler/xtensa/pp  OS_TARGET=freertos "OPT=-Cplx6 
-Cawindowed -XPxtensa-esp32-elf-" clean all
- build the example hello world program from the esp-idf, copy all 
generated .a into e.g. ~/xtensa-esp32-elf-libs
- create somewhere a hello world program, compile it with
fpc/compiler/xtensa/pp -Fu../rtl/units/xtensa-freertos/ -Tfreertos 
-Cawindowed -XPxtensa-esp32-elf- -al -O3 -Wpesp32 
-Fl~/xtensa-esp32-elf-libs 
-Fl$HOME/.espressif/tools/xtensa-esp32-elf/esp-2019r2-8.2.0/xtensa-esp32-elf/xtensa-esp32-elf/lib/ 
hello
- get partition-table.bin and bootloader.bin from the hello_world 
example compiled above and copy them into the same dir as the compiled 
hello.bin
- flash with
esptool.py -p /dev/ttyUSB0 -b 460800 --before default_reset --after 
hard_reset --chip esp32  write_flash --flash_mode dio --flash_size 
detect --flash_freq 40m 0x1000 bootloader.bin 0x8000 partition-table.bin 
0x10000 hello.bin
- monitor the output with:
idf_monitor.py  --port /dev/ttyUSB0 hello.elf



More information about the fpc-devel mailing list