34 views
ago in Getting started by
Hi,

I am trying to run the "Hellow World" example on i.mx6ull based modul

I am using virtual machine (Ubutu 14.04 64-bit). I am trying to compile the generated code from Embedded wizard Studio. make command fails with following errors:

toradex@toradex-VirtualBox:~/IMX6-Software-fbdev/Application/Project$ make
-------------------------------------------------
Creating EmbeddedWizard-Linux
-------------------------------------------------
Compiler Options: cc -c -pipe -MT projectecho -MMD -MP -MF projectecho.d -O2 -Wall -DEW_FRAME_BUFFER_COLOR_FORMAT=EW_FRAME_BUFFER_COLOR_FORMAT_RGBA8888 -DEW_SURFACE_ROTATION=0 -I../Source -I../GeneratedCode -I../../PlatformPackage/RTE -I../../PlatformPackage/RGBA8888 -I../../TargetSpecific -I/usr/include -o projectecho
-------------------------------------------------
Creating object and library directories
-------------------------------------------------
Linking EmbeddedWizard-Linux
cc ./obj/main.o ./obj/ewmain.o ./obj/DeviceDriver.o ./obj/Core.o ./obj/Effects.o ./obj/Graphics.o ./obj/Resources.o ./obj/Views.o ./obj/Application.o ./obj/ewextrte.o ./obj/ewextgfx.o ./obj/ew_bsp_display.o ./obj/ew_bsp_touch.o ./obj/ew_bsp_console.o -L../../PlatformPackage/RTE -L../../PlatformPackage/RGBA8888 -lm -lpthread -lewrte -lewgfx -o ./EmbeddedWizard-Linux
/usr/bin/ld: skipping incompatible ../../PlatformPackage/RTE/libewrte.a when searching for -lewrte
/usr/bin/ld: cannot find -lewrte
/usr/bin/ld: skipping incompatible ../../PlatformPackage/RGBA8888/libewgfx.a when searching for -lewgfx
/usr/bin/ld: cannot find -lewgfx
collect2: error: ld returned 1 exit status
make: *** [EmbeddedWizard-Linux] Error 1
 

I relatively new to Linux and I cannot understand this errors. Could you point me in right direction? How do I fix it?

Best regards,

Taras Chapnyi

1 Answer

0 votes
ago by
Hi Taras,

