Code Monkey home page Code Monkey logo

lv_port_linux_frame_buffer's Introduction

LVGL on top of Linux graphics stack

Example project to use LVGL on top of Linux graphics stack. Currently supported backends are either legacy framebuffer (fbdev), modern DRM/KMS, or SDL2.

By default, legacy framebuffer backend uses /dev/fb0 device node, DRM/KMS backend uses '/dev/dri/card0' card node, SDL2 uses window resolution of 800x480.

Check out this blog post for a step by step tutorial: https://blog.lvgl.io/2018-01-03/linux_fb

Clone the project

Clone the LVGL Framebuffer Demo project and its related sub modules.

git clone https://github.com/lvgl/lv_port_linux_frame_buffer.git
cd lv_port_linux_frame_buffer/
git submodule update --init --recursive

Select graphics backend (optional)

To use legacy framebuffer (fbdev) support, adjust lv_conf.h as follows:

#define LV_USE_LINUX_FBDEV	1
#define LV_USE_LINUX_DRM	0
#define LV_USE_SDL		0

To use modern DRM/KMS support, adjust lv_conf.h as follows:

#define LV_USE_LINUX_FBDEV	0
#define LV_USE_LINUX_DRM	1
#define LV_USE_SDL		0

To use SDL2 support, adjust lv_conf.h as follows:

#define LV_USE_LINUX_FBDEV	0
#define LV_USE_LINUX_DRM	0
#define LV_USE_SDL		1

Build the project

mkdir build
cd build 
cmake ..
make -j

Environment variables

Environment variables can be set to modify behavior of the demo. The following variables are supported.

Legacy framebuffer (fbdev)

  • LV_LINUX_FBDEV_DEVICE - override default (/dev/fb0) framebuffer device node.

DRM/KMS

  • LV_LINUX_DRM_CARD - override default (/dev/dri/card0) card.

SDL2

  • LV_SDL_VIDEO_WIDTH - width of SDL2 surface (default 800).
  • LV_SDL_VIDEO_HEIGHT - height of SDL2 surface (default 480).

Run the demo application

As root

Normal users don't have access to /dev/fb0 so use sudo (or see below) :

cd ../bin
sudo main

Userland

You can give a normal user access to the framebuffer by adding them to the video group :

sudo adduser $USER video
newgrp video
cd ../bin
./main

Notes

  • The Makefile is broken right now, so Cmake shall be used.

lv_port_linux_frame_buffer's People

Contributors

arthurlutz avatar embeddedt avatar embetrix avatar johennes avatar kisvegabor avatar kraj avatar marex avatar mculover666 avatar nixgnauhcuy avatar pmp-p avatar shuai132 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lv_port_linux_frame_buffer's Issues

Alpha Blending in Wayland

Capture

Below is the original background of Sticky Notes
Yellow-Sticky-Note-PNG-HD-Image

The shadow of border is wrong using the latest source repository.

void lv_example_sticky_notes(void)
{
LV_IMG_DECLARE(img_sticky_notes_png);

lv_obj_t *central = lv_scr_act();
lv_obj_set_style_bg_opa(central, LV_OPA_TRANSP, 0);

lv_obj_t *img = lv_img_create(central);
lv_img_set_src(img, &img_sticky_notes_png);
lv_img_set_antialias(img, true);
lv_obj_center(img);

lv_obj_t *label1 = lv_label_create(img);
lv_label_set_long_mode(label1, LV_LABEL_LONG_WRAP);     /*Break the long lines*/
lv_label_set_recolor(label1, true);                      /*Enable re-coloring by commands in the text*/
lv_label_set_text(label1, "#ff0000 Sticky Notes# is a borderless Wayland client developed by LVGL with Wayland backend. "
                  "\n\n #0000ff Wayland# on embedded SBC board, brought to you by LVGL.");
lv_obj_set_width(label1, 200);  /*Set smaller width to make the lines wrap*/
lv_obj_set_style_text_align(label1, LV_TEXT_ALIGN_CENTER, 0);
lv_obj_align(label1, LV_ALIGN_CENTER, 0, -40);

}

How to implement a right-angled box through lv_obj

I need to implement a gui on my arm device LCD, but there seems to be no api to implement a rectangle, only a round box generated by lvobj_create, how do I go about it.
Another question, how can I make my program smoother and silky smooth if I run it on an embedded android device
Thanks to the developer

Strange error message on when excute the demo program on ARM

As title, my platform is ARM Cortex-A7 IMX6UL, OS is buildroot.
I compile success using cross-compile already, seems no any trouble.

