Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@
# Makefile
#

CC ?= gcc
CXX ?= g++
CROSS_COMPILE ?= arm-none-linux-gnueabihf-
SYSROOT ?= /home/parallels/lukkey_aarch64_sysroot
Copy link

@cubic-dev-ai cubic-dev-ai bot Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Hardcoded machine-specific SYSROOT path breaks builds on other machines

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At Makefile, line 6:

<comment>Hardcoded machine-specific SYSROOT path breaks builds on other machines</comment>

<file context>
@@ -2,8 +2,11 @@
-CC              ?= gcc
-CXX             ?= g++
+CROSS_COMPILE   ?= arm-none-linux-gnueabihf-
+SYSROOT         ?= /home/parallels/lukkey_aarch64_sysroot
+
+CC              := $(CROSS_COMPILE)gcc
</file context>
Fix with Cubic


CC := $(CROSS_COMPILE)gcc
CXX := $(CROSS_COMPILE)g++
LVGL_DIR_NAME ?= lvgl
LVGL_DIR ?= .

Expand All @@ -13,9 +16,12 @@ WARNINGS := -Wall -Wshadow -Wundef -Wmissing-prototypes -Wno-discarded-qu
-Wno-ignored-qualifiers -Wno-error=pedantic -Wno-sign-compare -Wno-error=missing-prototypes -Wdouble-promotion -Wclobbered -Wdeprecated -Wempty-body \
-Wshift-negative-value -Wstack-usage=2048 -Wno-unused-value -std=gnu99
CFLAGS ?= -O3 -g0 -I$(LVGL_DIR)/ $(WARNINGS)
CFLAGS += --sysroot=$(SYSROOT) -I$(SYSROOT)/usr/include -I$(SYSROOT)/usr/include/drm \
-mcpu=cortex-a7 -mfpu=neon -mfloat-abi=hard -ffast-math
LDFLAGS ?= -lm
LDFLAGS += --sysroot=$(SYSROOT) -L$(SYSROOT)/usr/lib -ldrm -lpthread

BIN = main
BIN = lvgl_v95
BUILD_DIR = ./build
BUILD_OBJ_DIR = $(BUILD_DIR)/obj
BUILD_BIN_DIR = $(BUILD_DIR)/bin
Expand Down
58 changes: 29 additions & 29 deletions lv_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
*====================*/

/** Color depth: 1 (I1), 8 (L8), 16 (RGB565), 24 (RGB888), 32 (XRGB8888) */
#define LV_COLOR_DEPTH 16
#define LV_COLOR_DEPTH 32

/*=========================
STDLIB WRAPPER SETTINGS
Expand All @@ -39,7 +39,7 @@
* - LV_STDLIB_RTTHREAD: RT-Thread implementation
* - LV_STDLIB_CUSTOM: Implement the functions externally
*/
#define LV_USE_STDLIB_MALLOC LV_STDLIB_CLIB
#define LV_USE_STDLIB_MALLOC LV_STDLIB_BUILTIN

/** Possible values
* - LV_STDLIB_BUILTIN: LVGL's built in implementation
Expand Down Expand Up @@ -68,7 +68,7 @@

#if LV_USE_STDLIB_MALLOC == LV_STDLIB_BUILTIN
/** Size of memory available for `lv_malloc()` in bytes (>= 2kB) */
#define LV_MEM_SIZE (64 * 1024U) /**< [bytes] */
#define LV_MEM_SIZE (4 * 1024 * 1024)

/** Size of the memory expand for `lv_malloc()` in bytes */
#define LV_MEM_POOL_EXPAND_SIZE 0
Expand All @@ -87,7 +87,7 @@
*====================*/

/** Default display refresh, input device read and animation step period. */
#define LV_DEF_REFR_PERIOD 33 /**< [ms] */
#define LV_DEF_REFR_PERIOD 10 /**< [ms] 100fps */

/** Default Dots Per Inch. Used to initialize default sizes such as widgets sized, style paddings.
* (Not so important, you can adjust it to modify default sizes and spaces.) */
Expand All @@ -106,7 +106,7 @@
* - LV_OS_MQX
* - LV_OS_SDL2
* - LV_OS_CUSTOM */
#define LV_USE_OS LV_OS_NONE
#define LV_USE_OS LV_OS_PTHREAD

#if LV_USE_OS == LV_OS_CUSTOM
#define LV_OS_CUSTOM_INCLUDE <stdint.h>
Expand All @@ -125,7 +125,7 @@
*========================*/

/** Align stride of all layers and images to this bytes */
#define LV_DRAW_BUF_STRIDE_ALIGN 1
#define LV_DRAW_BUF_STRIDE_ALIGN 16

/** Align start address of draw_buf addresses to this bytes*/
#define LV_DRAW_BUF_ALIGN 4
Expand All @@ -142,7 +142,7 @@
* and can't be drawn in chunks. */

