当前位置:网站首页>Precautions for lvgl v8.2 string display on keil MDK (take little bear pie as an example)
Precautions for lvgl v8.2 string display on keil MDK (take little bear pie as an example)
2022-07-01 09:37:00 【Engineer-Bruce_ Yang】
Click on the above “ Embedded Application Research Institute ”, choice “ Roof placement / Official account of star standard ”
Dry goods benefits , First time delivery !
source | Embedded Application Research Institute
Arrangement & Typesetting | Embedded Application Research Institute
Before that LVGL Simulator CodeBlock There is a multilingual demo, For learning LVGL The application of many languages , As shown below :

Later, I transplanted it to the little bear development board , It turned out to be like this , Even the display position of the control has changed ( The specific reason for the control shift is unknown , To be analyzed later LVGL Source code ):

This is a coding problem . According to past experience , Directly find the file with Chinese string in the project directory , use notepad++ Turn it into utf-8, Then save it directly and open it again Keil MDK That's all right. , Then try it :


Next open MDK engineering , recompile , There is 6 individual Error:

1、 Wrong pit arrangement

The cause of the error shows that there are too many parameters to call the macro , But in fact, this is just a parameter ... Should not be , I began to doubt whether the compiler supported wide character display , So search Keil MDK The help manual sees this :


Follow the instructions in the documentation , I am here Misc Controls Add... To this configuration item --no-multibyte-chars, And then recompile the project :

Next, download it to the development board :


The final display is normal .
2、 The core reason
adopt STM32CubeMX The encoding format of the generated program source file is not UTF-8 perhaps UTF16, Therefore, if you write Chinese and some special national language characters under some files, you need to convert the files manually . If the source file code is UTF-8 or UTF-16, And the file begins with a byte order mark , The compiler will ignore --locale and --[no_]multibyte_chars Option and interpret the file as UTF-8 or UTF- 16.
3、 The correct approach
Usually do multi language display , We need to separate the languages of each different country into different documents , Then transcode it separately , To facilitate unified management , for example 3D Printer firmware Marlin Code , That's what it does :

And some simulation display software , The coding environment is relatively perfect , Many pits have actually helped us eliminate them in advance , Therefore, in the face of some platforms with less perfect coding environment , Understanding the environment configuration and some coding rules is more helpful for us to locate the problem . If you have a better way , Leave a comment in the comments section , Communicate together LVGL applied technology . At present, the application routine is still being modified , Later, it will be shared to Github perhaps Gitee, The address will be given in the comments section . Next issue will share how to simulate a rotary encoder to realize keyboard input .
Past highlights
Keil MDK software package (pack) Several methods of downloading
Hand in hand Keil MDK Use in GCC Compiler tool chain
Keil MDK Upgrade to Keil Studio, Here comes the black theme you want , Attached handle tutorial
I think this article is helpful to you , Let's go [ Looking at ] And forward to share , It's also my support .
边栏推荐
- Latex插入的eps图片模糊解决方法
- SQL learning notes (02) - database table operation
- Tree structure --- binary tree 1
- What is P in cap theory
- 树结构---二叉树2非递归遍历
- SQL学习笔记(01)——数据库基本知识
- Huawei accounts work together at multiple ends to create a better internet life
- Concept of digital currency
- Cortex M4 systick details
- js 使用toString 区分Object、Array
猜你喜欢
![delete和delete[]引发的问题](/img/d9/a1c3e5ce51ef1be366a973aa42d1f0.png)
delete和delete[]引发的问题

Learning practice: comprehensive application of cycle and branch structure (II)

dotnet 控制台 使用 Microsoft.Maui.Graphics 配合 Skia 进行绘图入门

2.3 【kaggle数据集 - dog breed 举例】数据预处理、重写Dataset、DataLoader读取数据

js作用域链与闭包

dsPIC30F6014a LCD 方块显示

Design and manufacture of simple digital display electronic scale

Mikrotik Routeros Internet access settings

遇到女司机业余开滴滴,日入500!

Flinkv1.13实现金融反诈骗案例
随机推荐
A 419 error occurred in the laravel postman submission form. July 6th, 2020 diary.
3D printing Arduino four axis aircraft
电脑USB、HDMI、DP各种接口及速度
MapReduce编程基础
集成积木报表报错 org.apache.catalina.core.StandardContext.filterStart 启动过滤器异常
How to realize the usage of connecting multiple databases in idel
JS functionarguments object
Strange, why is the ArrayList initialization capacity size 10?
LeetCode 344. Reverse string
delete和delete[]引发的问题
Niuke monthly race 22- collect pieces of paper
【检测技术课案】简易数显电子秤的设计与制作
Structure de l'arbre - - - arbre binaire 2 traversée non récursive
Hololens2 development -6-eyetracking and speech recognition
Project procurement management
SQL learning notes (01) - basic knowledge of database
SDN_简单总结
Tree structure -- binary tree 2 non recursive traversal
炒币,亏了1000万。
奇怪,为什么ArrayList初始化容量大小为10?