cancel
Showing results for 
Search instead for 
Did you mean: 

Run TouchGFX SDL2 Simulator on Yocto Linux

LHege.1
Associate III

Hi There,

I have a unusual question. We would like to use TouchGFX to design a simple GUI for a Yocto SOM Board an tried to cross compile a trial project. Compiling fails at linking because the touchgfx library libtouchgfx.a is not compatible.

So my question is. Has anyone tried something like this? Is it not recommended because of some reasons?

Kind Regards

Lukas

8 REPLIES 8
MM..1
Chief II

Designer not work under linux then for what simulator? Why not direct debug onboard?

LHege.1
Associate III

What do you mean with debug onboard? The generated designer code compiles and runs perfectly under linux: Prerequisites | TouchGFX Documentation.

The problem is that I cannot cross compile it for Yocto, so I cannot debug or run the code on the SOM board. @TouchGFX Team did you ever do something like this?

Maybe you omit change path to lib, in midleware you have a file for arm linux win .... yuo need change to linux
and yocto must be x64.
$ readelf -a Middlewares/ST/touchgfx/lib/linux/libtouchgfx.a |head -n 20
File: libtouchgfx.a(AbstractPartition.o)
ELF Header:
Magic: 7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00
Class: ELF64
Data: 2's complement, little endian
Version: 1 (current)
OS/ABI: UNIX - System V
ABI Version: 0
Type: REL (Relocatable file)
Machine: Advanced Micro Devices X86-64
Version: 0x1
Entry point address: 0x0
Start of program headers: 0 (bytes into file)
Start of section headers: 4320 (bytes into file)
Flags: 0x0
Size of this header: 64 (bytes)
Size of program headers: 0 (bytes)
Number of program headers: 0
Size of section headers: 64 (bytes)
Number of section headers: 23
Section header string table index: 20
LHege.1
Associate III

Thanks for the quick answer. I did check the library and got the same output as you. I do take this library but when I compile with:

x86_64-fslcsdk-linux/usr/bin/aarch64-fslc-linux/aarch64-fslc-linux-g++ 

I get these linking errors:

.../libexec/aarch64-fslc-linux/gcc/aarch64-fslc-linux/9.3.0/real-ld: cannot find -ltouchgfx
../libexec/aarch64-fslc-linux/gcc/aarch64-fslc-linux/9.3.0/real-ld: cannot find -lSDL2
../libexec/aarch64-fslc-linux/gcc/aarch64-fslc-linux/9.3.0/real-ld: cannot find -lSDL2_image
../libexec/aarch64-fslc-linux/gcc/aarch64-fslc-linux/9.3.0/real-ld: skipping incompatible touchgfx/3rdparty/libjpeg/lib/linux/libjpeg.a when searching for -ljpeg

 I dont get why it should not be compatible. Any ideas?

first 3 is about bad path to library search

last skipp is for libjpeg.a why mut check yuo

LHege.1
Associate III

You are right, but I forgot to post the most important warning:

../libexec/aarch64-fslc-linux/gcc/aarch64-fslc-linux/9.3.0/real-ld: skipping incompatible touchgfx/lib/linux/libtouchgfx.a when searching for -ltouchgfx

This is not because of wrong path, it skipps the library because of compatibility. Do you have any idea if this can be fixed?

If I compare the readelf of a successfully compiled program for yocto I see one diffecence to the touchgfx:

Class:                             ELF64
  Data:                              2's complement, little endian
  Version:                           1 (current)
  OS/ABI:                            UNIX - System V
  ABI Version:                       0
  Type:                              DYN (Shared object file)
  Machine:                           AArch64
  Version:                           0x1
  Entry point address:               0x9a0

The Machine Type is AArch64. Does that cause the incompatibility?

I mean you try simulate on Yocto display when yocto is Intel/AMD x64 = lib in linux folder.
But you build with aarch = ARM64 ( if your yocto is on ARM ok ) but then you need lib for ARM64
LHege.1
Associate III

Yes I need the touchgfx library for AARCH64. Is it possible to get this from @Touchgfx Team?