Thermostat Demo source

I’m looking for the project files for the thermostat demo on the SLS website.It is not in the examples in SLS 1.2.0 or 1.1.1.
Are there other sites for the project demos?

I can see it in examples for 1.2.0

Sure, but resolution and features are a little bit different. No, not really similar.

If you mean this one, then I think it was made by Espressif for this article and I guess that SLS does not have files for that project.

Thanks, that is also similar.
The demo can’t be linked directly, I mean this one:
grafik

320x240, so fits perfect on a cheap TFT display.

Hi,

I’ve attached the 320x240 version:
Thermostat_320x240.zip (88.2 KB)

1 Like

great, thanks!

I can compile and start this demo, but then it fails with a memory assertion. I was trying to use it on a STM32F303CC (RobotDyn Blackpill) with 256 kB Flash / 48 kB RAM. The lv_mem_size is set to 26 kB, the max available.Its just for testing, I know I should use a MCU with more RAM.
The screen is built in memory, and displays part of it. It stops when it comes to drawing the arc.
I know there is a memory logging option, but this will need some memory for itself also. Is there some analysis of the object tree in SLS? It should be known how much space is needed in SLS already?

I haven’t tried the thermostat demo with such a small MCU.

However, I’ve configured the Smart Gadget demo of SquareLine for a similar MCU in GitHub - lvgl/lv_port_stm_nucleo_g071rb: LVGL ported to ST's NUCLEO G071RB board
It’s really tight and it was very difficult to squeeze that demo into 48 kB.

To save some RAM

  • try using smaller draw buffer(s)
  • set LV_USE_USER_DATA 0

It’s hard to guess the memory usage from seeing the widgets only. Now working on higher priority features but we were also thinking about this feature too.

I have just checked again, I think the size of objects is not the problem. There is a shadow style and this is causing an expensive operation: it wants a buffer of objects size which is 112 * 112 * sizeof(lv_color_t)=25088 bytes. This is not available from the heap.

The draw buffer is already in the separate 8 kB CCM region, the 48 kB are split into 40 kB SRAM and 8 kB CCM, but not consequtive. And I need also the user data for C++ this pointers.

So I will later try to remove the shadow. Enabling draw simple works also, but then round meter becomes a square, not looking nice :slight_smile:

edit:
yes, it works when I remove the shadow effect from gauge.
Then I wanted to enable logging or display memory stats, but both failed due to low memory. So its not fun with this target, only simple graphics will run.

But lvgl is still great, its easier to grab a MCU with more memory than writing some optimized special gui.

Oh, yes. the shadow rendering requires a lot of RAM. :confused:

You really need to careful if you design a UI for 48 kB RAM.