How to cut LVGL?

Hi, kisvegabor.


I have used lv_port_linux_frame_buffer’s demo to create my project in Linux system.Unfortunately, the executable file I compiled is so large.I have tried to turn off the log, file system, themes and some wigets. Only the wigets needed for the demo are left.But, The executable file size is over 250 kb;

What MCU/Processor/Board and compiler are you using?


What LVGL version are you using?

using 7.4.0

What do you want to achieve?

How to cut lvgl so that the size of the compiled executable file is less than 100kb?


Linux executables are generally larger than the equivalent bare-metal program. As an example, an program with one printf("Hello\n") statement requires 8 kilobytes when compiled for Arm Linux.

You could try using <toolchain prefix>-nm --print-size --size-sort <executable> to find out what parts of the code are taking up so much space.

I tried it and the result is
000a131b 00000001 b already_running.7239
000a1334 00000001 b anim_list_changed
00051190 00000001 b completed.10738
000a1328 00000001 b idle_last
00ca1378 00000001 b inited
000a11c8 00000001 b lv_initialized
000a131c 00000001 b lv_task_run
000a12e8 00000001 b prev_opa.9772
000a12fc 00000001 b rle_bpp
000a1309 00000001 b rle_cnt
000a1308 00000001 b rle_prev_v
000a1319 00000001 b task_created
000a131a 00000001 b task_deleted
000a1318 00000001 b task_list_changed
000a1310 00000001 b tick_irq_flag
000a12f0 00000002 b entry_cnt
000a134c 00000002 b full_defrag_cnt.7264
0003d52c 00000002 R _lv_bpp1_opa_table
00ca1370 00000004 b act_theme
00ca13a8 00000004 b ancestor_signal
000a1324 00000004 b busy_time.7242
000a12f4 00000004 b decompr_buf
000a130c 00000004 b disp_def
000a11d4 00000004 b disp_refr
00051124 00000004 d elaps_max.10019
00ca1630 00000004 B evdev_button
00ca1638 00000004 B evdev_fd
00ca162c 00000004 B evdev_key_val
00ca163c 00000004 B evdev_root_x
00ca1634 00000004 B evdev_root_y
000a11d0 00000004 b event_act_data
000a11cc 00000004 b event_temp_data_head
00ca14a0 00000004 b fbfd
00ca14a4 00000004 b fbp
000a1320 00000004 b handler_start.7241
000a132c 00000004 b idle_period_start.7240
00ca13ac 00000004 b indev_act
00ca13b0 00000004 b indev_obj_act
0003d3e0 00000004 R _IO_stdin_used
000a133c 00000004 b last_task_run
0003d3d0 00000004 T __libc_csu_fini
000a1338 00000004 b _lv_anim_task
0003d528 00000004 R _lv_bpp2_opa_table
000207dc 00000004 T lv_draw_px
00ca14c8 00000004 B _lv_img_cache_array
00034684 00000004 T lv_label_set_text_sel_end
00034680 00000004 T lv_label_set_text_sel_start
000122f0 00000004 t lv_obj_del_async_cb
00016bd8 00000004 T _lv_refr_init
00ca14c0 00000004 B _lv_task_act
00ca14cc 00000004 B _lv_theme_empty_styles
00ca15a8 00000004 B _lv_theme_material_styles
00ca14d0 00000004 B _lv_theme_mono_styles
00ca14c4 00000004 B _lv_theme_template_styles
00027cf0 00000004 T lv_tick_get
00051180 00000004 D _lv_txt_encoded_conv_wc
00051174 00000004 D _lv_txt_encoded_get_byte_id
00051170 00000004 D _lv_txt_encoded_get_char_id
0005117c 00000004 D _lv_txt_encoded_next
00051178 00000004 D _lv_txt_encoded_prev
00051188 00000004 D _lv_txt_encoded_size
0005116c 00000004 D _lv_txt_get_encoded_length
00051184 00000004 D _lv_txt_unicode_to_encoded
0003c17c 00000004 T lv_vsnprintf
000a1344 00000004 b mem_max_size
0003ad04 00000004 t _out_null
000a11dc 00000004 b perf_label.10015
000a11e0 00000004 b perf_last_time.10018
000a12ec 00000004 b prev_bpp.9773
000a11d8 00000004 b px_num
000a12f8 00000004 b rle_in
000a1304 00000004 b rle_rdp
000a1300 00000004 b rle_state
00ca1374 00000004 b styles
000a1314 00000004 b sys_time
000a1330 00000004 b time_till_next.7243
000a1340 00000004 b work_mem
000a1348 00000004 b zero_mem
0003d408 00000006 r CSWTCH.52
0003d588 00000008 r CSWTCH.58
00050f08 00000008 D lv_anim_path_def
0003d520 00000008 R _lv_bpp3_opa_table
00019734 00000008 T lv_debug_check_style
0001973c 00000008 T lv_debug_check_style_list
00027904 00000008 T lv_disp_get_buf
00025fb8 00000008 T lv_font_get_glyph_bitmap
00025fc0 00000008 T lv_font_get_glyph_dsc
00024af0 00000008 T lv_img_decoder_set_close_cb
00024ad8 00000008 T lv_img_decoder_set_info_cb
00024ae0 00000008 T lv_img_decoder_set_open_cb
00024ae8 00000008 T lv_img_decoder_set_read_line_cb
00036fa0 00000008 T lv_indev_get_gesture_dir
00035c7c 00000008 T lv_label_get_text_sel_end
00035c74 00000008 T lv_label_get_text_sel_start
000122e8 00000008 T lv_obj_del_anim_ready_cb
00012c04 00000008 T lv_obj_get_base_dir
0001526c 00000008 T lv_obj_get_design_cb
00015274 00000008 T lv_obj_get_event_cb
0001527c 00000008 T lv_obj_get_ext_attr
00011c18 00000008 T lv_obj_get_ext_click_pad_bottom
00011c00 00000008 T lv_obj_get_ext_click_pad_left
00011c08 00000008 T lv_obj_get_ext_click_pad_right
00011c10 00000008 T lv_obj_get_ext_click_pad_top
00011c20 00000008 T lv_obj_get_ext_draw_pad
00015430 00000008 T lv_obj_get_group
00011698 00000008 T lv_obj_get_parent
00013318 00000008 T lv_obj_get_protect
00015264 00000008 T lv_obj_get_signal_cb
00015438 00000008 T lv_obj_is_focused
00011650 00000008 T lv_obj_set_design_cb
000114e8 00000008 T lv_obj_set_event_cb
00011628 00000008 T lv_obj_set_signal_cb
00017cfc 00000008 T lv_style_init
00017d04 00000008 T lv_style_list_init
00028838 00000008 T lv_task_set_cb
00028dc8 00000008 T lv_task_set_period
00028e3c 00000008 T lv_task_set_repeat_count
0002cf20 00000008 T lv_theme_set_apply_cb
0002cf18 00000008 T lv_theme_set_base
000511c0 00000008 b start_ms.14313
0003d554 0000000b r CSWTCH.30
00ca1584 0000000c B _lv_anim_ll
00ca159c 0000000c B _lv_disp_ll
00ca1590 0000000c B _lv_drv_ll
00011608 0000000c T lv_event_send_refresh
00ca14b4 0000000c B _lv_file_ll
00ca156c 0000000c B _lv_group_ll
00ca14d4 0000000c B _lv_img_defoder_ll
000370f0 0000000c T lv_indev_get_read_task
00036d94 0000000c T lv_indev_get_type
00036eb8 0000000c T _lv_indev_init
00ca14e0 0000000c B _lv_indev_ll
0002ae28 0000000c T _lv_ll_get_head
0002ae34 0000000c T _lv_ll_get_tail
00012b8c 0000000c T lv_obj_get_adv_hittest
00011bf4 0000000c T lv_obj_get_auto_realign
00012b98 0000000c T lv_obj_get_click
00012bb0 0000000c T lv_obj_get_drag
00012bbc 0000000c T lv_obj_get_drag_dir
00012bd4 0000000c T lv_obj_get_drag_parent
00012bc8 0000000c T lv_obj_get_drag_throw
00012bec 0000000c T lv_obj_get_focus_parent
00012be0 0000000c T lv_obj_get_gesture_parent
00012088 0000000c T lv_obj_get_hidden
00012bf8 0000000c T lv_obj_get_parent_event
00012ba4 0000000c T lv_obj_get_top
00ca14a8 0000000c B _lv_obj_style_trans_ll
00ca1578 0000000c B _lv_task_ll
0003acf8 0000000c t _out_buffer
0003d20c 00000010 W __aeabi_idiv0
0003d20c 00000010 W __aeabi_ldiv0
00050ed0 00000010 d kern_classes
0003d510 00000010 R _lv_bpp4_opa_table
00027614 00000010 T lv_disp_get_default
0002790c 00000010 T lv_disp_get_inv_buf_size
00036d84 00000010 T lv_indev_get_act
00036f54 00000010 T lv_indev_set_button_points
000346dc 00000010 T lv_label_get_anim_speed
00036498 00000010 T lv_label_get_style
00034688 00000010 T lv_label_get_text
0002ae54 00000010 T _lv_ll_get_prev
000114c8 00000010 T lv_obj_add_protect
000114d8 00000010 T lv_obj_clear_protect
0001203c 00000010 T lv_obj_get_local_style
0001140c 00000010 T lv_obj_set_adv_hittest
000113dc 00000010 T lv_obj_set_auto_realign
0001141c 00000010 T lv_obj_set_click
00011498 00000010 T lv_obj_set_drag_parent
00011488 00000010 T lv_obj_set_drag_throw
000114a8 00000010 T lv_obj_set_gesture_parent
000114b8 00000010 T lv_obj_set_parent_event
0001142c 00000010 T lv_obj_set_top
00016df4 00000010 T _lv_refr_get_disp_refreshing
0002ca58 00000010 T lv_theme_get_act
00ca1360 00000010 b mem_buf1_32
00ca1350 00000010 b mem_buf2_32
0005115c 00000010 d mem_buf_small
00010a18 00000010 t opa_scale_anim
000147dc 00000010 t opa_scale_anim
00026030 00000010 t unicode_list_compare
0003c9a0 00000014 T fbdev_exit
00027d44 00000014 T lv_area_set_height
00027d30 00000014 T lv_area_set_width
000278c8 00000014 T lv_disp_flush_is_last
000278b4 00000014 T lv_disp_flush_ready
00027600 00000014 T lv_disp_set_default
00011614 00000014 T lv_event_get_data
00051128 00000014 D lv_font_montserrat_12
00036fa8 00000014 T lv_indev_get_key
000370dc 00000014 T lv_indev_get_obj_act
000370c8 00000014 T lv_indev_wait_release
00034698 00000014 T lv_label_get_long_mode
000346c8 00000014 T lv_label_get_recolor
0002ae40 00000014 T _lv_ll_get_next
0001523c 00000014 T lv_obj_add_state
00015250 00000014 T lv_obj_clear_state
000113c8 00000014 T lv_obj_del_async
00011764 00000014 T lv_obj_get_child
00011a60 00000014 T lv_obj_get_child_back
00013320 00000014 T lv_obj_is_protected
000171d4 00000014 T _lv_refr_set_disp_refreshing
00028e58 00000014 T lv_task_enable
00028eb0 00000014 T lv_task_get_idle
00028e44 00000014 T lv_task_reset
0002ca44 00000014 T lv_theme_set_act
00027cf4 00000014 T lv_tick_elaps
00029a7c 00000018 T lv_anim_path_step
0003ace0 00000018 T lv_color_to_hsv
00036eec 00000018 T lv_indev_enable
00011bdc 00000018 T lv_obj_get_height
00011bc4 00000018 T lv_obj_get_width
00018d18 00000018 T _lv_style_list_get_transition_style
0002cf88 00000018 T lv_theme_get_color_primary
0002cfa0 00000018 T lv_theme_get_color_secondary
0002cfb8 00000018 T lv_theme_get_flags
0002cf40 00000018 T lv_theme_get_font_normal
0002cf28 00000018 T lv_theme_get_font_small
0002cf58 00000018 T lv_theme_get_font_subtitle
0002cf70 00000018 T lv_theme_get_font_title
0001206c 0000001c t fade_in_anim_ready
000346ac 0000001c T lv_label_get_align
0002ad6c 0000001c T _lv_ll_init
00011658 0000001c T lv_obj_allocate_ext_attr
00017eb8 0000001c T lv_style_reset
0003d1b0 00000020 T __aeabi_idivmod
0003cf70 00000020 T __aeabi_uidivmod
0005113c 00000020 d font_dsc
00026010 00000020 t kern_pair_16_compare
00025ff0 00000020 t kern_pair_8_compare
0002c944 00000020 t lv_async_task_cb
0002794c 00000020 T lv_disp_is_double_buf
0003445c 00000020 t lv_label_set_offset_x
0003443c 00000020 t lv_label_set_offset_y
0001204c 00000020 T lv_obj_remove_style_local_prop
00011468 00000020 T lv_obj_set_drag_dir
000113ec 00000020 T lv_obj_set_ext_click_area
00011630 00000020 T lv_signal_send
00028e1c 00000020 T lv_task_ready
0003d530 00000021 r wcorr.10112
00051198 00000024 b disp_buf.14305
00027da4 00000024 T lv_area_get_size
00010ae4 00000024 T lv_disp_get_layer_sys
00010ac0 00000024 T lv_disp_get_layer_top
00011070 00000024 T _lv_disp_get_refr_task
00010a28 00000024 T lv_disp_get_scr_act
00010a4c 00000024 T lv_disp_get_scr_prev
00010a70 00000024 T lv_disp_load_scr
000115e4 00000024 T lv_event_send
00036fbc 00000024 T lv_indev_is_dragging
00011674 00000024 T lv_obj_refresh_ext_draw_pad
000146d4 00000024 T lv_obj_reset_style_list
000132f4 00000024 T lv_obj_set_height
000132d0 00000024 T lv_obj_set_width
00012518 00000024 T lv_obj_set_x
0001253c 00000024 T lv_obj_set_y
00027ccc 00000024 T lv_tick_inc
00050ee0 00000028 d cmaps
00027d08 00000028 T lv_area_set
000278dc 00000028 T lv_disp_get_next
00011048 00000028 T lv_disp_trig_activity
00025fc8 00000028 T lv_font_get_glyph_width
000254fc 00000028 T lv_img_buf_free
00023dac 00000028 T lv_img_cf_has_alpha
00027c1c 00000028 T lv_indev_get_next
00036ec4 00000028 T lv_indev_reset_long_press
00029f40 00000028 T _lv_mem_get_size
000116a0 00000028 T lv_obj_get_screen
00011b74 00000028 T lv_obj_get_x
00011b9c 00000028 T lv_obj_get_y
00018cf0 00000028 T lv_style_list_get_local_style
00028ec4 00000028 T lv_task_get_next
0003c628 00000028 T map
0001139c 0000002c T lv_deinit
000275d4 0000002c T lv_disp_buf_init
000277e4 0000002c T lv_disp_get_antialiasing
0001101c 0000002c T lv_disp_get_inactive_time
00022404 0000002c T lv_draw_line_dsc_init
00027558 0000002c T _lv_font_clean_up_fmt_txt
00023d50 0000002c T lv_img_cf_get_px_size
0001143c 0000002c T lv_obj_set_drag
0003c150 0000002c T lv_snprintf
00010a94 0000002c t scr_load_anim_start
00ca137c 0000002c b theme
00027810 00000030 T lv_disp_get_dpi
0002791c 00000030 T _lv_disp_pop_from_inv_buf
00023d7c 00000030 T lv_img_cf_is_chroma_keyed
0002ac50 00000030 T _lv_mem_deinit
00024aa4 00000034 T lv_img_decoder_delete
00027af8 00000034 T lv_indev_drv_init
0002b17c 00000034 T _lv_ll_is_empty
00029a94 00000034 T _lv_mem_init
00011ecc 00000034 T lv_obj_clean_style_list
0002796c 00000038 T lv_disp_is_true_double_buf
00023d18 00000038 T lv_draw_img_dsc_init
00024a6c 00000038 T lv_img_decoder_create
00024174 00000038 T lv_img_src_get_type
00034648 00000038 T lv_label_set_align
00035994 00000038 T lv_label_set_recolor
0001b6ec 0000003c T lv_draw_mask_remove_id
00036f64 0000003c T lv_indev_get_point
00036fe0 0000003c T lv_indev_get_vect
000122f4 0000003c T lv_obj_clean
0001665c 0000003c T lv_obj_get_focused_obj
0002c4e0 0000003c T _lv_sqrt
00028ef0 00000040 T lv_anim_path_linear
00027bdc 00000040 T lv_indev_drv_update
00035c34 00000040 T lv_label_set_anim_speed
0002b084 00000040 T _lv_ll_get_len
00013334 00000040 T lv_obj_get_state
000129a0 00000040 T lv_obj_realign
00017f60 00000040 T lv_style_copy
00ca13b8 00000044 b finfo
00010b08 00000044 T lv_disp_assign_screen
0002af9c 00000044 T _lv_ll_clear
000137fc 00000044 T lv_obj_get_height_fit
0001390c 00000044 T lv_obj_get_height_margin
00013774 00000044 T lv_obj_get_width_fit
00013884 00000044 T lv_obj_get_width_margin
000137b8 00000044 T lv_obj_set_height_fit
000138c8 00000044 T lv_obj_set_height_margin
00013730 00000044 T lv_obj_set_width_fit
00013840 00000044 T lv_obj_set_width_margin
00028e6c 00000044 T _lv_task_core_init
000295c8 00000048 T lv_anim_speed_to_time
000276bc 00000048 T lv_disp_get_hor_res
00027704 00000048 T lv_disp_get_ver_res
000241ac 00000048 T lv_img_decoder_built_in_close
000249d8 00000048 T lv_img_decoder_read_line
000366e0 00000048 T lv_label_cut_text
000128ec 00000048 T lv_obj_align_mid_x
000128a4 00000048 T lv_obj_align_mid_y
00011a74 00000048 T lv_obj_count_children
00011c28 00000048 T lv_obj_get_style_list
000154a0 00000048 T lv_obj_hittest
00027d58 0000004c T _lv_area_set_pos
00024a20 0000004c T lv_img_decoder_close
00014744 0000004c T _lv_obj_set_style_local_color
000146f8 0000004c T _lv_obj_set_style_local_int
00014790 0000004c T _lv_obj_set_style_local_opa
000147ec 0000004c T _lv_obj_set_style_local_ptr
0002c61c 0000004c T _lv_pow
00017cb0 0000004c T lv_refr_now
00028dd0 0000004c T lv_task_create
00028130 00000050 T _lv_area_is_on
00027584 00000050 T lv_disp_drv_init
00036f04 00000050 T lv_indev_set_cursor
0002ad88 00000050 T _lv_ll_ins_head
0002add8 00000050 T _lv_ll_ins_tail
0002c668 00000050 T _lv_map
00014634 00000050 T lv_obj_add_style
00011abc 00000050 T lv_obj_count_children_recursive
00011abc 00000050 t lv_obj_count_children_recursive.localalias.17
00014684 00000050 T lv_obj_remove_style
0002b1b0 00000050 t lv_txt_utf8_size
000109c8 00000050 t scr_anim_ready
0003a97c 00000054 T lv_color_darken
00035868 00000054 T lv_label_set_text_static
00013a14 00000054 T lv_obj_get_height_grid
000139c0 00000054 T lv_obj_get_width_grid
00027e34 00000058 T _lv_area_join
0003a924 00000058 T lv_color_lighten
000207e0 00000058 T lv_draw_label_dsc_init
000121bc 00000058 T lv_obj_invalidate_area
0002cec0 00000058 T lv_theme_copy
0002b200 00000058 t lv_txt_utf8_conv_wc
0002956c 0000005c T lv_anim_count_running
00012a60 0000005c t refresh_children_style
00011778 00000060 t base_dir_refr_children
000297c4 00000060 T lv_anim_path_ease_in
00029884 00000060 T lv_anim_path_ease_in_out
00029824 00000060 T lv_anim_path_ease_out
000298e4 00000060 T lv_anim_path_overshoot
0002c480 00000060 T _lv_bezier3
00016428 00000060 T lv_obj_fade_out
00015440 00000060 T lv_obj_is_point_on_coords
00012390 00000060 T lv_obj_move_background
00012330 00000060 T lv_obj_move_foreground
00014988 00000060 T lv_obj_report_style_mod
00028840 00000060 T lv_task_del
0003d36c 00000064 T __libc_csu_init
00012abc 00000064 T lv_obj_set_hidden
00018ffc 00000064 T _lv_style_list_add_trans_style
00011268 00000064 t obj_valid_child
000292d0 00000068 T lv_anim_init
00025494 00000068 T lv_img_buf_set_palette
00012280 00000068 T lv_obj_del
00011b0c 00000068 T lv_obj_get_coords
0002c9d8 0000006c t apply_theme
00027dc8 0000006c T _lv_area_intersect
00012934 0000006c T lv_obj_align_mid
00012214 0000006c T lv_obj_invalidate
00012b20 0000006c T lv_obj_is_visible
000163b8 00000070 T lv_obj_fade_in
00013950 00000070 T lv_obj_get_inner_coords
0002b6ac 00000070 T _lv_txt_is_cmd
0002c8d4 00000070 T _lv_utils_bsearch
0002c964 00000074 T lv_async_call
00027840 00000074 T lv_disp_get_size_category
0002b3d8 00000074 t lv_txt_utf8_get_byte_id
0002b44c 00000074 t lv_txt_utf8_get_char_id
0003e280 00000076 r unicode_list_1
000294f4 00000078 T lv_anim_get
0001bc4c 00000078 T lv_draw_mask_line_angle_init
00011f00 00000078 T _lv_obj_disable_style_caching
00010b4c 0000007c T lv_disp_set_bg_color
00010bc8 0000007c T lv_disp_set_bg_image
00010c44 0000007c T lv_disp_set_bg_opa
0003c650 0000007c T printFixedInfo
000111ec 0000007c t refresh_children_position
00ca14ec 00000080 B _lv_draw_mask_list
0001bf48 00000080 T lv_draw_mask_map_init
00024af8 00000080 T _lv_img_decoder_init
0002ae64 00000080 T _lv_ll_ins_prev
00ca15ac 00000080 B _lv_mem_buf
000129e0 00000080 T lv_obj_align_x
00012560 00000080 T lv_obj_align_y
0002b4c0 00000080 t lv_txt_utf8_get_length
0001c9e4 00000084 T lv_draw_rect_dsc_init
00014bc0 00000084 t trans_anim_start_cb
00027c44 00000088 T _lv_indev_read
0002a11c 00000088 T _lv_mem_buf_free_all
00016808 00000088 T lv_obj_set_focus_parent
000154e8 0000008c T lv_obj_handle_get_type_signal
00017ed4 0000008c T _lv_style_get_mem_size
00019178 0000008c T _lv_style_list_set_local_color
00019060 0000008c T _lv_style_list_set_local_int
000190ec 0000008c T _lv_style_list_set_local_opa
00019204 0000008c T _lv_style_list_set_local_ptr
00014b30 00000090 T lv_obj_finish_transitions
0002923c 00000094 T _lv_anim_core_init
00024840 00000094 T lv_img_decoder_get_info
0002774c 00000098 T lv_disp_drv_update
00027624 00000098 T lv_disp_remove
0001beb0 00000098 T lv_draw_mask_fade_init
00018d30 00000098 T _lv_style_list_reset
0003e1e0 0000009b r kern_left_class_mapping
0003e140 0000009b r kern_right_class_mapping
000247a4 0000009c T lv_img_decoder_built_in_info
000116c8 0000009c T lv_obj_get_disp
00ca1400 000000a0 b vinfo
000381a0 000000a4 t color_blend_true_color_additive
00010924 000000a4 T custom_tick_get
0003c180 000000a4 T evdev_init
0001b648 000000a4 T lv_draw_mask_apply
0002afe0 000000a4 T _lv_ll_chg_list
0002b608 000000a4 t lv_txt_utf8_prev
000370fc 000000a8 T lv_indev_search_obj
000370fc 000000a8 t lv_indev_search_obj.localalias.8
000125e0 000000a8 T lv_obj_align
00038244 000000ac t color_blend_true_color_subtractive
000117d8 000000ac T lv_event_send_refresh_recursive
000117d8 000000ac t lv_event_send_refresh_recursive.localalias.18
00025620 000000ac T lv_img_buf_alloc
0003701c 000000ac T lv_indev_finish_drag
00027b2c 000000b0 T lv_indev_drv_register
000165a8 000000b4 T lv_debug_check_obj_valid
0003662c 000000b4 T lv_label_ins_text
0002c820 000000b4 T _lv_utils_num_to_str
00040140 000000b6 r sin0_90_table
0003c224 000000b8 T evdev_set_file
00024d78 000000b8 T lv_img_cache_invalidate_src
0002b0c4 000000b8 T _lv_ll_move_before
0002aee4 000000b8 T _lv_ll_remove
00028d10 000000b8 T lv_task_set_prio
0003447c 000000bc t lv_label_set_dot_tmp
00017df8 000000c0 T _lv_style_list_add_style
00024e30 000000c4 T lv_img_cache_set_size
000356c8 000000c4 T lv_label_set_text
00029e7c 000000c4 T lv_mem_test
00011f78 000000c4 t trans_anim_ready_cb
0002a9a8 000000c8 T _lv_memset
0002b540 000000c8 t lv_txt_unicode_to_utf8
00010768 000000cc T main
000112cc 000000d0 T lv_init
0002a66c 000000d0 T lv_mem_realloc
00016e04 000000d0 t lv_refr_vdb_flush
00011c70 000000d0 t trans_del
000358bc 000000d8 T lv_label_set_long_mode
00016a18 000000d8 t lv_refr_obj_and_children
0002c3a8 000000d8 T _lv_trigo_sin
0003c9b4 000000dc T drawRect
00029338 000000dc T lv_anim_del
0003578c 000000dc T lv_label_set_text_fmt
00029414 000000e0 T lv_anim_start
00028758 000000e0 T lv_task_create_basic
00013374 000000e4 T _lv_obj_get_style_color
00016af0 000000e8 t lv_refr_get_top_obj.part.2
0001bdc4 000000ec T lv_draw_mask_radius_init
0002ab64 000000ec T _lv_memset_00
0002ac80 000000ec T _lv_memset_ff
00017d0c 000000ec T _lv_style_list_remove_style
00015eec 000000f0 T lv_obj_init_draw_img_dsc
000114f0 000000f4 T lv_event_send_func
0002aa70 000000f4 T lv_mem_monitor
00025524 000000fc T lv_img_buf_get_img_size
00029ac8 000000fc T lv_mem_alloc
0002c51c 00000100 T _lv_atan2
0003d410 00000100 R _lv_bpp8_opa_table
0001bcc4 00000100 T lv_draw_mask_angle_init
00015dec 00000100 T lv_obj_init_draw_label_dsc
00015fdc 00000100 T lv_obj_init_draw_line_dsc
000a11e8 00000100 b opa_table.9771
000248d4 00000104 T lv_img_decoder_open
000130a0 00000108 T lv_obj_set_parent
0001b940 0000010c T lv_draw_mask_get_cnt
00034538 00000110 t lv_label_revert_dots
00028180 00000118 T _lv_area_is_in
00036da0 00000118 T lv_indev_reset
0003c6cc 0000011c T printVariableInfo
00016488 00000120 T lv_debug_check_obj_type
00012094 00000128 T lv_obj_area_is_visible
000123f0 00000128 T lv_obj_set_pos
000131a8 00000128 T lv_obj_set_size
000193b8 00000128 T _lv_style_list_get_color
00019290 00000128 T _lv_style_list_get_int
0001960c 00000128 T _lv_style_list_get_ptr
000194e0 0000012c T _lv_style_list_get_opa
00029944 00000138 T lv_anim_path_bounce
0003a7e8 0000013c T lv_color_fill
000251b4 00000140 T lv_img_buf_set_px_alpha
00018900 00000140 T _lv_style_get_opa
000187b8 00000148 T _lv_style_get_int
000149e8 00000148 t trans_anim_cb
0003a9d0 0000014c T lv_color_hsv_to_rgb
00025068 0000014c T lv_img_buf_get_px_alpha
00014838 00000150 t report_style_mod_core
0003d21c 00000150 T __udivmoddi4
000279a4 00000154 T lv_disp_drv_register
00029bc4 00000154 T lv_mem_defrag
00028f30 00000158 t anim_ready_handler
00018a40 00000158 T _lv_style_get_color
00018b98 00000158 T _lv_style_get_ptr
00011094 00000158 t style_prop_is_cacheble
00029d18 00000164 T lv_mem_free
0002c6b8 00000168 T _lv_gc_clear_roots
0002bc4c 00000168 T _lv_txt_get_size
0001424c 0000016c t update_style_cache_children
00016698 00000170 t lv_obj_signal
0002b71c 00000170 T _lv_txt_get_width
00024ef4 00000174 T lv_img_buf_get_px_color
000256cc 0000017c T _lv_img_buf_transform_init
0002b258 00000180 t lv_txt_utf8_next
000364a8 00000184 t lv_label_signal
00013f2c 00000184 T _lv_obj_get_style_opa
00016890 00000188 t lv_refr_obj.part.3
00011d40 0000018c t obj_del_core
00018490 00000190 T _lv_style_set_opa
00017fa0 00000194 T lv_style_remove_prop
00026040 00000198 t get_glyph_dsc_id.isra.0.part.1
000182f8 00000198 T _lv_style_set_color
00018620 00000198 T _lv_style_set_ptr
000140b0 0000019c T _lv_obj_get_style_ptr
000252f4 000001a0 T lv_img_buf_set_px_color
000241f4 000001a0 T lv_img_decoder_built_in_open
00015284 000001ac T lv_obj_get_type
0001b498 000001b0 T lv_draw_mask_add
00029088 000001b4 t anim_task
00029610 000001b4 T lv_anim_refr_now
00029f68 000001b4 T _lv_mem_buf_release
0003c7e8 000001b8 T fbdev_init
0003ab1c 000001c4 T lv_color_rgb_to_hsv
00018134 000001c4 T _lv_style_set_int
00011884 000001dc T lv_obj_set_base_dir
0003cd84 000001ec T __udivsi3
0001ba4c 00000200 T lv_draw_mask_line_points_init
00027358 00000200 T lv_font_get_glyph_dsc_fmt_txt
00024b78 00000200 T _lv_img_cache_open
0001b728 00000218 T lv_draw_mask_remove_custom
00016bdc 00000218 T _lv_inv_area
00012688 0000021c t obj_align_mid_core.constprop.23
0003cf90 00000220 T __divsi3
0002c184 00000224 T _lv_txt_cut
00019748 00000230 t lv_draw_mask_map
00018dc8 00000234 T lv_style_list_copy
000359cc 00000268 T lv_label_create
0002a73c 0000026c T _lv_mem_buf_get
000143b8 0000027c T lv_obj_refresh_style
00025848 00000298 T _lv_img_buf_get_transformed_area
00027e8c 000002a4 T _lv_area_is_point_on
00027e8c 000002a4 t _lv_area_is_point_on.localalias.3
00037edc 000002c0 T _lv_indev_read_task
00036728 000002d4 t indev_drag_throw.part.4
00013458 000002d8 T _lv_obj_get_style_int
000160dc 000002dc T lv_obj_get_draw_rect_ext_pad_size
0003ca90 000002f4 T fbdev_flush
00016ed4 00000300 t lv_refr_area_part
0001bfc8 00000314 t shadow_blur_corner
0003c2dc 0000034c T evdev_read
00010cc0 0000035c T lv_scr_load_anim
0003ad08 00000370 t _ntoa_format
00015a78 00000374 t lv_obj_design
000369fc 00000388 t indev_proc_release
000346ec 00000388 T lv_label_get_letter_pos
00023dd4 000003a0 T lv_draw_img
00035c84 000003ac t lv_label_design
0002b88c 000003c0 T _lv_txt_get_next_line
0002bdb4 000003d0 T _lv_txt_ins
00024394 00000410 T lv_img_decoder_built_in_read_line
00034a74 00000434 T lv_label_get_letter_on
0002ca68 00000458 T lv_theme_apply
00036030 00000468 T lv_label_is_char_under_pos
0001a6e0 00000470 t lv_draw_mask_angle
000288a0 00000470 T lv_task_handler
00012c0c 00000494 T lv_obj_create
00028298 000004c0 T _lv_area_align
00013a68 000004c4 t update_style_cache.part.14
0002a1a4 000004c8 T _lv_memcpy
0003e2f8 000004d8 r glyph_dsc
00025ae0 000004d8 T _lv_img_buf_transform_anti_alias
00015574 00000504 T lv_obj_init_draw_rect_dsc
00014c44 000005f8 T lv_obj_set_state
00019978 0000068c t lv_draw_mask_fade
0001a004 000006dc t lv_draw_mask_line
0001c2dc 00000708 t draw_full_border
00034ea8 00000820 t lv_label_refr_text
0002dadc 000008d0 t tabview_win_shared_init
0001ab50 00000948 t lv_draw_mask_radius
0002e3ac 00000954 t calendar_init
0002ed00 00000a10 t list_init
000171e8 00000ac8 T _lv_disp_refr_task
0002cfd0 00000b0c t theme_apply
0003d590 00000bad r kern_class_values
000230b8 00000c60 t lv_draw_map
00022430 00000c88 T lv_draw_line
000371a4 00000d38 t indev_proc_press
000382f0 000010b8 T _lv_blend_fill
0003b078 000010d8 t _vsnprintf.constprop.0
000261d8 00001180 T lv_font_get_bitmap_fmt_txt
000393a8 00001440 T _lv_blend_map
0002f710 00001960 t basic_init
0003e7d0 00001961 r gylph_bitmap
00020838 00001bcc T lv_draw_label
00031070 000033cc T lv_theme_material_init
0001ca68 00003d74 T lv_draw_rect
000511c8 00050000 b buf.14304
000a1350 00c00000 b work_mem_int.7247

How should I analyze and optimize? Looking forward for your response, thank you~~

nm lines can be interpreted like this:

address    size section  name
0001ca68 00003d74 T lv_draw_rect

Your concern is executable size so you’re looking for entries with a section of T or t (.text) or r (.rodata).

When you pass --size-sort to nm, it sorts the entries from smallest to largest, thus you should start at the bottom of the list and work your way up.

Unfortunately I’m not seeing anything particularly large in your output (you could enable LV_SPRINTF_CUSTOM to save a few KB and use Linux’s built-in implementation).

Another thing you can try is running strip --strip-debug --strip-unneeded <executable>. This will remove some of the bloat that comes from a Linux ELF file (as opposed to a bare-metal binary).

1 Like

Thank you,I will try it~~

I have tried it, and now the executable file has been reduced from 250+kb to 200kb. Thank you very much, although it did not meet my expectations.

I’m not sure you could get it much lower if you are using Linux.

Out of curiosity, is there a reason why you need such a small executable? Typically embedded Linux systems have at least 2 megabytes of flash.

To prepare for cutting to the mcu, test to what extent the linux arm can be cut at least.