/** The target buffer size for simple layer chunks. */
#define LV_DRAW_LAYER_SIMPLE_BUF_SIZE (24 * 1024) /**< [bytes]*/
#define LV_DRAW_LAYER_SIMPLE_BUF_SIZE (1500 * 1024) /**< [bytes]*/

/* Limit the max allocated memory for simple and transformed layers.
* It should be at least `LV_DRAW_LAYER_SIMPLE_BUF_SIZE` sized but if transformed layers are also used
Expand All @@ -153,7 +153,7 @@
/** Stack size of drawing thread.
* NOTE: If FreeType or ThorVG is enabled, it is recommended to set it to 32KB or more.
*/
#define LV_DRAW_THREAD_STACK_SIZE (8 * 1024) /**< [bytes]*/
#define LV_DRAW_THREAD_STACK_SIZE (32 * 1024) /**< [bytes]*/

/** Thread priority of the drawing task.
* Higher values mean higher priority.
Expand Down Expand Up @@ -191,7 +191,7 @@
/** Set number of draw units.
* - > 1 requires operating system to be enabled in `LV_USE_OS`.
* - > 1 means multiple threads will render the screen in parallel. */
#define LV_DRAW_SW_DRAW_UNIT_CNT 1
#define LV_DRAW_SW_DRAW_UNIT_CNT 2

/** Use Arm-2D to accelerate software (sw) rendering. */
#define LV_USE_DRAW_ARM2D_SYNC 0
Expand All @@ -208,16 +208,16 @@
/** Allow buffering some shadow calculation.
* LV_DRAW_SW_SHADOW_CACHE_SIZE is the maximum shadow size to buffer, where shadow size is
* `shadow_width + radius`. Caching has LV_DRAW_SW_SHADOW_CACHE_SIZE^2 RAM cost. */
#define LV_DRAW_SW_SHADOW_CACHE_SIZE 0
#define LV_DRAW_SW_SHADOW_CACHE_SIZE 24

/** Set number of maximally-cached circle data.
* The circumference of 1/4 circle are saved for anti-aliasing.
* `radius * 4` bytes are used per circle (the most often used radiuses are saved).
* - 0: disables caching */
#define LV_DRAW_SW_CIRCLE_CACHE_SIZE 4
#define LV_DRAW_SW_CIRCLE_CACHE_SIZE 16
#endif

#define LV_USE_DRAW_SW_ASM LV_DRAW_SW_ASM_NONE
#define LV_USE_DRAW_SW_ASM LV_DRAW_SW_ASM_NEON

#if LV_USE_DRAW_SW_ASM == LV_DRAW_SW_ASM_CUSTOM
#define LV_DRAW_SW_ASM_CUSTOM_INCLUDE ""
Expand Down Expand Up @@ -502,11 +502,11 @@

/* Enable assertion failures if an operation fails or invalid data is found.
* If LV_USE_LOG is enabled, an error message will be printed on failure. */
#define LV_USE_ASSERT_NULL 1 /**< Check if the parameter is NULL. (Very fast, recommended) */
#define LV_USE_ASSERT_MALLOC 1 /**< Checks is the memory is successfully allocated or no. (Very fast, recommended) */
#define LV_USE_ASSERT_STYLE 1
#define LV_USE_ASSERT_MEM_INTEGRITY 1
#define LV_USE_ASSERT_OBJ 1
#define LV_USE_ASSERT_NULL 1 /**< Disabled for benchmark performance */
#define LV_USE_ASSERT_MALLOC 1 /**< Disabled for benchmark performance */
#define LV_USE_ASSERT_STYLE 0
#define LV_USE_ASSERT_MEM_INTEGRITY 0
#define LV_USE_ASSERT_OBJ 0

/** Add a custom handler when assert happens e.g. to restart MCU. */
#define LV_ASSERT_HANDLER_INCLUDE <stdint.h>
Expand Down Expand Up @@ -543,11 +543,11 @@
* If size is not set to 0, the decoder will fail to decode when the cache is full.
* If size is 0, the cache function is not enabled and the decoded memory will be
* released immediately after use. */
#define LV_CACHE_DEF_SIZE 0
#define LV_CACHE_DEF_SIZE (512 * 1024)

/** Default number of image header cache entries. The cache is used to store the headers of images
* The main logic is like `LV_CACHE_DEF_SIZE` but for image headers. */
#define LV_IMAGE_HEADER_CACHE_DEF_CNT 0
#define LV_IMAGE_HEADER_CACHE_DEF_CNT 32

/** Number of stops allowed per gradient. Increase this to allow more stops.
* This adds (sizeof(lv_color_t) + 1) bytes per additional stop. */
Expand Down Expand Up @@ -821,7 +821,7 @@

#define LV_USE_LIST 1

#define LV_USE_LOTTIE 1
#define LV_USE_LOTTIE 0

#define LV_USE_MENU 1

