Lvgl.mk not found when building user space

Hi,

I’m trying to build SO3 according to the user guide. All went well, but for

cd usr
make 

I got

<a lot of libs are built succesfully >
make -C lvgl all
make[1]: Entering directory '/home/kisvegabor/projects/littlevgl/so3/usr/lvgl'
Makefile:9: lvgl/lvgl.mk: No such file or directory
make[1]: *** No rule to make target 'lvgl/lvgl.mk'.  Stop.
make[1]: Leaving directory '/home/kisvegabor/projects/littlevgl/so3/usr/lvgl'
Makefile:57: recipe for target '/home/kisvegabor/projects/littlevgl/so3/usr/lvgl/liblvgl.a' failed
make: *** [/home/kisvegabor/projects/littlevgl/so3/usr/lvgl/liblvgl.a] Error 2

I’ve checked that the mk files are really missing from the lvgl directory. No files returned for
find . -name "*.mk"

Do you have any idea? Have I missed a step?

Oups… very sorry. Indeed, .mk files were skipped due to .gitignore. They have been added now. It should work:-)

Thanks, it compiled now.

However, it failed on ./st:

& ./st
MAC:		 DE:AD:BE:EF:09:00
GDB Port:	 1234 


WARNING: Image format was not specified for 'filesystem/sdcard.img.vexpress' and probing guessed raw.
         Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
         Specify the 'raw' format explicitly to remove the restrictions.
scripts/qemu-ifup.sh: line 26: brctl: command not found
scripts/qemu-ifup.sh: line 26: brctl: command not found
scripts/qemu-ifup.sh: line 26: brctl: command not found
scripts/qemu-ifup.sh: line 26: brctl: command not found
SIOCSIFADDR: No such device
br0: ERROR while getting interface flags: No such device
SIOCSIFNETMASK: No such device
br0: ERROR while getting interface flags: No such device
0+1 records in
0+1 records out
2 bytes copied, 4,5533e-05 s, 43,9 kB/s

dnsmasq: failed to create listening socket for 192.168.53.1: Cannot assign requested address
scripts/qemu-ifup.sh: line 26: brctl: command not found
qemu-system-arm: network script scripts/qemu-ifup.sh failed with status 32512

Shall I open a new topic for it?

I see. There are a couple of packages which are missing like bridge-utils. I updated the pre-requisites section in the user guide. Please try with these addons and let us know if it works.

Thank you! I got one step closer :slight_smile:

$ ./st
MAC:		 DE:AD:BE:EF:C9:00
GDB Port:	 1234 


WARNING: Image format was not specified for 'filesystem/sdcard.img.vexpress' and probing guessed raw.
         Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
         Specify the 'raw' format explicitly to remove the restrictions.
0+1 records in
0+1 records out
2 bytes copied, 7,9716e-05 s, 25,1 kB/s
qemu-system-arm: warning: hub 0 with no nics


U-Boot 2019.10 (Mar 10 2021 - 18:45:15 +0100)

DRAM:  1 GiB
WARNING: Caches not enabled
Flash: 0 Bytes
MMC:   MMC: 0
In:    serial
Out:   serial
Err:   serial
Net:   smc911x-0
Hit any key to stop autoboot:  0 
116 bytes read in 12 ms (8.8 KiB/s)
## Warning: defaulting to text format
## Info: input data size = 117 = 0x75
Wrong Image Format for bootm command
ERROR: can't get kernel image!
=> ls
ls - list files in a directory (default /)

There was maybe a corruption with the virtual sdcard located in filesystem/ (sdcard.img.vexpress).
Could you try to remake the following commands:

cd filesystem
./create_img.sh vexpress
cd …
./deploy.sh -bu
./st

