Baremetal Pi4 (circle) - dual display

I have built a bare metal c++ application using circle with the lvgl add-on. All is working well for the touchscreen display. I am attempting to add a second display using the Pi4’s HDMI outputs and although I can instantiate the second screen and initialize it, and output to it using circle’s libraries, my kernel will not boot if I instantiate a second LVGL object using the second frame buffer. My only real question at this point is “Is there any specific reason why I shouldn’t be able to instantiate a second LVGL object?”. Or am I missing the point entirely? Is it possible to address two separate displays (not mirrored) using a single LVGL object? I don’t know how I would switch the frame buffers if that’s the case.

Thanks everyone.

By object, I assume you mean widget (with the v7 terminology). You cannot draw the same widget on two displays, however, creating a separate widget for each display should work fine. As you have determined, that’s the whole point of multi-display support.

No, sorry. What I mean is I can’t instantiate a second object of the CLVGL class in circle:

class CLVGL
{
public:
CLVGL (CScreenDevice *pScreen, CInterruptSystem *pInterrupt);
CLVGL (CBcmFrameBuffer *pFrameBuffer, CInterruptSystem *pInterrupt);
~CLVGL (void);

}

If it helps explain this in any way, it doesn’t appear that I can create a uGUI class on the second display either. Or two uGUIs, etc. I’m suspecting there’s an issue with DMA, but I’m afraid I’m a bit out of my comfort zone with this. I’m still learning.

CLVGL is a Circle class, not ours, so you would be probably better off asking this question there. I will check their implementation though and see if I find anything.

It looks like CLVGL was designed with one and only one display in mind, as CLVGL::Initialize calls lv_init, meaning instantiating two classes of that will not work.

Aaah, brilliant. Thanks so much for confirming that. Looks like I have a little more research to do. It’s actually a relief that its failing by design rather than my own poor coding. LOL.

Cheers.

It looks like the same technique is being used for uGUI, hence why you are getting the same problem.

The only workaround I can suggest would be to manually register the second display yourself using standard LVGL calls, but that could potentially interfere with Circle later on, especially if you are just using drivers it provides.

Understood. That may be where I will eventually end up, as this entire exercise is about learning anyway. There’s no specific end-goal here.