BUT it shows the error message when I running this demo:
./demo: line 1: ELF����: not found
./demo: line 9: syntax error: unexpected "("

I think my cross-compile is no problem, I tried it on previous littlevgl demo before ( no lv_linux_frame_buffer repo in that time), hope can get some directions, thanks a lot.

sos

dear create:

the lvgl8 it's can't working for linux frame buffer device right? i mean it's can run for 1920x1080 ?
because if set disp_drv.hor and ver to 1920x1080 . the lv_demo_widgets will confusion. but set back to 800x480 will run success .
why? how can i change to 1920x1080 ?

How to add nativeapp to Cmakelist?

.
├── bin
│   └── main
├── build
│   ├── CMakeCache.txt
│   ├── CMakeFiles
│   ├── cmake_install.cmake
│   ├── lib
│   ├── lvgl
│   └── Makefile
├── CMakeLists.txt
├── custom
│   ├── custom.c
│   ├── custom.h
│   ├── custom.mk
│   ├── custom.py
│   ├── lv_conf_ext.h
│   ├── mp1544294806.png
│   ├── mp-1789058473.png
│   ├── spectrum_1.h
│   ├── spectrum_2.h
│   └── spectrum_3.h
├── generated
│   ├── events_init.c
│   ├── events_init.h
│   ├── generated.mk
│   ├── guider_customer_fonts
│   ├── guider_fonts
│   ├── gui_guider.c
│   ├── gui_guider.h
│   ├── images
│   └── setup_scr_screen.c
├── include
│   ├── include.mk
│   ├── lvgl_config.h
│   └── lvgl_utils.h
├── LICENSE
├── lv_conf.h
├── lvgl
│   ├── CMakeLists.txt
│   ├── component.mk
│   ├── demos
│   ├── docs
│   ├── env_support
│   ├── examples
│   ├── idf_component.yml
│   ├── Kconfig
│   ├── library.json
│   ├── library.properties
│   ├── LICENCE.txt
│   ├── lv_conf_template.h
│   ├── lvgl.h
│   ├── lvgl.mk
│   ├── lvgl.pc.in
│   ├── README.md
│   ├── SConscript
│   ├── scripts
│   ├── src
│   └── tests
├── main.c
├── Makefile
├── README.md
└── source
    └── source.mk

here ,i wanna to add custom/generated files to cmakelist for complaier,but not know how to edit it.

Segmentation fault when running demo app with rotation of LV_DISP_ROT_270

Hello.
I have make the lvgl demo work on my raspberrypi CM4 module.
When I rotate the app for 0 or 180 degrees.It works fine. But when I rotate it for 90 or 270 degrees.It break when I touch some place of the touch panel.
the log shows:"Segmentation fault"

I also have done some debug work for it.I find that when the error happens. The log int drm_flush shows that the value of w is
negative.

Is there anyway I can fix this error?
I will be appreciated if someone can help me out.

Add support for keyboard/mouse

Is it possible to use the keyboard/mouse when running this demo? Currently this does not seem to be the case.

Adding rudimentary keyboard support might not be too hard as one can just read from stdin (or use termios to not wait for Enter). Mouse support might be harder but should also be possible using /dev/input/mouse or similar.

Using 3rd-party lib qr-code shows "undefined reference"-error

I am trying to use the qr-code feature with this template for the fb0 in c and i activated this feature in the lv_conf.h. When i am using some qr-related functions like lv_qrcode_create() i get an "undefined reference"-error while compiling with make. When i am clicking on the function my IDE finds the correct file in src/libs/qrcode.

Thank you very much in advance and with best regards,

Chris

evdev_read callback denies non-zero ABS_MT_TRACKING_ID in touchscreen.