(and make sure you did make vexpress_defconfig followed by make in u-boot/

I’ve performed all the build steps from the beginning and now it fails at:

$ ./deploy.sh -bu
Here: board is  vexpress
------------------- deploy usr apps in so3  ---------------
Deploying user apps into the ramfs partition
Here: board is vexpress
-------------------mount ramfs ---------------
losetup: ./board/vexpress/rootfs.fat: failed to set up loop device: No such file or directory
mount: /home/kisvegabor/projects/littlevgl/so3/rootfs/fs: special device p1 does not exist.
Here: board is vexpress
umount: fs: not mounted.
Deploying boot files into the first partition...
sh: 1: dtc: not found
mkimage: Can't open vexpress.itb.tmp: No such file or directory

Hi Gabor,

Sorry for these troubles. There is still one package missing (the device tree compiler). Plese could you try to install the two following:

sudo apt-get install device-tree-compiler

This should solve the “dtc: not found” message.

There was also a mistake in the selection of the kernel configuration. It would be better to use the vexpress_ramfs_defconfig (although the mmc works well, but it is simpler). So, if you could make a re-compilation of the kernel with the following commands:

cd so3
make vexpress_ramfs_defconfig
make

And in this case, there is a missing step in the doc which is the creation of the ramfs which is required with this configuration. You can do that (from the root dir):

cd rootfs
./create_ramfs.sh vexpress

Now, make a git pull to get an updated .its file with this configuration,
and finally, re-deploy into the SD-card (at the root dir):

./deploy.sh -bu

(The user guide has been updated. Many thanks for your help).

One more thing, to have the emulation running with a GUI framebuffer, you will need to use the stg script instead of stg. This will start a new window for the framebuffer output (and interaction with the mouse).

I hope this time you will get the shell prompt :slight_smile:

Thank you for the update. After installing device-tree-compiler and performing al steps from the docs (except rebuilding qemu) .st got further but still failed:

$ ./st
MAC:		 DE:AD:BE:EF:1E:00
GDB Port:	 1234 


WARNING: Image format was not specified for 'filesystem/sdcard.img.vexpress' and probing guessed raw.
         Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
         Specify the 'raw' format explicitly to remove the restrictions.
0+1 records in
0+1 records out
2 bytes copied, 6,3512e-05 s, 31,5 kB/s
qemu-system-arm: warning: hub 0 with no nics


U-Boot 2019.10 (Mar 18 2021 - 23:44:51 +0100)

DRAM:  1 GiB
WARNING: Caches not enabled
Flash: 0 Bytes
MMC:   MMC: 0
In:    serial
Out:   serial
Err:   serial
Net:   smc911x-0
Hit any key to stop autoboot:  0 
116 bytes read in 12 ms (8.8 KiB/s)
## Warning: defaulting to text format
## Info: input data size = 117 = 0x75
18034653 bytes read in 2608 ms (6.6 MiB/s)
## Loading kernel from FIT Image at b0000000 ...
   Using 'so3_mmc' configuration
   Trying 'so3' kernel subimage
     Description:  SO3 OS kernel
     Type:         Kernel Image
     Compression:  uncompressed
     Data Start:   0xb00000d0
     Data Size:    204840 Bytes = 200 KiB
     Architecture: ARM
     OS:           Linux
     Load Address: 0x80008000
     Entry Point:  0x80008000
     Hash algo:    crc32
     Hash value:   b6ce1fa6
   Verifying Hash Integrity ... crc32+ OK
## Loading fdt from FIT Image at b0000000 ...
   Using 'so3_mmc' configuration
   Trying 'fdt' fdt subimage
     Description:  Flattened Device Tree blob
     Type:         Flat Device Tree
     Compression:  uncompressed
     Data Start:   0xb00321d8
     Data Size:    1953 Bytes = 1.9 KiB
     Architecture: ARM
     Load Address: 0x84a00000
     Hash algo:    crc32
     Hash value:   47234dad
   Verifying Hash Integrity ... crc32+ OK
   Loading fdt from 0xb00321d8 to 0x84a00000
   Booting using the fdt blob at 0x84a00000
   Loading Kernel Image
   Using Device Tree in place at 84a00000, end 84a037a0

Starting kernel ...

setup_arch: CPU control register (CR) = c5387d


********** Smart Object Oriented SO3 Operating System **********
Copyright (c) 2014-2020 REDS Institute, HEIG-VD, Yverdon
Version 2021.4.1


Now bootstraping the kernel ...
SO3: allocating a kernel heap of 2097124 bytes at address c003c000.
memory_init: relocating the device tree from 0x84a00000 to 0xc044c000 (size of 4096 bytes)
SO3 Memory information:
  - kernel size without frame table is: 4509696 (0x44d000) bytes, 4 MB / 0x44d PFNs
  - kernel size including frame table is: 5550080 (0x54b000) bytes, 5 MB / 0x54b PFNs
  - Number of available page frames: 0x1fbb3
  - Frame table size is: 1039768 bytes meaning 0xfe page frames
  - Page frame number of the first available page: 0x8054b
periodic_timer_start: setting up system timer periodic freq at 3e8
Assertion 'valid_ramdev()' failed, line 55, file devices/ramdev/ramdev.c
kernel_panic: entering infinite loop... CPU: 0

Here is the whole log about building the components:

kisvegabor@kisvegabor-HP-ProBook-470-G5 ~/projects/littlevgl/so3 $ (master) 
kisvegabor@kisvegabor-HP-ProBook-470-G5 ~/projects/littlevgl/so3/u-boot $ (master) make vexpress_defconfig
#
# configuration written to .config
#
kisvegabor@kisvegabor-HP-ProBook-470-G5 ~/projects/littlevgl/so3/u-boot $ (master) make -j8
scripts/kconfig/conf  --syncconfig Kconfig
  CHK     include/config.h
  CFG     u-boot.cfg
  GEN     include/autoconf.mk.dep
  GEN     include/autoconf.mk
  CHK     include/config/uboot.release
  CHK     include/generated/timestamp_autogenerated.h
  UPD     include/generated/timestamp_autogenerated.h
  CHK     include/generated/version_autogenerated.h
  CHK     include/generated/generic-asm-offsets.h
  CHK     include/generated/asm-offsets.h
  HOSTCC  tools/mkenvimage.o
  HOSTCC  tools/fit_image.o
  HOSTCC  tools/image-host.o
  HOSTCC  tools/dumpimage.o
  HOSTCC  tools/mkimage.o
  HOSTLD  tools/mkenvimage
  HOSTLD  tools/dumpimage
  HOSTLD  tools/mkimage
  CC      common/main.o
  CC      cmd/version.o
  LD      cmd/built-in.o
  LD      common/built-in.o
  CC      lib/smbios.o
  CC      lib/display_options.o
  CC      lib/efi_loader/helloworld.o
  AS      lib/efi_loader/efi_crt0.o
  CC      lib/efi_loader/efi_reloc.o
  CC      lib/efi_loader/efi_freestanding.o
  LD      lib/efi_loader/helloworld_efi.so
  OBJCOPY lib/efi_loader/helloworld.efi
  LD      lib/built-in.o
  LD      u-boot
  OBJCOPY u-boot.srec
  OBJCOPY u-boot-nodtb.bin
  SYM     u-boot.sym
  COPY    u-boot.bin
===================== WARNING ======================
This board does not use CONFIG_DM. CONFIG_DM will be
compulsory starting with the v2020.01 release.
Failure to update may result in board removal.
See doc/driver-model/migration.rst for more info.
====================================================
===================== WARNING ======================
This board does not use CONFIG_DM_MMC. Please update
the board to use CONFIG_DM_MMC before the v2019.04 release.
Failure to update by the deadline may result in board removal.
See doc/driver-model/MIGRATION.txt for more info.
====================================================
===================== WARNING ======================
This board does not use CONFIG_DM_ETH (Driver Model
for Ethernet drivers). Please update the board to use
CONFIG_DM_ETH before the v2020.07 release. Failure to
update by the deadline may result in board removal.
See doc/driver-model/migration.rst for more info.
====================================================
  CFGCHK  u-boot.cfg
kisvegabor@kisvegabor-HP-ProBook-470-G5 ~/projects/littlevgl/so3/u-boot $ (master) 
kisvegabor@kisvegabor-HP-ProBook-470-G5 ~/projects/littlevgl/so3/filesystem $ (master) ./create_img.sh vexpress
Creating sdcard.img.vexpress ...
1+0 records in
1+0 records out
471859200 bytes (472 MB, 450 MiB) copied, 0,884857 s, 533 MB/s

Welcome to fdisk (util-linux 2.31.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Device does not contain a recognized partition table.
Created a new DOS disklabel with disk identifier 0x0b6c05b4.

Command (m for help): Created a new DOS disklabel with disk identifier 0xcde4bfa3.

Command (m for help): Partition type
   p   primary (0 primary, 0 extended, 4 free)
   e   extended (container for logical partitions)
Select (default p): Partition number (1-4, default 1): First sector (2048-921599, default 2048): Last sector, +sectors or +size{K,M,G,T,P} (2048-921599, default 921599): 
Created a new partition 1 of type 'Linux' and of size 128 MiB.

Command (m for help): Selected partition 1
Hex code (type L to list all codes): Changed type of partition 'Linux' to 'W95 FAT32 (LBA)'.

Command (m for help): Partition type
   p   primary (1 primary, 0 extended, 3 free)
   e   extended (container for logical partitions)
Select (default p): Partition number (2-4, default 2): First sector (264192-921599, default 264192): Last sector, +sectors or +size{K,M,G,T,P} (264192-921599, default 921599): 
Created a new partition 2 of type 'Linux' and of size 180 MiB.

Command (m for help): The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.

mkfs.fat 4.1 (2017-01-24)
mke2fs 1.44.1 (24-Mar-2018)
Discarding device blocks: done                            
Creating filesystem with 184320 1k blocks and 46184 inodes
Filesystem UUID: 8bc7a7ca-725c-40ed-a955-8b9283bfb296
Superblock backups stored on blocks: 
	8193, 24577, 40961, 57345, 73729

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: done 

kisvegabor@kisvegabor-HP-ProBook-470-G5 ~/projects/littlevgl/so3/filesystem $ (master) 
kisvegabor@kisvegabor-HP-ProBook-470-G5 ~/projects/littlevgl/so3/rootfs $ (master) ./create_ramfs.sh vexpress
Checking that no-one is using this disk right now ... OK

Disk board/vexpress/rootfs.fat: 17 MiB, 17825792 bytes, 34816 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

>>> Created a new DOS disklabel with disk identifier 0x4eb509b5.
board/vexpress/rootfs.fat1: Created a new partition 1 of type 'W95 FAT32 (LBA)' and of size 16 MiB.
Partition #1 contains a vfat signature.
board/vexpress/rootfs.fat2: Done.

New situation:
Disklabel type: dos
Disk identifier: 0x4eb509b5

Device                     Boot Start   End Sectors Size Id Type
board/vexpress/rootfs.fat1       2048 34815   32768  16M  c W95 FAT32 (LBA)

The partition table has been altered.
Syncing disks.
kisvegabor@kisvegabor-HP-ProBook-470-G5 ~/projects/littlevgl/so3/rootfs $ (master) 
kisvegabor@kisvegabor-HP-ProBook-470-G5 ~/projects/littlevgl/so3/so3 $ (master) make vexpress_ramfs_defconfig
#
# No change to .config
#
kisvegabor@kisvegabor-HP-ProBook-470-G5 ~/projects/littlevgl/so3/so3 $ (master) make
kisvegabor@kisvegabor-HP-ProBook-470-G5 ~/projects/littlevgl/so3/so3 $ (master) cd ..
kisvegabor@kisvegabor-HP-ProBook-470-G5 ~/projects/littlevgl/so3 $ (master) ./deploy.sh -bu
Here: board is  vexpress
------------------- deploy usr apps in so3  ---------------
Deploying user apps into the ramfs partition
Here: board is vexpress
-------------------mount ramfs ---------------
Here: board is vexpress
Deploying boot files into the first partition...
FIT description: Kernel and rootfs components for vExpress environment
Created:         Thu Mar 18 23:53:41 2021
 Image 0 (so3)
  Description:  SO3 OS kernel
  Created:      Thu Mar 18 23:53:41 2021
  Type:         Kernel Image
  Compression:  uncompressed
  Data Size:    204840 Bytes = 200.04 KiB = 0.20 MiB
  Architecture: ARM
  OS:           Linux
  Load Address: 0x80008000
  Entry Point:  0x80008000
  Hash algo:    crc32
  Hash value:   b6ce1fa6
 Image 1 (fdt)
  Description:  Flattened Device Tree blob
  Created:      Thu Mar 18 23:53:41 2021
  Type:         Flat Device Tree
  Compression:  uncompressed
  Data Size:    1953 Bytes = 1.91 KiB = 0.00 MiB
  Architecture: ARM
  Load Address: 0x84a00000
  Hash algo:    crc32
  Hash value:   47234dad
 Image 2 (ramdisk)
  Description:  SO3 environment minimal rootfs
  Created:      Thu Mar 18 23:53:41 2021
  Type:         RAMDisk Image
  Compression:  uncompressed
  Data Size:    17825792 Bytes = 17408.00 KiB = 17.00 MiB
  Architecture: ARM
  OS:           Linux
  Load Address: 0x84c00000
  Entry Point:  unavailable
 Default Configuration: 'so3_mmc'
 Configuration 0 (so3_ramfs)
  Description:  SO3 kernel image including device tree
  Kernel:       so3
  Init Ramdisk: ramdisk
  FDT:          fdt
 Configuration 1 (so3_mmc)
  Description:  SO3 kernel image including device tree
  Kernel:       so3
  FDT:          fdt
ITB deployed.
kisvegabor@kisvegabor-HP-ProBook-470-G5 ~/projects/littlevgl/so3 $ (master) ./stg
MAC:		 DE:AD:BE:EF:FC:00
GDB Port:	 1234 


WARNING: Image format was not specified for 'filesystem/sdcard.img.vexpress' and probing guessed raw.
         Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
         Specify the 'raw' format explicitly to remove the restrictions.
0+1 records in
0+1 records out
2 bytes copied, 4,3143e-05 s, 46,4 kB/s
qemu-system-arm: warning: hub 0 with no nics


U-Boot 2019.10 (Mar 18 2021 - 23:52:44 +0100)

DRAM:  1 GiB
WARNING: Caches not enabled
Flash: 0 Bytes
MMC:   MMC: 0
In:    serial
Out:   serial
Err:   serial
Net:   smc911x-0
Hit any key to stop autoboot:  0 
116 bytes read in 14 ms (7.8 KiB/s)
## Warning: defaulting to text format
## Info: input data size = 117 = 0x75
18034653 bytes read in 2696 ms (6.4 MiB/s)
## Loading kernel from FIT Image at b0000000 ...
   Using 'so3_mmc' configuration
   Trying 'so3' kernel subimage
     Description:  SO3 OS kernel
     Type:         Kernel Image
     Compression:  uncompressed
     Data Start:   0xb00000d0
     Data Size:    204840 Bytes = 200 KiB
     Architecture: ARM
     OS:           Linux
     Load Address: 0x80008000
     Entry Point:  0x80008000
     Hash algo:    crc32
     Hash value:   b6ce1fa6
   Verifying Hash Integrity ... crc32+ OK
## Loading fdt from FIT Image at b0000000 ...
   Using 'so3_mmc' configuration
   Trying 'fdt' fdt subimage
     Description:  Flattened Device Tree blob
     Type:         Flat Device Tree
     Compression:  uncompressed
     Data Start:   0xb00321d8
     Data Size:    1953 Bytes = 1.9 KiB
     Architecture: ARM
     Load Address: 0x84a00000
     Hash algo:    crc32
     Hash value:   47234dad
   Verifying Hash Integrity ... crc32+ OK
   Loading fdt from 0xb00321d8 to 0x84a00000
   Booting using the fdt blob at 0x84a00000
   Loading Kernel Image
   Using Device Tree in place at 84a00000, end 84a037a0

Starting kernel ...

setup_arch: CPU control register (CR) = c5387d


********** Smart Object Oriented SO3 Operating System **********
Copyright (c) 2014-2020 REDS Institute, HEIG-VD, Yverdon
Version 2021.4.1


Now bootstraping the kernel ...
SO3: allocating a kernel heap of 2097124 bytes at address c003c000.
memory_init: relocating the device tree from 0x84a00000 to 0xc044c000 (size of 4096 bytes)
SO3 Memory information:
  - kernel size without frame table is: 4509696 (0x44d000) bytes, 4 MB / 0x44d PFNs
  - kernel size including frame table is: 5550080 (0x54b000) bytes, 5 MB / 0x54b PFNs
  - Number of available page frames: 0x1fbb3
  - Frame table size is: 1039768 bytes meaning 0xfe page frames
  - Page frame number of the first available page: 0x8054b
periodic_timer_start: setting up system timer periodic freq at 3e8
Assertion 'valid_ramdev()' failed, line 55, file devices/ramdev/ramdev.c
kernel_panic: entering infinite loop... CPU: 0

Hi Gabor,
As I said, you need change the configuration, create a ramfs and re-deploy the whole.
However, to have a LVGL enabled configuration quickly so that you can test the (newly added) graphic application, I propose that you do the following commands (from the repo root dir):

cd so3
make vexpress_fb_defconfig
make
cd ../rootfs
./create_ramfs.sh vexpress
cd ../usr
make
cd ..
./deploy.sh -bu
./stg

The deploy.sh -bu also performs the deployment of user apps into the ramfs.

As you see, start the environment with ./stg in order to have the QEMU graphic window and have access to the framebuffer.

When you get the prompt, type:

so3% demofb

and you run a simple application using LVGL widgets and others. The application has currently no escape to exit. You need to exit QEMU with Ctrl-x then ‘a’.

Oh sorry, my bad. It’s working now! :slight_smile:

On ./stg a black window appears but

so3% demofb
devclass_by_filename: device not found.
Couldn't open framebuffer.

ls is working well :slight_smile:

hm may be I forgot to mention a git pull to do. I’ve updated the vexpress_fb_defconfig because the driver was disabled.
So, after git pull, you will need to repeat the commands before.

Aaaand, it’s working! :slight_smile: Thak you!

Have you considered using lvgl as a submodule for easier updates? I’ve tried to update lvgl to v8 but ran into a build issue with the files in the lvgl/src/extra folder. extra.mk uses find to collect the C files and the .o files were generated next to the .c files. For some reason make couldn’t find these .o files.

Yeahh excellent!! You’re right, we should think about using a submodule.
For the time being, I will try to migrate the whole usr stuff on CMake. It will be also simpler to manage the compilation of LVGL (just for info, I’ve updated a path, and the v8 compiles well :-))

Oh, awesome! Have you tried with lv_demo_widgets?

And could you update the repo? I’d like to try it out as well. :slight_smile:

Not yet. I have created a new branch (17) in which I’m migrating to cmake for usr apps build as well as to integrate LVGL v8. So far, it compiles fine except demofb.c which needs to be aligned with the new API. I will try to adapt demofb.c first, and then testing available demo apps in LVGL in a second step :slight_smile:

I’ve already updated demofb.c while playing with porting. See here. (I can attach only images therefore the drive link). I couldn’t test it because of teh build issues but it should work :slight_smile:
Note that lv_conf.h should be also re-created from lv_conf_templat.h.

Excellent! Thank you Gabor!

I already updated lv_conf.h from the template. Now, it seems lv_demo_widgets.h is missing (or should come from a template somewhere?).

I pushed the changes on the branch. By the way, would you like to register on gitlab to be granted as developer? You could then push your own changes. Just give me your gitlab username and I will grant you the access.

Great news! SO3 is now supporting LVGL v8 and the lv_demo_widgets is working well ! Please enjoy and tell me what you think. There is still a small issue with the mouse apparently, but nothing serious. Many thanks for your help and addon :slight_smile:

And additionally, the user space is now fully based on CMake.

(Everything is available on the master branch).