lvgl_benchmark运行问题(已解决)

[复制链接]
查看1813 | 回复17 | 2024-2-5 17:14:17 | 显示全部楼层 |阅读模式
本帖最后由 xiaoch669 于 2024-2-17 21:03 编辑

lvgl库aithinker_Ai-M6X_SDK\examples\lvgl\demos文件夹下有benchmark例程,我用1.3寸LCD跑了一晚上,程序一直莫名奇妙卡死,而且都是在不同的地方卡顿,我把帧率从50fps降到18fps,也修改了LV_MEM_SIZE,LV_LAYER_SIMPLE_BUF_SIZE,LV_LAYER_SIMPLE_FALLBACK_BUF_SIZE 等参数,也没有一次完整跑完,还是在不同的地方卡死。感觉调整参数没有规律可循,特地来问问大佬。
下面是过程中的某张图片。


微信图片_20240205165651.jpg
部分配置信息lv_conf.h
  1.    MEMORY SETTINGS
  2. *=========================*/

  3. /*1: use custom malloc/free, 0: use the built-in `lv_mem_alloc()` and `lv_mem_free()`*/
  4. #define LV_MEM_CUSTOM 0
  5. #if LV_MEM_CUSTOM == 0
  6.     /*Size of the memory available for `lv_mem_alloc()` in bytes (>= 2kB)*/
  7.     #define LV_MEM_SIZE (230U * 1024U)          /*[bytes]*/

  8.     /*Set an address for the memory pool instead of allocating it as a normal array. Can be in external SRAM too.*/
  9.     #define LV_MEM_ADR 0    /*0: unused*/
  10.     /*Instead of an address give a memory allocator that will be called to get a memory pool for LVGL. E.g. my_malloc*/
  11.     #if LV_MEM_ADR == 0
  12.         #undef LV_MEM_POOL_INCLUDE
  13.         #undef LV_MEM_POOL_ALLOC
  14.     #endif

  15. #else       /*LV_MEM_CUSTOM*/
  16.     #define LV_MEM_CUSTOM_INCLUDE <stdlib.h>   /*Header for the dynamic memory function*/
  17.     #define LV_MEM_CUSTOM_ALLOC   malloc
  18.     #define LV_MEM_CUSTOM_FREE    free
  19.     #define LV_MEM_CUSTOM_REALLOC realloc
  20. #endif     /*LV_MEM_CUSTOM*/

  21. /*Number of the intermediate memory buffer used during rendering and other internal processing mechanisms.
  22. *You will see an error log message if there wasn't enough buffers. */
  23. #define LV_MEM_BUF_MAX_NUM 16

  24. /*Use the standard `memcpy` and `memset` instead of LVGL's own functions. (Might or might not be faster).*/
  25. #define LV_MEMCPY_MEMSET_STD 0

  26. /*====================
  27.    HAL SETTINGS
  28. *====================*/

  29. /*Default display refresh period. LVG will redraw changed areas with this period time*/
  30. #define LV_DISP_DEF_REFR_PERIOD 55      /*[ms]*/

  31. /*Input device read period in milliseconds*/
  32. #define LV_INDEV_DEF_READ_PERIOD 20     /*[ms]*/

  33. /*Use a custom tick source that tells the elapsed time in milliseconds.
  34. *It removes the need to manually update the tick with `lv_tick_inc()`)*/
  35. #define LV_TICK_CUSTOM 1
  36. #if LV_TICK_CUSTOM
  37.     #define LV_TICK_CUSTOM_INCLUDE "bflb_mtimer.h"         /*Header for the system time function*/
  38.     #define LV_TICK_CUSTOM_SYS_TIME_EXPR ((uint32_t)bflb_mtimer_get_time_ms())    /*Expression evaluating to current system time in ms*/
  39. #endif   /*LV_TICK_CUSTOM*/

  40. /*Default Dot Per Inch. Used to initialize default sizes such as widgets sized, style paddings.
  41. *(Not so important, you can adjust it to modify default sizes and spaces)*/
  42. #define LV_DPI_DEF 130     /*[px/inch]*/

  43. /*=======================
  44. * FEATURE CONFIGURATION
  45. *=======================*/

  46. /*-------------
  47. * Drawing
  48. *-----------*/

  49. /*Enable complex draw engine.
  50. *Required to draw shadow, gradient, rounded corners, circles, arc, skew lines, image transformations or any masks*/
  51. #define LV_DRAW_COMPLEX 1
  52. #if LV_DRAW_COMPLEX != 0

  53.     /*Allow buffering some shadow calculation.
  54.     *LV_SHADOW_CACHE_SIZE is the max. shadow size to buffer, where shadow size is `shadow_width + radius`
  55.     *Caching has LV_SHADOW_CACHE_SIZE^2 RAM cost*/
  56.     #define LV_SHADOW_CACHE_SIZE 0

  57.     /* Set number of maximally cached circle data.
  58.     * The circumference of 1/4 circle are saved for anti-aliasing
  59.     * radius * 4 bytes are used per circle (the most often used radiuses are saved)
  60.     * 0: to disable caching */
  61.     #define LV_CIRCLE_CACHE_SIZE 4
  62. #endif /*LV_DRAW_COMPLEX*/

  63. /**
  64. * "Simple layers" are used when a widget has `style_opa < 255` to buffer the widget into a layer
  65. * and blend it as an image with the given opacity.
  66. * Note that `bg_opa`, `text_opa` etc don't require buffering into layer)
  67. * The widget can be buffered in smaller chunks to avoid using large buffers.
  68. *
  69. * - LV_LAYER_SIMPLE_BUF_SIZE: [bytes] the optimal target buffer size. LVGL will try to allocate it
  70. * - LV_LAYER_SIMPLE_FALLBACK_BUF_SIZE: [bytes]  used if `LV_LAYER_SIMPLE_BUF_SIZE` couldn't be allocated.
  71. *
  72. * Both buffer sizes are in bytes.
  73. * "Transformed layers" (where transform_angle/zoom properties are used) use larger buffers
  74. * and can't be drawn in chunks. So these settings affects only widgets with opacity.
  75. */
  76. #define LV_LAYER_SIMPLE_BUF_SIZE          (64 * 1024)
  77. #define LV_LAYER_SIMPLE_FALLBACK_BUF_SIZE (12* 1024)
复制代码


文件如下 lvgl_test.rar (13.09 KB, 下载次数: 1)
回复

使用道具 举报

sansui | 2024-2-5 21:10:36 | 显示全部楼层
学习学习
回复

使用道具 举报

干簧管 | 2024-2-6 08:36:37 | 显示全部楼层
赞👍
回复

使用道具 举报

lazy | 2024-2-6 08:51:04 | 显示全部楼层
不错呢,学习了
回复 支持 反对

使用道具 举报

WT_0213 | 2024-2-6 08:59:22 | 显示全部楼层
回复

使用道具 举报

WT_0213 | 2024-2-6 09:48:47 | 显示全部楼层
没有在M61上具体玩过这个lvgl,不太清楚。不过也用的时候可以参考下你的操作。就不用从零开始了。
回复 支持 反对

使用道具 举报

timo | 2024-2-6 11:28:55 | 显示全部楼层
回复

使用道具 举报

wxlinus | 2024-2-7 08:37:39 | 显示全部楼层
你看上面都是来水积分的,不像我是真不知道,来看看
回复 支持 反对

使用道具 举报

沈夜 | 2024-2-7 22:40:17 | 显示全部楼层
看看小泽的
回复 支持 反对

使用道具 举报

sansui | 2024-2-8 18:15:47 | 显示全部楼层
小泽大佬的有介绍
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则