Expand Down Expand Up @@ -1049,11 +1049,11 @@
* Requires `LV_USE_MATRIX = 1`
* and a rendering engine supporting vector graphics, e.g.
* (LV_USE_DRAW_SW and LV_USE_THORVG) or LV_USE_DRAW_VG_LITE or LV_USE_NEMA_VG. */
#define LV_USE_VECTOR_GRAPHIC 1
#define LV_USE_VECTOR_GRAPHIC 0

/** Enable ThorVG (vector graphics library) from the src/libs folder.
* Requires LV_USE_VECTOR_GRAPHIC */
#define LV_USE_THORVG_INTERNAL 1
#define LV_USE_THORVG_INTERNAL 0

/** Enable ThorVG by assuming that its installed and linked to the project
* Requires LV_USE_VECTOR_GRAPHIC */
Expand Down Expand Up @@ -1095,7 +1095,7 @@
#define LV_USE_SNAPSHOT 0

/** 1: Enable system monitor component */
#define LV_USE_SYSMON 0
#define LV_USE_SYSMON 1
#if LV_USE_SYSMON
/** Get the idle percentage. E.g. uint32_t my_get_idle(void); */
#define LV_SYSMON_GET_IDLE lv_os_get_idle_percent
Expand All @@ -1109,12 +1109,12 @@

/** 1: Show CPU usage and FPS count.
* - Requires `LV_USE_SYSMON = 1` */
#define LV_USE_PERF_MONITOR 0
#define LV_USE_PERF_MONITOR 1
#if LV_USE_PERF_MONITOR
#define LV_USE_PERF_MONITOR_POS LV_ALIGN_BOTTOM_RIGHT

/** 0: Displays performance data on the screen; 1: Prints performance data using log. */
#define LV_USE_PERF_MONITOR_LOG_MODE 0
#define LV_USE_PERF_MONITOR_LOG_MODE 1
#endif

/** 1: Show used memory and memory fragmentation.
Expand Down Expand Up @@ -1295,7 +1295,7 @@
#endif

/** Driver for /dev/fb */
#define LV_USE_LINUX_FBDEV 1
#define LV_USE_LINUX_FBDEV 0
#if LV_USE_LINUX_FBDEV
#define LV_LINUX_FBDEV_BSD 0
#define LV_LINUX_FBDEV_RENDER_MODE LV_DISPLAY_RENDER_MODE_PARTIAL
Expand Down Expand Up @@ -1346,7 +1346,7 @@
#endif

/** Driver for /dev/dri/card */
#define LV_USE_LINUX_DRM 0
#define LV_USE_LINUX_DRM 1

#if LV_USE_LINUX_DRM

Expand All @@ -1369,7 +1369,7 @@
#endif /*LV_USE_LOVYAN_GFX*/

/** Driver for evdev input devices */
#define LV_USE_EVDEV 1
#define LV_USE_EVDEV 0

/** Driver for libinput input devices */
#define LV_USE_LIBINPUT 0
Expand Down Expand Up @@ -1469,7 +1469,7 @@

#if LV_USE_DEMO_BENCHMARK
/** Use fonts where bitmaps are aligned 16 byte and has Nx16 byte stride */
#define LV_DEMO_BENCHMARK_ALIGNED_FONTS 0
#define LV_DEMO_BENCHMARK_ALIGNED_FONTS 1
#endif

/** Render test for each primitive.
Expand Down
7 changes: 3 additions & 4 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ static void configure_simulator(int argc, char **argv)
const char *env_w = getenv("LV_SIM_WINDOW_WIDTH");
const char *env_h = getenv("LV_SIM_WINDOW_HEIGHT");
/* Default values */
settings.window_width = atoi(env_w ? env_w : "800");
settings.window_height = atoi(env_h ? env_h : "480");
settings.window_width = 480;
Copy link

@cubic-dev-ai cubic-dev-ai bot Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1: Environment variables LV_SIM_WINDOW_WIDTH/HEIGHT are read but never used, leaving dead code and silently breaking deployments that rely on env var window sizing. The variables env_w and env_h have no effect on the program.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/main.c, line 85:

<comment>Environment variables LV_SIM_WINDOW_WIDTH/HEIGHT are read but never used, leaving dead code and silently breaking deployments that rely on env var window sizing. The variables env_w and env_h have no effect on the program.</comment>

<file context>
@@ -82,8 +82,8 @@ static void configure_simulator(int argc, char **argv)
     /* Default values */
-    settings.window_width = atoi(env_w ? env_w : "800");
-    settings.window_height = atoi(env_h ? env_h : "480");
+    settings.window_width = 480;
+    settings.window_height = 800;
 
</file context>
Fix with Cubic

settings.window_height = 800;

/* Parse the command-line options. */
while ((opt = getopt (argc, argv, "b:fmW:H:BVh")) != -1) {
Expand Down Expand Up @@ -150,8 +150,7 @@ int main(int argc, char **argv)
#endif

/*Create a Demo*/
lv_demo_widgets();
lv_demo_widgets_start_slideshow();
lv_demo_benchmark();

/* Enter the run loop of the selected backend */
driver_backends_run_loop();
Expand Down
Loading