1.芯片
STM32F49BIT6 使用外部SDRAM,移植LTDC驱动RGB屏幕三色显示正常。
2.添加LVGL 8.2.0软件包,没有开启任何example和demo均不使能。
3.在applica
tions中新建lvgl文件夹,利用软件包内的5个template移植lv_conf.h;lv_port_disp.h;lv_port_disp.c;lv_port_indev.h;lv_port_indev.c五个文件,在lv_port_disp.c中定义:
#define MY_DISP_HOR_RES 800
#define MY_DISP_VER_RES 480
#define LV_VER_RES_MAX MY_DISP_HOR_RES
注释掉
// /* Example for 2) */
// static lv_disp_draw_buf_t draw_buf_dsc_2;
// static lv_color_t buf_2_1[MY_DISP_HOR_RES * 10]; /*A buffer for 10 rows*/
// static lv_color_t buf_2_2[MY_DISP_HOR_RES * 10]; /*An other buffer for 10 rows*/
// lv_disp_draw_buf_init(&draw_buf_dsc_2, buf_2_1, buf_2_2, MY_DISP_HOR_RES * 10); /*Initialize the display buffer*/
//
// /* Example for 3) also set disp_drv.full_refresh = 1 below*/
// static lv_disp_draw_buf_t draw_buf_dsc_3;
// static lv_color_t buf_3_1[MY_DISP_HOR_RES * MY_DISP_VER_RES]; /*A screen sized buffer*/
// static lv_color_t buf_3_2[MY_DISP_HOR_RES * MY_DISP_VER_RES]; /*Another screen sized buffer*/
// lv_disp_draw_buf_init(&draw_buf_dsc_3, buf_3_1, buf_3_2, MY_DISP_VER_RES * LV_VER_RES_MAX); /*Initialize the display buffer*/
编译后报如下错误
01:44:36 **** Incremental Build of configuration Debug for project FK-F429BIT6M2-LTDC-LVGL ****
make -j8 all
linking...
./packages/LVGL-v8.2.0/src/misc/lv_printf.o: In function `rt_snprintf':
E:workspaceFK_F429M2FK-F429BIT6M2-LTDC-LVGLDebug/../packages/LVGL-v8.2.0/src/misc/lv_printf.c:866: multiple definition of `rt_snprintf'
./rt-thread/src/kservice.o:E:workspaceFK_F429M2FK-F429BIT6M2-LTDC-LVGLDebug/../rt-thread/src/kservice.c:1131: first defined here
collect2.exe: error: ld returned 1 exit status
make: *** [makefile:109: rtthread.elf] Error 1
"make -j8 all" terminated with exit code 2. Build might be incomplete.
01:44:39 Build Failed. 3 errors, 0 warnings. (took 2s.654ms)
错误定位一下两个函数之间存在重复定义:
int lv_snprintf(char * buffer, size_t count, const char * format, ...)
{
va_list va;
va_start(va, format);
const int ret = _vsnprintf(_out_buffer, buffer, count, format, va);
va_end(va);
return ret;
}
int rt_snprintf(char *buf, rt_size_t size, const char *fmt, ...)
{
rt_int32_t n;
va_list args;
va_start(args, fmt);
n = rt_vsnprintf(buf, size, fmt, args);
va_end(args);
return n;
}
5.使用littlevGL2RTT软件包不存在这个问题,后在cubemx修改栈为0x1000问题也没有解决,重复新建工程多次也不行,应该怎么解决?