What do you want to achieve?
Added 2 new screens to project. All good until I add the switches or sliders.
What have you tried so far?
Added 10 switches initially to mimic a dipswitch setting. After Exporting UI, the LCD would just flash on and off with bright white. So I deleted the new page and re-exported. All good now, so I chalked it up to something that I must have done. Since the switches are not rotatable (at least not easily) I opted for Sliders with range of 0-1. Those were able to be oriented in an up-down fashion. After creating the new page with these, i once again exported and this time just a black screen. Removed the sliders finally and just put a textarea and that works fine but not what i wanted as i now have to have a keyboard on the screen. Thought it may have been an LVGL memory issue or Heap size issue, but increasing both substantially changes nothing. In total I have 12 screens and plan on adding several more. Am i hitting a limit or something or is this a bug?
Screenshot or video
SquareLine Studio version:
1.3.0 (but tried 1.2.2 and 1.2.3 with same result.
Operating system: - Win 11
Target hardware: - ESP32S3 on a WT32-SC01-PLUS Board.
Maybe your idea with many screens and more widgets isnt good. You dont write if use Arduino or clean IDF ESP. If for example Arduino leave for your GUI 100k memory and one widget is around 200bytes simply = limit is 500 widgets
But i mean here isnt problem limits , but some other issue, you need debug and locate …
Sorry, Im using Platformio with VScode
I have the current working version on the repo, maybe i can post the project once it does the same thing as before. Tried it twice but same result. If I remove the switches or sliders then the screen loads fine. Also tried changing from “Desktop” to “Arduino” with tft_spi selected. If i do that, it will change the size of the screen and I have to fix it, but afterwords looks fine. Loads well, but as soon as i add the 10 switches or sliders it wont load more… here is the repo: GitHub - OzInFl/CLIPPER1: SubGhz, Wifi and Bluetooth Tool - Able to play .sub files from the FlipperZero - Protocol Analysis, Etc...
Once i get back home, ill create a folder in the repo for the non working version, not sure what else to debug honestly.
I zipped up the problematic project. I cant figure out why after adding the switches it will no longer load. Im going to remove one switch at a time and see how that affects it…
Link to project: CLIPPER1/lcd_FailsToLoad.zip at main · OzInFl/CLIPPER1 · GitHub
Definitely is memory related. turned on some debug functions on the lvgl and deleted some unnecessary pages. Will need to rethink the design a bit… but seems to be memory related in respect to LVGL. Got rid of some graphics as well and will opt for text instead.
Squareline isnt very optimal for “big” projects, all objects is preloaded and maybe you have duplicates on mor screens. I can only recommend create every design same object only one time and move it between screens with set parent func.
Duplicate only strictly required parts. Next variant is split project to two UI and for example before transition screen5 to 6 unload completely 1-5 and load 6-…
But i mean with some little optimizztions you can use one .
And i dont mean remove graphics help, but you can try.
I have similar situation and results and not getting far with help. I have 11 screens and initially had to reduce it to 3 to load and work, now I managed to get 5 screens working but no more. I also use ESP32 S3 with 2MB PSRAM but it makes no difference if I activate it or not. I have been suggested by people to find the cause of the fault and if I could then I would not be here so that is not very helpful. Nothing reports fault anywhere, well sometimes it does when I remove screens then the links to those have to be removed in the ncreens or widegets to get it working.
Before I even found wrongly generated code that made no sence at all and removed the widget that was generating it and then it was good but that was before I hit this screen limitation issue. I am doing some experimentation with the number of widgets to see if the number of screens is the issue or the number of widgets.
I do not see any info about how the memory is managed between loading and unloading screens with SLS. My deadline is coming closer each day and cannot get anywhere with this. I have seen some of the sample projects having as many widgets in one sceen as I have on 5 so if that is the case SLS is not very efficient. In the simulator everything works perfectly, on the device it is blank screen or the flash screen and showing the core dump and resets every second or so like the ones you are experiencing.
How many widgets do you have in your project? I have 350 on 11 screens and around 130 on first 5 screens and that loads and works fine. A also deleted randomly screens and with 5 it was working no matter which 5 remained.
We cannot make a good looking project if we cannot put enought widgets and that is shown by SLS own sample projects.
yes, it is memory related for sure and cannot make a decent looking project with this problem.
I had 12 Screens with 174 widgets between them, the last screen that I made had 12 Switches and 12 Labels beside them with about 3 or 4 other buttons on that screen. So what I did was change the LV_MEM_SIZE in lv_conf.h to (64U * 1024U) tried 96U * 1024U but think it was too much, just got blank screen, this was AFTER I started removing switches off of last screen then when about half of them were removed, it started loading again. Since then I also changed the LV_MEM_BUF_MAX_NUM from 16 to 32 (not sure if this is needed ). Was thinking about calling separate init and unload functions for the screens so the widgets are created and removed dynamically, but its going to change the workflow significantly. I’m also using ESP32-S3 MCU that is on the WT32-SC01-PLUS board. also set the default font to monserrat12 i think so the defrag text was small and turned on the Monitor for memory and fragmentation (LV_USE_MEM_MONITOR=1 in lv_conf.h) as well as adding (# define LV_MEM_AUTO_DEFRAG 1) although I’m not sure if it helps a ton, still see fragmentation, but maybe not as much. After this I seemed to run at about 88% memory usage and fragmentation was fairly low, usually below 20. Removing background graphics didn’t seem to do much, but should use less flash in the ESP32.
I had reduced my 11 screen project to 7 and dramatically reduced the number of widgets by more then half which would render the project unusable. Tried it that way but I had the continuous resetting situation.
Then I change #define LV_MEM_SIZE (48U * 1024U) to to #define LV_MEM_SIZE (96U * 1024U) as you suggested. After this the it would load and could managed to change screens but on one or two buttons it froze the screen. It was caused by the same buttons every time.
After this I installed the latelst SLS1.3.1 and tried it initialli with the default LV_MEM_SIZE and it loaded the project but had the same button locking.
Next step was to introduce your suggestion but I increased the memory size to #define LV_MEM_SIZE (96U * 1024U). With this the project loaded and worked flawlessly, at least the GUI part of it since I did not add any other code to it yet.
Next step is to go back to the original 11 screen project and see how that will go.
I took it a bit further still, I did (128U * 1024U). Also enabled the memory monitor in the lvgl.conf so as to see the memory being used, with sls1.3.1 and setting most of my screens to temp as they are loaded usually with a button click from another page and saw the 80% memory with default settings down to 20% with the 128 setting, also turned on auto defrag and it looks much better! however i am finding that there are some functions that used to work when hitting a button that now cause the MCU to reset, Im trying to narrow those down, also seeing some freezes in the UI (this is with the 2 new screens that I had added when i got the issue. Other than that It seems much better.