当前位置:网站首页>Lvgl8.x migrating to stm32f4
Lvgl8.x migrating to stm32f4
2022-06-27 17:36:00 【zhbi98】
1. Requirements for chips
- processor
16,32or64Bit microcontroller or processor- The clock frequency is the lowest
16 MHzclock frequencyFlash/ROMFor very important components, it is required to be greater than 64 kB ( The suggestion is greater than 180 kB)RAMstatic state RAM Usage approx 2 kB, Depending on the function and object type usedStack: Greater than 2kB ( The suggestion is greater than 8 kB)Dynamic data ( Pile up ): Greater than 2 KB( If you use multiple objects , It is suggested to be greater than 16 kB). fromlv_conf.hMediumLV_MEM_SIZEMacro settingsShow buffer: Pixels larger than horizontal resolution ( The suggestion is greater than 10 Row horizontal resolution ),MCU Or a frame buffer in an external display controller- The compiler must support
C99Or later compilers- The technology stack has basic C ( or C ++) knowledge : The pointer , structure , Callback
2. Download source package
You need to download the source code package before porting , The source code package can be created by using
GitHubClone or download , stayGithubMid searchlvglYou can search forlvglThe official warehouse of , Enter the official warehouse to use git Clone to local computer , Or click download directly to download the entire source package to the local computer .
3. Overview source directory
The main applications are :examples/,src/,lv_conf_template.h,lvgl.h. Respectively lvgl Routine folder , Source folder ,lvgl Profile templates ,lvgl Main header file .
3.1. src Source directory
coreCore source codedrawDrawing source codeextraFor additional functions , Some advanced interface implementationsfontBuilt in FontsgpuGPU Drive implementation , This needs to be supported by the chip usedhalHardware abstraction layermiscmiscellaneouswidgetBasic interface components
3.2. examples Routine Directory
animAnimation usage routinesarduinoSupport arduino Configuration file for , Generally not used , Unless used arduinoassetsCode or image array of some small components , In order to know the style generated by the code, the corresponding style pictures are also providedeventsome lvgl Event writing and using routinesget_startedComponent usage routineslayoutslvgl Layout usage routinesportinglvgl Drive docking method templatescrolllvgl Scrolling using routinesstylesComponent style usage routineswidgetsThe same is lvgl Component usage routines
In general, this folder is just as the name suggests for some use of reference code , If you want to quickly view the effect, you can copy and use the code here to generate View the required components , This directory is commonly used .
4. stm32 Formwork works
transplant
lvglBefore that, we need to build a compiler stm32 Code compilation project , Used to compile stm32 Relevant code files ( For example, commonKeil-MDKengineering ). For the development of man-machine interface, it is also necessary to prepare a display screen ( As for any kind of display screen ,lvgl The inside doesn't care what kind of screen you use ), And use stm32 To drive it . As for how to build stm32 Compilation engineering is not introduced here , Because it mainly explains how tolvglMigration to stm32, At the same time, I believe that I must know how to build it if I can see here stm32 The compilation project of .
Be careful : here keil Version USES
keil5.26
STM32 UseSTM32F407VET6, Of course, this migration method is not only applicable to,stm32 Series single chip microcomputer or other types of single chip microcomputer are applicable .STM32F407VET6
5. Start migration
5.1 Prune unneeded folders and files
Unzip the previously downloaded lvgl The source code package can get a
lvgl-8.0.2Folder , leavelvgl-8.0.2/examples/Folder ,lvgl-8.0.2/src/Folder ,lvgl-8.0.2/LICENCE.txtfile ,lvgl-8.0.2/lv_conf_template.h file,lvgl-8.0.2/lvgl.h file,lvgl-8.0.2/README.md file, The rest can be deleted .
At the same timelvgl-8.0.2/examples/portingThe folder is cut to the upper directory ( namelylvgl-8.0.2/), Finally, as shown in the figure below
5.2 Rename file
take
lvgl-8.0.2/lv_conf_template.hChange the document tolv_conf.h,( The configuration file )
takelvgl-8.0.2/porting/lv_port_disp_template.cChange the document tolv_port_disp.c( Show related )
takelvgl-8.0.2/porting/lv_port_disp_template.hChange the document tolv_port_disp.h( Show related )
takelvgl-8.0.2/porting/lv_port_fs_template.cChange the document tolv_port_fs.c( File system related )
takelvgl-8.0.2/porting/lv_port_fs_template.cChange the document tolv_port_fs.h( File system related )
takelvgl-8.0.2/porting/lv_port_indev_template.cChange the document tolv_port_indev.c( Input device related )
takelvgl-8.0.2/porting/lv_port_indev_template.cChange the document tolv_port_indev.c( Input device related )
6. add to lvgl File to keil5
6.1 add to lvgl Source code
add to
lvgl-8.0.2/src/coreAll under directory c file
add tolvgl-8.0.2/src/drawAll under directory c file
add tolvgl-8.0.2/src/extraAll under directory c file
add tolvgl-8.0.2/src/fontAll under directory c file
add tolvgl-8.0.2/src/gpuAll under directory c file
add tolvgl-8.0.2/src/halAll under directory c file
add tolvgl-8.0.2/src/miscAll under directory c file
add tolvgl-8.0.2/src/widgetsAll under directory c file
add to
lvgl-8.0.2/porting/lv_port_disp.c, Because only the display effect after successful migration can be viewed here , Therefore, only display related device interface files are added here .
6.2 add to lvgl Source file path
The following header file paths need to be added
lvgl8.0.2/lvgl8.0.2/srclvgl8.0.2/porting
Detailed view :https://cloud.tencent.com/developer/article/1862110
7. modify lv_conf.h
take lvgl Configure the... Of the header file Conditional compilation is set to 1, Enable configuration .
8. modify stm32 Stack size
open stm32 To modify the startup file , Here's the picture
9. keil c99 Pattern
Follow the steps shown in the figure below to keil5 Set to
c99Pattern .
10. Interface with screen drawing
See the following articles for details of this section
lvgl8.0 Docking screen driversThis part .
边栏推荐
- Simulated process scheduling
- Ten common methods of arrays tools
- EMQ 助力青岛研博建设智慧水务平台
- About MySQL: the phenomenon and background of the problem
- After the mobile phone, it was reported that Samsung also cut the output of TV and other home appliance product lines
- CDH cluster installation
- National food safety risk assessment center: do not blindly and unilaterally pursue "zero addition" and "pure natural" food
- Hash encryption
- Anfulai embedded weekly report (issue 252): February 7, 2022 to February 13, 2022
- Community sharing jumpserver in the eyes of senior open source users: a fortress machine for "Crazy" iteration
猜你喜欢

Popularization of MCU IO port: detailed explanation of push-pull output and open drain output

leetcode 92. Reverse linked list II

Simulated process scheduling

EMQ 助力青岛研博建设智慧水务平台

Oracle concept 3

Alibaba cloud liupeizi: Inspiration from cloud games - innovation on the end

Anfulai embedded weekly report (issue 252): February 7, 2022 to February 13, 2022

Offline disk group

10分钟掌握mysql的安装步骤
P. Simple application of a.r.a method in Siyuan (friendly testing)
随机推荐
Community sharing jumpserver in the eyes of senior open source users: a fortress machine for "Crazy" iteration
Detailed explanation of various GPIO input and output modes (push-pull, open drain, quasi bidirectional port)
Part 31 supplement (31) ECMAScript conversion to string and number
Ten common methods of arrays tools
Sliding window + monotone queue concept and example (p1886 Logu)
What do fast fashion brands care more about?
09 route guard authenticates URL
d3dx9_ How to repair 40.dll? Win10 system d3dx9_ What if 40.dll is lost?
How to modify / display GPIO status through ADB shell
About how vs2019c # establishes the login interface, the user name and password entered must match the records in the access database
428-二叉树(501.二叉搜索树中的众数、701.二叉搜索树中的插入操作、450.删除二叉搜索树中的节点、669. 修剪二叉搜索树)
Special function calculator
P. Simple application of a.r.a method in Siyuan (friendly testing)
Annual comprehensive analysis of China's audio market in 2022
Repeatedly recognized by authoritative organizations! Smartbi was selected into the top three lists of high-tech and high growth enterprises
Etcd visualization tool: kstone deployment (I), rapid deployment based on Helm
About binary
2022 Liaoning's latest eight members (Safety Officer) simulated test question bank and answers
Defiato is an innovation that combines user-friendly features of a centralized platform with defi services
Yyds dry inventory brief chrome V8 engine garbage collection









