How to use lvgl on pc386 BSP.

Karel Gardas karel.gardas at centrum.cz
Fri Sep 18 21:51:49 UTC 2020


Hello Christian,

On 9/7/20 6:22 PM, Christian Mauderer wrote:
> Depending on your application, you might want to think about switching
> to the current master instead of the release. But note that I didn't
> compile the PC BSP there. So I'm not sure how well it works. i386 is
> normally not a platform that I use for RTEMS applications.

I've found some time to experiment more with fb on pc686 using
libbsd/littlevgl/example combo -- all projects with master branch
checkout as of today.

It looks like the reason why the demo was not working for me last time
was that framebuffer device can't be open. I've digged more and the
reason is that the device is missing due to example missing #define
CONFIGURE_APPLICATION_NEEDS_FRAME_BUFFER_DRIVER in its code.

The reason BBB was/is working is that it's using fb driver from libbsd,
but pc686 is using fb driver directly from BSP hence app needs to show
interest in using it this way I guess.

So after small fix, I've been (app was) able to open fb0, but then
output shows very strange values for x and y of screen. This was due to
fact that lvgl is using libbsd fb API by default, but pc686 provides
minimalistic linux API. So I've switched to linux with small patch to
lvgl and then found out that lvgl is using more rich linux API than
implemented by the pc686 VBE fb driver. So yet another patch to pc686 to
make lvgl compilable and I was able to get real values from the
fbdev_init lvgl function. Unfortunately function fails on me with error
that mmap of framebuffer is not suported.

Whole demo output looks:

i386: isr=0 irr=1
i386: isr=0 irr=1
FB_VESA_RM frame buffer -- driver initializing..


RTEMS LVGL HELLO WORLD

nexus0: <RTEMS Nexus device>
pcib0 pcibus 0
pci0: <PCI bus> on pcib0
pci0: <bridge, HOST-PCI> at device 0.0 (no driver attached)
pci0: <bridge, PCI-ISA> at device 1.0 (no driver attached)
pci0: <mass storage, ATA> at device 1.1 (no driver attached)
pci0: <bridge> at device 1.3 (no driver attached)
pci0: <display, VGA> at device 2.0 (no driver attached)
pci0: <network, ethernet> at device 3.0 (no driver attached)
cpu0
FB_VESA_RM open device
The framebuffer device was opened successfully.
FB_VESA_RM ioctl called, cmd=4602
fbxres 1024, fbyres 768
fbbpp 32
FB_VESA_RM ioctl called, cmd=4600
fbxres 1024, fbyres 768
fbbpp 32
1024x768, 32bpp
3145728 screen size.
Error: failed to map framebuffer device to memory: Not supported


All patches required to get here are attached for your reference.

Any idea why mmaping RTEMS /dev/fb0 fails is highly appreciated.

Thanks,
Karel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rtems-examples-lvgl-fix.diff
Type: text/x-patch
Size: 3140 bytes
Desc: not available
URL: <http://lists.rtems.org/pipermail/devel/attachments/20200918/35f07464/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: littlevgl-conf-fix.diff
Type: text/x-patch
Size: 792 bytes
Desc: not available
URL: <http://lists.rtems.org/pipermail/devel/attachments/20200918/35f07464/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lv_drivers-rtems-fix.diff
Type: text/x-patch
Size: 759 bytes
Desc: not available
URL: <http://lists.rtems.org/pipermail/devel/attachments/20200918/35f07464/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rtems-fb-enhance-api.diff
Type: text/x-patch
Size: 1454 bytes
Desc: not available
URL: <http://lists.rtems.org/pipermail/devel/attachments/20200918/35f07464/attachment-0003.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: libbsd-compilation-fix.diff
Type: text/x-patch
Size: 1523 bytes
Desc: not available
URL: <http://lists.rtems.org/pipermail/devel/attachments/20200918/35f07464/attachment-0004.bin>


More information about the devel mailing list