Sorry for my english first because english is not my first language :(
I'm new in embedded part, and also new in LVGL. Not that old in programming, actually.
I've tried to write simple sample code that rotates image with screen touch, but it doesn't work after first touch.
Plus, it doesn't work at all if I touch screen before app starts.
So I assumed it my code's problem, and uploaded to my board demo app already exists - but it also have same symptom.
I tried to debug as insert printf() at many points, and I found these lines in evdev.c. (152 - 157)

            else if(in.code == ABS_MT_TRACKING_ID) {
                                if(in.value == -1)
                                    evdev_button = LV_INDEV_STATE_REL;
                                else if(in.value == 0)
                                    evdev_button = LV_INDEV_STATE_PR;
            }

So I searched linux documents about that flag, and found this section. Multi-touch Protocol, 3.2. Protocol Usage.

For type B devices, the kernel driver should associate a slot with each identified contact, and use that slot to propagate changes for the contact. Creation, replacement and destruction of contacts is achieved by modifying the ABS_MT_TRACKING_ID of the associated slot. A non-negative tracking id is interpreted as a contact, and the value -1 denotes an unused slot. A tracking id not previously present is considered new, and a tracking id no longer present is considered removed. Since only changes are propagated, the full state of each initiated contact has to reside in the receiving end. Upon receiving an MT event, one simply updates the appropriate attribute of the current slot.

Some devices identify and/or track more contacts than they can report to the driver. A driver for such a device should associate one type B slot with each contact that is reported by the hardware. Whenever the identity of the contact associated with a slot changes, the driver should invalidate that slot by changing its ABS_MT_TRACKING_ID. If the hardware signals that it is tracking more contacts than it is currently reporting, the driver should use a BTN_TOOL_*TAP event to inform userspace of the total number of contacts being tracked by the hardware at that moment. The driver should do this by explicitly sending the corresponding BTN_TOOL_*TAP event and setting use_count to false when calling input_mt_report_pointer_emulation(). The driver should only advertise as many slots as the hardware can report. Userspace can detect that a driver can report more total contacts than slots by noting that the largest supported BTN_TOOL_*TAP event is larger than the total number of type B slots reported in the absinfo for the ABS_MT_SLOT axis.

and it also says type A devices has been deprecated at section 3.1:

Note
MT protocol type A is obsolete, all kernel drivers have been converted to use type B.

So I understand it as ABS_MT_TRACKING_ID should increase for identify each touch events - at least to multi-touch device - so I tried to evtest. and this is result. It seems too long but I didn't cut because If upper section of device helps:

No device specified, trying to scan all of /dev/input/event*
Available devices:
/dev/input/event0:      gpio_keys_polled
/dev/input/event1:      ssd253x
Select the device event number [0-1]: 1
Input driver version is 1.0.1
Input device ID: bus 0x18 vendor 0x0 product 0x0 version 0x0
Input device name: "ssd253x"
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      0
      Min        0
      Max      799
    Event code 1 (ABS_Y)
      Value      0
      Min        0
      Max      479
    Event code 47 (ABS_MT_SLOT)
      Value      0
      Min        0
      Max        9
    Event code 53 (ABS_MT_POSITION_X)
      Value      0
      Min        0
      Max      799
    Event code 54 (ABS_MT_POSITION_Y)
      Value      0
      Min        0
      Max      479
    Event code 57 (ABS_MT_TRACKING_ID)
      Value      0
      Min        0
      Max    65535
    Event code 58 (ABS_MT_PRESSURE)
      Value      0
      Min        0
      Max       16
Properties:
  Property type 1 (INPUT_PROP_DIRECT)
Testing ... (interrupt to exit)
Event: time 1697531620.958962, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 9
Event: time 1697531620.958962, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 398
Event: time 1697531620.958962, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 209
Event: time 1697531620.958962, -------------- EV_SYN ------------
Event: time 1697531620.975913, type 3 (EV_ABS), code 58 (ABS_MT_PRESSURE), value 11
Event: time 1697531620.975913, -------------- EV_SYN ------------
Event: time 1697531620.985108, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 397
Event: time 1697531620.985108, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 208
Event: time 1697531620.985108, type 3 (EV_ABS), code 58 (ABS_MT_PRESSURE), value 9
Event: time 1697531620.985108, -------------- EV_SYN ------------
Event: time 1697531621.002052, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 207
Event: time 1697531621.002052, type 3 (EV_ABS), code 58 (ABS_MT_PRESSURE), value 5
Event: time 1697531621.002052, -------------- EV_SYN ------------
Event: time 1697531621.011285, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 394
Event: time 1697531621.011285, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 205
Event: time 1697531621.011285, type 3 (EV_ABS), code 58 (ABS_MT_PRESSURE), value 1
Event: time 1697531621.011285, -------------- EV_SYN ------------
Event: time 1697531621.024135, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value -1
Event: time 1697531621.024135, -------------- EV_SYN ------------
Event: time 1697531621.874388, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 10
Event: time 1697531621.874388, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 413
Event: time 1697531621.874388, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 213
Event: time 1697531621.874388, -------------- EV_SYN ------------
Event: time 1697531621.891331, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 214
Event: time 1697531621.891331, type 3 (EV_ABS), code 58 (ABS_MT_PRESSURE), value 11
Event: time 1697531621.891331, -------------- EV_SYN ------------
Event: time 1697531621.908274, type 3 (EV_ABS), code 58 (ABS_MT_PRESSURE), value 9
Event: time 1697531621.908274, -------------- EV_SYN ------------
Event: time 1697531621.942142, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 213
Event: time 1697531621.942142, type 3 (EV_ABS), code 58 (ABS_MT_PRESSURE), value 5
Event: time 1697531621.942142, -------------- EV_SYN ------------
Event: time 1697531621.959085, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 211
Event: time 1697531621.959085, type 3 (EV_ABS), code 58 (ABS_MT_PRESSURE), value 1
Event: time 1697531621.959085, -------------- EV_SYN ------------
Event: time 1697531621.965738, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value -1
Event: time 1697531621.965738, -------------- EV_SYN ------------
Event: time 1697531632.638183, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 11
Event: time 1697531632.638183, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 436
Event: time 1697531632.638183, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 185

Most of ABS_MT_TRACKING_ID seems to have non-zero value - so I changed evdev.c to following lines:

            else if(in.code == ABS_MT_TRACKING_ID) {
                                printf("in.code is ABS_MT_TRACKING_ID: %d\n", in.value);
                                if(in.value == -1)
                                    evdev_button = LV_INDEV_STATE_REL;
---                                else if(in.value == 0)
+++                                else                               
                                    evdev_button = LV_INDEV_STATE_PR;
            }

Because I thought all of non-negative value of ABS_MT_TRACKING_ID means touchscreen has pressed.
And then I tested my app and demo app again - It works fine.

I think it could be merge to origin because it will be no harm, but I'll be appreciated to tell me if I missed something or wrong.

Makefile

Maybe its better to let the Makefile build in a ./build map. It make the project cleaner after a build

Run on Raspberry pi zero but get two same contents in one frame

Hello, i compiled this project and run it on my raspberry pi zero system, and then it display as two same picture at the same time.
Hardware and System is as below:
Hardware: Raspberry Pi Zero W Rev 1.1
OS: Raspbian GNU/Linux 11 (bullseye) armv6l
Kernel: 5.15.84+

The display is a 240x240 TFT screen which displays the /dev/fb0 content by the fbtft repo, so it should work as a laptop display.
I also compiled this project on my ubuntu laptop, which is work well as this blog(https://blog.lvgl.io/2018-01-03/linux_fb).

So does anyone know the difference, thanks!
lvgl_rpi

Zybo-Z7-10 Petalinux /dev/fb0 frame buffer fbdev

I have downloaded and cross compiled the demo on Ubuntu VM. Following transfer to the Zybo it runs under Petalinux but the image is distorted and lined.

If I run fbset I get

image

Can this be fixed with some parameter changes in the demo?

Shell prompt in application gui

Hello!
First of all thank you for this demo application! It really helps to get a quick overview of lvgl.
I've successfully managed to build and run this demo application. However I'm still facing the following issue.
Shell prompt always appears in GUI. Even if I change buffer size so that the application match full-screen resolution of my display. It is still there and has active focus, so if one would type anything on connected keyboard the command would appear on the screen and break GUI. Is it possible to disable shell prompt so that user would have a full-screen experience with the application? May be this is just framebuffer restriction?

My setup is following:
Board: udoo neo full.
OS: Framebuffer yocto image.
I have USE_FBDEV and USE_EVDEV enabled in lv_drv_conf.h
I use LV_INDEV_TYPE_POINTER to use mouse in GUI (which works correctly for me).

Thank you in advance.

how do i run this repo

i wanna run littlevgl on /dev/fb1 but i have no idea where to start
also, the tutorial isnt helpful at all, its 4 years old

Error during make

Introduce the problem:

I am trying to build this project for the first time. I have cloned this repo and updated the submodule as instructed.
However when I run make. I get this error:
make: *** no rule to make target 'build/obj//root/Git/lv_port_frame_buffer/lvgl/src/draw/sw/blend/neon/lv_blend_neon.o', needed by 'default'. Stop.
Any help with this issue would be appreciated.

touch event support not working

Hello,

I built this demo for rpi3 with official 7-inch display with resolution : 800x480

I first adapted the resolution:

diff --git a/lv_conf.h b/lv_conf.h
index b31a820..414de25 100644
--- a/lv_conf.h
+++ b/lv_conf.h
@@ -20,8 +20,8 @@
  *====================*/
 
 /* Maximal horizontal and vertical resolution to support by the library.*/
-#define LV_HOR_RES_MAX          (480)
-#define LV_VER_RES_MAX          (320)
+#define LV_HOR_RES_MAX          (800)
+#define LV_VER_RES_MAX          (480)
 
 /* Color depth:
  * - 1:  1 byte per pixel

the I enabled the input events:

diff --git a/lv_drv_conf.h b/lv_drv_conf.h
index 975c7b4..8e06825 100644
--- a/lv_drv_conf.h
+++ b/lv_drv_conf.h
@@ -310,7 +310,7 @@
  * Touchscreen as libinput interface (for Linux based systems)
  *------------------------------------------------*/
 #ifndef USE_LIBINPUT
-#  define USE_LIBINPUT           0
+#  define USE_LIBINPUT           1
 #endif
 
 #if USE_LIBINPUT
@@ -321,7 +321,7 @@
  * Mouse or touchpad as evdev interface (for Linux based systems)
  *------------------------------------------------*/
 #ifndef USE_EVDEV
-#  define USE_EVDEV           0
+#  define USE_EVDEV           1
 #endif
 
 #if USE_EVDEV

I also mad sure that demo is linked against libinput by adding -linput to the Makefile.

The demo is showing up and running but not touch event are detected !

My touch is attached to /dev/input/event0

root@raspberrypi3:~# evemu-describe 
Available devices:
/dev/input/event0:      raspberrypi-ts

any hints how to enable the touch or how top debug this issue ?

Packaging for buildroot

Hi,

Packing lvgl for buildroot would be really nice and I'm thinking of having a go at it.
This would be the right repo use as the source for that?

Cheers,

Daniel

lvgl/lvgl.h: No such file or directory

I was just trying to compile the latest release :

CC /home/andrea/gui/v8/lv_port_linux_frame_buffer/lvgl/examples/get_started/lv_example_get_started_3.c
CC /home/andrea/gui/v8/lv_port_linux_frame_buffer/lvgl/examples/get_started/lv_example_get_started_2.c
CC /home/andrea/gui/v8/lv_port_linux_frame_buffer/lvgl/examples/get_started/lv_example_get_started_1.c
/home/andrea/gui/v8/lv_port_linux_frame_buffer/lvgl/examples/assets/imgbtn_mid.c:4:10: fatal error: lvgl/lvgl.h: No such file or directory
#include "lvgl/lvgl.h"
^~~~~~~~~~~~~
compilation terminated.
Makefile:34: recipe for target '/home/andrea/gui/v8/lv_port_linux_frame_buffer/lvgl/examples/assets/imgbtn_mid.o' failed
make: *** [/home/andrea/gui/v8/lv_port_linux_frame_buffer/lvgl/examples/assets/imgbtn_mid.o] Error 1

Touch pad is unresponsive

Hello,

Thanks for the frame buffer example. These types of examples are a huge help.

I'm trying to get the mouse (touch pad) working... The following code gives me a light gray cursor (LV_SYMBOL_UP) in the upper left corner of the frame, as shown in the attached photo.

`// get an input device like mouse
lv_indev_drv_t indev_drv;
lv_indev_drv_init(&indev_drv);
indev_drv.type = LV_INDEV_TYPE_POINTER;
indev_drv.read_cb = evdev_read;

lv_indev_t * mouse_indev = lv_indev_drv_register(&indev_drv);
lv_obj_t * cursor_obj = lv_img_create(lv_scr_act(), NULL); //Create an image for the cursor
lv_img_set_src(cursor_obj, LV_SYMBOL_UP); //Add a built in symbol not an image
lv_indev_set_cursor(mouse_indev, cursor_obj); //Connect mouse object to the driver
`
When the LEFT touch pad button is pressed, Tab 1 is highlighted (buttons seem to be working). However, when I put my finger on the touch pad, the cursor disappears and buttons stop working.

Not sure why this is happening. Does anyone know?

Best Regards

lvgl_FrameBuffer

Documentation : cross compilation for arm

First of all great project, I'm quite new to the embedded graphics stack and this project compiles and works out of the box on my laptop so that's great and very promising.

Any chances of giving some indications on how to cross compile this for an arm device ?

My use case is the following : I want to try it out on an ereader that only has framebuffer : https://linux-sunxi.org/Bookeen_Cybook_Muse ... right now I can compile https://github.com/allepet/nolim-ebook-sdk for it but am not sure I can build upon that and would rather have a framework such as LVGL to build upon.

lvgl:arm-ostl-linux-gnueabi-gcc compile error!fatal error: lvgl/lvgl.h: No such file or directory #include "lvgl/lvgl.h"

When I compile the LVGL by gcc, everything is OK.
But when I compile it with arm-ostl-linux-gnueabi-gcc for my STM32MP157-DK2,compilation terminated.
fatal error: lvgl/lvgl.h: No such file or directory #include "lvgl/lvgl.h"
I trid to replace "lvgl/lvgl.h" with "lvgl.h", but It doesn't work.
echo 'main(){}'| arm-ostl-linux-gnueabi-gcc -E -v -
`Using built-in specs.
COLLECT_GCC=arm-ostl-linux-gnueabi-gcc
Target: arm-ostl-linux-gnueabi
Configured with: ../../../../../../work-shared/gcc-8.2.0-r0/gcc-8.2.0/configure --build=x86_64-linux --host=x86_64-ostl_sdk-linux --target=arm-ostl-linux-gnueabi --prefix=/opt/st/stm32mp1/2.6-openstlinux-20-02-19/sysroots/x86_64-ostl_sdk-linux/usr --exec_prefix=/opt/st/stm32mp1/2.6-openstlinux-20-02-19/sysroots/x86_64-ostl_sdk-linux/usr --bindir=/opt/st/stm32mp1/2.6-openstlinux-20-02-19/sysroots/x86_64-ostl_sdk-linux/usr/bin/arm-ostl-linux-gnueabi --sbindir=/opt/st/stm32mp1/2.6-openstlinux-20-02-19/sysroots/x86_64-ostl_sdk-linux/usr/bin/arm-ostl-linux-gnueabi --libexecdir=/opt/st/stm32mp1/2.6-openstlinux-20-02-19/sysroots/x86_64-ostl_sdk-linux/usr/libexec/arm-ostl-linux-gnueabi --datadir=/opt/st/stm32mp1/2.6-openstlinux-20-02-19/sysroots/x86_64-ostl_sdk-linux/usr/share --sysconfdir=/opt/st/stm32mp1/2.6-openstlinux-20-02-19/sysroots/x86_64-ostl_sdk-linux/etc --sharedstatedir=/opt/st/stm32mp1/2.6-openstlinux-20-02-19/sysroots/x86_64-ostl_sdk-linux/com --localstatedir=/opt/st/stm32mp1/2.6-openstlinux-20-02-19/sysroots/x86_64-ostl_sdk-linux/var --libdir=/opt/st/stm32mp1/2.6-openstlinux-20-02-19/sysroots/x86_64-ostl_sdk-linux/usr/lib/arm-ostl-linux-gnueabi --includedir=/opt/st/stm32mp1/2.6-openstlinux-20-02-19/sysroots/x86_64-ostl_sdk-linux/usr/include --oldincludedir=/opt/st/stm32mp1/2.6-openstlinux-20-02-19/sysroots/x86_64-ostl_sdk-linux/usr/include --infodir=/opt/st/stm32mp1/2.6-openstlinux-20-02-19/sysroots/x86_64-ostl_sdk-linux/usr/share/info --mandir=/opt/st/stm32mp1/2.6-openstlinux-20-02-19/sysroots/x86_64-ostl_sdk-linux/usr/share/man --disable-silent-rules --disable-dependency-tracking --with-libtool-sysroot=/opt/STM/workspace/workdir/openstlinux/build-stm32mp1/tmp-glibc/work/x86_64-nativesdk-ostl_sdk-linux/gcc-cross-canadian-arm/8.2.0-r0/recipe-sysroot --with-gnu-ld --enable-shared --enable-languages=c,c++ --enable-threads=posix --enable-multilib --enable-c99 --enable-long-long --enable-symvers=gnu --enable-libstdcxx-pch --program-prefix=arm-ostl-linux-gnueabi- --without-local-prefix --enable-lto --disable-libssp --enable-libitm --disable-bootstrap --disable-libmudflap --with-system-zlib --with-linker-hash-style=gnu --enable-linker-build-id --with-ppl=no --with-cloog=no --enable-checking=release --enable-cheaders=c_global --without-isl --with-gxx-include-dir=/not/exist/usr/include/c++/8.2.0 --with-build-time-tools=/opt/STM/workspace/workdir/openstlinux/build-stm32mp1/tmp-glibc/work/x86_64-nativesdk-ostl_sdk-linux/gcc-cross-canadian-arm/8.2.0-r0/recipe-sysroot-native/usr/arm-ostl-linux-gnueabi/bin --with-sysroot=/not/exist --with-build-sysroot=/opt/STM/workspace/workdir/openstlinux/build-stm32mp1/tmp-glibc/work/x86_64-nativesdk-ostl_sdk-linux/gcc-cross-canadian-arm/8.2.0-r0/recipe-sysroot --without-long-double-128 libgcc_cv_powerpc_float128=no --enable-poison-system-directories --disable-static --enable-nls --enable-initfini-array
Thread model: posix
gcc version 8.2.0 (GCC)
COLLECT_GCC_OPTIONS='-E' '-v' '-mcpu=arm10tdmi' '-mtls-dialect=gnu' '-marm' '-march=armv5t'
/home/pi/stm32mp157/sdk/sysroots/x86_64-ostl_sdk-linux/usr/libexec/arm-ostl-linux-gnueabi/gcc/arm-ostl-linux-gnueabi/8.2.0/cc1 -E -quiet -v - -mcpu=arm10tdmi -mtls-dialect=gnu -marm -march=armv5t
ignoring nonexistent directory "/not/exist/usr/lib/gcc/arm-ostl-linux-gnueabi/8.2.0/include"
ignoring nonexistent directory "/not/exist/usr/local/include"
ignoring nonexistent directory "/home/pi/stm32mp157/sdk/sysroots/x86_64-ostl_sdk-linux/usr/lib/arm-ostl-linux-gnueabi/gcc/arm-ostl-linux-gnueabi/8.2.0/../../../../../arm-ostl-linux-gnueabi/include"
ignoring nonexistent directory "/not/exist/usr/include/"
#include "..." search starts here:
#include <...> search starts here:
/home/pi/stm32mp157/sdk/sysroots/x86_64-ostl_sdk-linux/usr/lib/arm-ostl-linux-gnueabi/gcc/arm-ostl-linux-gnueabi/8.2.0/include
/home/pi/stm32mp157/sdk/sysroots/x86_64-ostl_sdk-linux/usr/lib/arm-ostl-linux-gnueabi/gcc/arm-ostl-linux-gnueabi/8.2.0/include-fixed
End of search list.

1 ""

1 ""

1 ""

1 ""

main(){}
COMPILER_PATH=/home/pi/stm32mp157/sdk/sysroots/x86_64-ostl_sdk-linux/usr/libexec/arm-ostl-linux-gnueabi/gcc/arm-ostl-linux-gnueabi/8.2.0/:/home/pi/stm32mp157/sdk/sysroots/x86_64-ostl_sdk-linux/usr/libexec/arm-ostl-linux-gnueabi/gcc/arm-ostl-linux-gnueabi/8.2.0/:/home/pi/stm32mp157/sdk/sysroots/x86_64-ostl_sdk-linux/usr/libexec/arm-ostl-linux-gnueabi/gcc/arm-ostl-linux-gnueabi/:/home/pi/stm32mp157/sdk/sysroots/x86_64-ostl_sdk-linux/usr/lib/arm-ostl-linux-gnueabi/gcc/arm-ostl-linux-gnueabi/8.2.0/:/home/pi/stm32mp157/sdk/sysroots/x86_64-ostl_sdk-linux/usr/lib/arm-ostl-linux-gnueabi/gcc/arm-ostl-linux-gnueabi/
LIBRARY_PATH=/home/pi/stm32mp157/sdk/sysroots/x86_64-ostl_sdk-linux/usr/lib/arm-ostl-linux-gnueabi/gcc/arm-ostl-linux-gnueabi/8.2.0/
COLLECT_GCC_OPTIONS='-E' '-v' '-mcpu=arm10tdmi' '-mtls-dialect=gnu' '-marm' '-march=armv5t'
`
Could you please give me some advise?

Compilation fails with Clang 15

We are using clang 15 in the latest version of Yoe and getting the following compile error:

[cbrake@ceres yoe-distro]$ ./build/tmp/work/cortexa35-yoe-linux/lvgl-demo-fb/1.0-r0/temp/run.do_compile
NOTE: cmake --build /scratch/yoe/yoe-distro/build/tmp/work/cortexa35-yoe-linux/lvgl-demo-fb/1.0-r0/lvgl-demo-fb-1.0/ --target all --
[129/441] Building C object lvgl/CMakeFiles/lvgl.dir/src/hal/lv_hal_tick.c.o
FAILED: lvgl/CMakeFiles/lvgl.dir/src/hal/lv_hal_tick.c.o 
/scratch/yoe/yoe-distro/build/tmp/work/cortexa35-yoe-linux/lvgl-demo-fb/1.0-r0/recipe-sysroot-native/usr/bin/aarch64-yoe-linux/aarch64-yoe-linux-clang -DLV_CONF_INCLUDE_SIMPLE -DLV_LVGL_H_INCLUDE_SIMPLE -I/scratch/yoe/yoe-distro/workspace/sources/lvgl-demo-fb/. -isystem /scratch/yoe/yoe-distro/workspace/sources/lvgl-demo-fb/lvgl -target aarch64-yoe-linux  -mcpu=cortex-a35 -march=armv8-a+crc+crypto -mlittle-endian --dyld-prefix=/usr -Qunused-arguments -ffile-compilation-dir=. -fstack-protector-strong  -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security  --sysroot=/scratch/yoe/yoe-distro/build/tmp/work/cortexa35-yoe-linux/lvgl-demo-fb/1.0-r0/recipe-sysroot  -O2 -pipe -g -feliminate-unused-debug-types -fmacro-prefix-map=/scratch/yoe/yoe-distro/workspace/sources/lvgl-demo-fb=/usr/src/debug/lvgl-demo-fb/1.0-r0  -fdebug-prefix-map=/scratch/yoe/yoe-distro/workspace/sources/lvgl-demo-fb=/usr/src/debug/lvgl-demo-fb/1.0-r0  -fmacro-prefix-map=/scratch/yoe/yoe-distro/build/tmp/work/cortexa35-yoe-linux/lvgl-demo-fb/1.0-r0/lvgl-demo-fb-1.0/=/usr/src/debug/lvgl-demo-fb/1.0-r0  -fdebug-prefix-map=/scratch/yoe/yoe-distro/build/tmp/work/cortexa35-yoe-linux/lvgl-demo-fb/1.0-r0/lvgl-demo-fb-1.0/=/usr/src/debug/lvgl-demo-fb/1.0-r0  -fdebug-prefix-map=/scratch/yoe/yoe-distro/build/tmp/work/cortexa35-yoe-linux/lvgl-demo-fb/1.0-r0/recipe-sysroot=  -fmacro-prefix-map=/scratch/yoe/yoe-distro/build/tmp/work/cortexa35-yoe-linux/lvgl-demo-fb/1.0-r0/recipe-sysroot=  -fdebug-prefix-map=/scratch/yoe/yoe-distro/build/tmp/work/cortexa35-yoe-linux/lvgl-demo-fb/1.0-r0/recipe-sysroot-native= -MD -MT lvgl/CMakeFiles/lvgl.dir/src/hal/lv_hal_tick.c.o -MF lvgl/CMakeFiles/lvgl.dir/src/hal/lv_hal_tick.c.o.d -o lvgl/CMakeFiles/lvgl.dir/src/hal/lv_hal_tick.c.o -c /scratch/yoe/yoe-distro/workspace/sources/lvgl-demo-fb/lvgl/src/hal/lv_hal_tick.c
/scratch/yoe/yoe-distro/workspace/sources/lvgl-demo-fb/lvgl/src/hal/lv_hal_tick.c:77:12: error: call to undeclared function 'custom_tick_get'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
    return LV_TICK_CUSTOM_SYS_TIME_EXPR;
           ^
/scratch/yoe/yoe-distro/workspace/sources/lvgl-demo-fb/./lv_conf.h:91:43: note: expanded from macro 'LV_TICK_CUSTOM_SYS_TIME_EXPR'
    #define LV_TICK_CUSTOM_SYS_TIME_EXPR (custom_tick_get())    /*Expression evaluating to current system time in ms*/
                                          ^
1 error generated.
[152/441] Building C object lvgl/CMakeFiles/lvgl.dir/src/extra/widgets/chart/lv_chart.c.o
ninja: build stopped: subcommand failed.
WARNING: ./build/tmp/work/cortexa35-yoe-linux/lvgl-demo-fb/1.0-r0/temp/run.do_compile:152 exit 1 from 'eval ${DESTDIR:+DESTDIR=${DESTDIR} } cmake --build '/scratch/yoe/yoe-distro/build/tmp/work/cortexa35-yoe-linux/lvgl-demo-fb/1.0-r0/lvgl-demo-fb-1.0/' "$@" -- ${EXTRA_OECMAKE_BUILD}'
WARNING: Backtrace (BB generated script): 
        #1: cmake_runcmake_build, ./build/tmp/work/cortexa35-yoe-linux/lvgl-demo-fb/1.0-r0/temp/run.do_compile, line 152
        #2: cmake_do_compile, ./build/tmp/work/cortexa35-yoe-linux/lvgl-demo-fb/1.0-r0/temp/run.do_compile, line 146
        #3: do_compile, ./build/tmp/work/cortexa35-yoe-linux/lvgl-demo-fb/1.0-r0/temp/run.do_compile, line 141
        #4: main, ./build/tmp/work/cortexa35-yoe-linux/lvgl-demo-fb/1.0-r0/temp/run.do_compile, line 165

If I set LV_TICK_CUSTOM to 0 in lv_conf.h, then it compiles and runs.

Not sure the best way to fix this up, so thought I would start a discussion here.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.