For me it looks like that you have not sourced the build parameters of your Yocto toolchain as the the output uses CC (which is then the host's gcc) instead of the cross compiler (which should point to something like arm-eabi-...). Hence you are getting the message that the libraries are not compatible. Have you sourced the 'environment-setup'? What result do you get when executing the command 'echo $CROSS_COMPILE' in your shell?

Cheers,
Manuel
ago by

Hi,

I did not source the environment setup. It is working now.

I am trying to test HelloWorld example, but touch does not work. Touchscreen itself works fine. This is my output from "evtest" on target device:

root@colibri-imx6ull:/dev/input# evtest
No device specified, trying to scan all of /dev/input/event*
Available devices:
/dev/input/event0:    AD7879 Touchscreen
Select the device event number [0-0]: 0
Input driver version is 1.0.1
Input device ID: bus 0x18 vendor 0x0 product 0x79 version 0x3
Input device name: "AD7879 Touchscreen"
Supported events:
  Event type 0 (EV_SYN)
  Event type 1 (EV_KEY)
    Event code 330 (BTN_TOUCH)
  Event type 3 (EV_ABS)
    Event code 0 (ABS_X)
      Value   2243
      Min        0
      Max     4095
    Event code 1 (ABS_Y)
      Value   1731
      Min        0
      Max     4095
    Event code 24 (ABS_PRESSURE)
      Value      0
      Min        0
      Max     4096
Properties:
Testing ... (interrupt to exit)
Event: time 1631781570.248159, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1
Event: time 1631781570.248159, type 3 (EV_ABS), code 0 (ABS_X), value 1625
Event: time 1631781570.248159, type 3 (EV_ABS), code 1 (ABS_Y), value 1656
Event: time 1631781570.248159, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 84
Event: time 1631781570.248159, -------------- SYN_REPORT ------------
Event: time 1631781570.260473, type 3 (EV_ABS), code 0 (ABS_X), value 1610
Event: time 1631781570.260473, type 3 (EV_ABS), code 1 (ABS_Y), value 1721
Event: time 1631781570.260473, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 240
Event: time 1631781570.260473, -------------- SYN_REPORT ------------
Event: time 1631781570.273182, type 3 (EV_ABS), code 0 (ABS_X), value 1609
Event: time 1631781570.273182, type 3 (EV_ABS), code 1 (ABS_Y), value 1722
Event: time 1631781570.273182, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 151
Event: time 1631781570.273182, -------------- SYN_REPORT ------------
Event: time 1631781570.285595, type 3 (EV_ABS), code 0 (ABS_X), value 1605
Event: time 1631781570.285595, type 3 (EV_ABS), code 1 (ABS_Y), value 1710
Event: time 1631781570.285595, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 117
Event: time 1631781570.285595, -------------- SYN_REPORT ------------
Event: time 1631781570.298370, type 3 (EV_ABS), code 0 (ABS_X), value 1618
Event: time 1631781570.298370, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 88
Event: time 1631781570.298370, -------------- SYN_REPORT ------------
Event: time 1631781570.310600, type 3 (EV_ABS), code 0 (ABS_X), value 1631
Event: time 1631781570.310600, type 3 (EV_ABS), code 1 (ABS_Y), value 1702
Event: time 1631781570.310600, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 67
Event: time 1631781570.310600, -------------- SYN_REPORT ------------
Event: time 1631781570.323351, type 3 (EV_ABS), code 0 (ABS_X), value 1628
Event: time 1631781570.323351, type 3 (EV_ABS), code 1 (ABS_Y), value 1685
Event: time 1631781570.323351, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 56
Event: time 1631781570.323351, -------------- SYN_REPORT ------------
Event: time 1631781570.335682, type 3 (EV_ABS), code 0 (ABS_X), value 1630
Event: time 1631781570.335682, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 53
Event: time 1631781570.335682, -------------- SYN_REPORT ------------
Event: time 1631781570.348476, type 3 (EV_ABS), code 1 (ABS_Y), value 1690
Event: time 1631781570.348476, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 52
Event: time 1631781570.348476, -------------- SYN_REPORT ------------
Event: time 1631781570.360808, type 3 (EV_ABS), code 1 (ABS_Y), value 1686
Event: time 1631781570.360808, -------------- SYN_REPORT ------------
Event: time 1631781570.373491, type 3 (EV_ABS), code 0 (ABS_X), value 1628
Event: time 1631781570.373491, type 3 (EV_ABS), code 1 (ABS_Y), value 1685
Event: time 1631781570.373491, -------------- SYN_REPORT ------------
Event: time 1631781570.385825, type 3 (EV_ABS), code 0 (ABS_X), value 1634
Event: time 1631781570.385825, type 3 (EV_ABS), code 1 (ABS_Y), value 1690
Event: time 1631781570.385825, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 53
Event: time 1631781570.385825, -------------- SYN_REPORT ------------
Event: time 1631781570.398420, type 3 (EV_ABS), code 0 (ABS_X), value 1628
Event: time 1631781570.398420, type 3 (EV_ABS), code 1 (ABS_Y), value 1682
Event: time 1631781570.398420, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 54
Event: time 1631781570.398420, -------------- SYN_REPORT ------------
Event: time 1631781570.410920, type 3 (EV_ABS), code 0 (ABS_X), value 1629
Event: time 1631781570.410920, type 3 (EV_ABS), code 1 (ABS_Y), value 1684
Event: time 1631781570.410920, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 55
Event: time 1631781570.410920, -------------- SYN_REPORT ------------
Event: time 1631781570.423574, type 3 (EV_ABS), code 0 (ABS_X), value 1626
Event: time 1631781570.423574, type 3 (EV_ABS), code 1 (ABS_Y), value 1685
Event: time 1631781570.423574, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 58
Event: time 1631781570.423574, -------------- SYN_REPORT ------------
Event: time 1631781570.435976, type 3 (EV_ABS), code 0 (ABS_X), value 1625
Event: time 1631781570.435976, type 3 (EV_ABS), code 1 (ABS_Y), value 1683
Event: time 1631781570.435976, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 64
Event: time 1631781570.435976, -------------- SYN_REPORT ------------
Event: time 1631781570.448740, type 3 (EV_ABS), code 0 (ABS_X), value 1620
Event: time 1631781570.448740, type 3 (EV_ABS), code 1 (ABS_Y), value 1660
Event: time 1631781570.448740, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 76
Event: time 1631781570.448740, -------------- SYN_REPORT ------------
Event: time 1631781570.461087, type 3 (EV_ABS), code 0 (ABS_X), value 1595
Event: time 1631781570.461087, type 3 (EV_ABS), code 1 (ABS_Y), value 1632
Event: time 1631781570.461087, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 105
Event: time 1631781570.461087, -------------- SYN_REPORT ------------
Event: time 1631781570.516180, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 0
Event: time 1631781570.516180, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0
Event: time 1631781570.516180, -------------- SYN_REPORT ------------

and this is output of "cat /proc/bus/input/devices"

oot@colibri-imx6ull:/dev/input# cat /proc/bus/input/devices
I: Bus=0018 Vendor=0000 Product=0079 Version=0003
N: Name="AD7879 Touchscreen"
P: Phys=1-002c/input0
S: Sysfs=/devices/soc0/soc/2100000.aips-bus/21a4000.i2c/i2c-1/1-002c/input/input0
U: Uniq=
H: Handlers=event0 
B: PROP=0
B: EV=b
B: KEY=400 0 0 0 0 0 0 0 0 0 0
B: ABS=1000003

Wenn I execute "make install":

toradex@sykam-VirtualBox:~/IMX6-Software-fbdev/Application/Project$ make install
-------------------------------------------------
Creating EmbeddedWizard-Linux
-------------------------------------------------
Compiler Options: arm-poky-linux-gnueabi-gcc -mthumb -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a7 -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/opt/fsl-imx-fb/5.10-hardknott/sysroots/cortexa7t2hf-neon-poky-linux-gnueabi -c -pipe -MT projectecho -MMD -MP -MF projectecho.d -O2 -Wall -DEW_FRAME_BUFFER_COLOR_FORMAT=EW_FRAME_BUFFER_COLOR_FORMAT_RGBA8888 -DEW_SURFACE_ROTATION=0 -I../Source -I../GeneratedCode -I../../PlatformPackage/RTE -I../../PlatformPackage/RGBA8888 -I../../TargetSpecific -I=/usr/include -o projectecho
-------------------------------------------------
Creating object and library directories
-------------------------------------------------
Linking EmbeddedWizard-Linux
arm-poky-linux-gnueabi-gcc -mthumb -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a7 -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/opt/fsl-imx-fb/5.10-hardknott/sysroots/cortexa7t2hf-neon-poky-linux-gnueabi ./obj/main.o ./obj/ewmain.o ./obj/DeviceDriver.o ./obj/Core.o ./obj/Effects.o ./obj/Graphics.o ./obj/Resources.o ./obj/Views.o ./obj/Application.o ./obj/ewextrte.o ./obj/ewextgfx.o ./obj/ew_bsp_display.o ./obj/ew_bsp_touch.o ./obj/ew_bsp_console.o -L../../PlatformPackage/RTE -L../../PlatformPackage/RGBA8888 -lm -lpthread -lewrte -lewgfx -o ./EmbeddedWizard-Linux
EmbeddedWizard-Linux successfully built !!

Script ./run_on_target.sh started ...
downloading EmbeddedWizard-Linux to target 172.16.111.67 using scp ...
EmbeddedWizard-Linux                                                                                                                  100%  410KB   1.1MB/s   00:00    
EmbeddedWizard-Linux successfully downloaded

starting EmbeddedWizard-Linux to target 172.16.111.67 using ssh ...
Initialize Display...                        [OK]
Initialize Touch Driver...                   [failed]
Initialize Memory Manager...                 [OK]
Initialize Graphics Engine...                [OK]
Create Embedded Wizard Root Object...        [OK]
Create Embedded Wizard Viewport...           [OK]
Starting Embedded Wizard main loop - press <p> to shutdown application...
---------------------------------------------
Target system                                i.MX 6 Software fbdev      
Color format                                 RGBA8888      
MemoryPool address                           0x004E02A0  
MemoryPool size                              8388608 bytes
Framebuffer address                          0x76B0C000  
Doublebuffer address                         0x76C38000  
Off-screen buffer                            used    
Display size                                 640 x 480 
Framebuffer size                             640 x 480 
EwScreenSize                                 480 x 272 
Graphics accelerator                         none      
Warp function support                        enabled      
Vector graphics support                      enabled      
Bidirectional text support                   enabled      
Gradients support                            enabled      
Compression support                          enabled      
Index8 bitmap resource format                enabled      
RGB565 bitmap resource format                enabled      
Native bitmap resource format                enabled      
Native destination bitmap support            enabled      
Operating system                             Embedded Linux      
Toolchain                                    GCC      
C-Compiler version                           10.2.0      
Build date and time                          Sep 16 2021, 08:35:29  
Runtime Environment (RTE) version            11.00 
Graphics Engine (GFX) version                11.00 
Max surface cache size                       4194304 bytes
Glyph cache size                             512 x 512 
Max issue tasks                              512      
Surface rotation                             0      
---------------------------------------------
stop
Shutting down Application...                 [OK]
Deinitialize Graphics Engine...              [OK]
Deinitialize Touch Driver...                 [OK]

It says

 Initialize Touch Driver...                  [failed]

but when I do "evtest", touch display responds to my touches. I assume there must be a mismatch somewhere, but I do not know where to look. Could you please tell me what did I miss?

 

Best regards,
Taras Chapnyi

 

ago by
Hi Taras,

Please open the module 'ew_bsp_touch.c' and move the lines #396-#399 before line #391 in order to get further information during the start-up about the touch driver's capabilities. Can you please post them here? For me it seems that the reported values are somehow not valid and thus the initialization fails.

Best regards,
Manuel
ago by
toradex@sykam-VirtualBox:~/IMX6-Software-fbdev/Application/Project$ make install
-------------------------------------------------
Creating EmbeddedWizard-Linux
-------------------------------------------------
Compiler Options: arm-poky-linux-gnueabi-gcc -mthumb -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a7 -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/opt/fsl-imx-fb/5.10-hardknott/sysroots/cortexa7t2hf-neon-poky-linux-gnueabi -c -pipe -MT projectecho -MMD -MP -MF projectecho.d -O2 -Wall -DEW_FRAME_BUFFER_COLOR_FORMAT=EW_FRAME_BUFFER_COLOR_FORMAT_RGBA8888 -DEW_SURFACE_ROTATION=0 -I../Source -I../GeneratedCode -I../../PlatformPackage/RTE -I../../PlatformPackage/RGBA8888 -I../../TargetSpecific -I=/usr/include -o projectecho
-------------------------------------------------
Creating object and library directories
-------------------------------------------------
Linking EmbeddedWizard-Linux
arm-poky-linux-gnueabi-gcc -mthumb -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a7 -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/opt/fsl-imx-fb/5.10-hardknott/sysroots/cortexa7t2hf-neon-poky-linux-gnueabi ./obj/main.o ./obj/ewmain.o ./obj/DeviceDriver.o ./obj/Core.o ./obj/Effects.o ./obj/Graphics.o ./obj/Resources.o ./obj/Views.o ./obj/Application.o ./obj/ewextrte.o ./obj/ewextgfx.o ./obj/ew_bsp_display.o ./obj/ew_bsp_touch.o ./obj/ew_bsp_console.o -L../../PlatformPackage/RTE -L../../PlatformPackage/RGBA8888 -lm -lpthread -lewrte -lewgfx -o ./EmbeddedWizard-Linux
EmbeddedWizard-Linux successfully built !!

Script ./run_on_target.sh started ...
downloading EmbeddedWizard-Linux to target 172.16.111.67 using scp ...
EmbeddedWizard-Linux                                                                                                                  100%  410KB   1.1MB/s   00:00    
EmbeddedWizard-Linux successfully downloaded

starting EmbeddedWizard-Linux to target 172.16.111.67 using ssh ...
Initialize Display...                        [OK]
Initialize Touch Driver...                   
EwBspTouchInit: Using input device '/dev/input/event0'
EwBspTouchInit: Using TouchArea 0, 0 - 0, 0
EwBspTouchInit: MultiTouchMode: yes
[failed]
Initialize Memory Manager...                 [OK]
Initialize Graphics Engine...                [OK]
Create Embedded Wizard Root Object...        [OK]
Create Embedded Wizard Viewport...           [OK]
Starting Embedded Wizard main loop - press <p> to shutdown application...
---------------------------------------------
Target system                                i.MX 6 Software fbdev      
Color format                                 RGBA8888      
MemoryPool address                           0x004932A0  
MemoryPool size                              8388608 bytes
Framebuffer address                          0x76AF3000  
Doublebuffer address                         0x76C1F000  
Off-screen buffer                            used    
Display size                                 640 x 480 
Framebuffer size                             640 x 480 
EwScreenSize                                 480 x 272 
Graphics accelerator                         none      
Warp function support                        enabled      
Vector graphics support                      enabled      
Bidirectional text support                   enabled      
Gradients support                            enabled      
Compression support                          enabled      
Index8 bitmap resource format                enabled      
RGB565 bitmap resource format                enabled      
Native bitmap resource format                enabled      
Native destination bitmap support            enabled      
Operating system                             Embedded Linux      
Toolchain                                    GCC      
C-Compiler version                           10.2.0      
Build date and time                          Sep 16 2021, 10:10:09  
Runtime Environment (RTE) version            11.00 
Graphics Engine (GFX) version                11.00 
Max surface cache size                       4194304 bytes
Glyph cache size                             512 x 512 
Max issue tasks                              512      
Surface rotation                             0      
---------------------------------------------

 

 

ago by

Hi Taras,

It seems that your touch driver reports to be capable of processing multi touch events, but the corresponding values do not match accordingly. Hence can you please adapt the function GetTouchArea() in the same module as following:

/* Helper function to determine the touch area (minX, minY, maxX, maxY) from the touch device */
static int GetTouchArea( int aFileDesc )
{
  struct input_absinfo absinfo;

  if ( ioctl( aFileDesc, EVIOCGABS( ABS_X ), &absinfo ) >= 0 )
  {
    TouchAreaMinX = absinfo.minimum;
    TouchAreaMaxX = absinfo.maximum;
    IsMultiTouch = 0;
  }
  else
    return 0;

  /* try to get min/max values of touch area in Y direction from touch device */
  if ( ioctl( aFileDesc, EVIOCGABS( ABS_Y ), &absinfo ) >= 0 )
  {
    TouchAreaMinY = absinfo.minimum;
    TouchAreaMaxY = absinfo.maximum;
  }
  else
    return 0;

  return 1;
}

Please let me know if it works...

Best regards,
Manuel

ago by
Hi,

Thank you, it works now.

For some reason touch coordinates on Y axis are inverted. Cursor moves in the opposite direction of my finger movement, but only in Y axis. It was easy to fix though in ew_bsp_touvh.c. I assume that Wizard Studio settings can be adjusted for every display, right? So that my generated c code has correct settings for X,Y coordinates.

I have tested the 480x272 HelloWorld example on 7 inch display, the scaling seams to be a little bit of. As I move my finger from left to right, the cursor falls behind further and further. But it should work fine if display size is 1 to 1 with GUI window size, correct?

Best regards,

Taras
ago by
Hello Taras,

the Embedded Wizard GUI application expects the touch coordinates as GUI coordinates. There is no remapping or scaling of touch coordinates within Embedded Wizard.

If the application is 480x272 and your display / framebuffer is 600x480, the GUI application should appear without scaling. When you touch on the top left corner of the GUI application then the position <0,0> should be provided to the GUI application and when you touch on the bottom right corner of the GUI application (not the screen), then the position <479,271> should be provided.

All the mapping is handled within the module ew_bsp_touch.c.

Within the file ewconfig.h you will find the following defines:

// #define EW_PRINT_TOUCH_DATA
// #define EW_PRINT_TOUCH_EVENTS

You can activate them and see what coordinates are reported from the touch driver and what touch events are provided to the GUI application.

Btw: The example ScreenOrientation is very helpful to analyze and calibrate the touch device.

Best regards,

Manfred.

Embedded Wizard Website | Privacy Policy | Imprint

...