{"id":15349,"date":"2023-08-11T09:32:31","date_gmt":"2023-08-11T04:02:31","guid":{"rendered":"https:\/\/fastbitlab.com\/?p=15349"},"modified":"2024-03-01T17:07:24","modified_gmt":"2024-03-01T11:37:24","slug":"add-the-lvgl-source-code-to-an-stm32-project","status":"publish","type":"post","link":"https:\/\/fastbitlab.com\/blog\/add-the-lvgl-source-code-to-an-stm32-project\/","title":{"rendered":"STM32-LTDC, LCD-TFT, LVGL(MCU3) Lecture 50| Exercise 002 : project creation"},"content":{"rendered":"<div class=\"boldgrid-section color4-background-color color-4-text-contrast bg-background-color\">\n<div class=\"container\">\n<div class=\"row\">\n<div class=\"col-lg-1 col-md-12 col-sm-12 col-xs-12\"><\/div>\n<div class=\"col-lg-10 col-md-12 col-xs-12 col-sm-12\">\n<p class=\"\">&nbsp;<\/p>\n<h1 class=\"\" style=\"text-align: center; font-size: 35px; line-height: 50px; font-family: 'Roboto Slab'; font-weight: 400;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"color: #000080;\"><strong>Add the LVGL source code to an STM32 project<\/strong><\/span><\/h1>\n<div class=\"row bg-editor-hr-wrap\">\n<div class=\"col-lg-12 col-md-12 col-xs-12 col-sm-12\">\n<div>\n<div class=\"bg-hr bg-hr-16 color2-color\" style=\"border-style: solid; border-width: 0px 0px 2px; box-shadow: #cecece 0px 0px 0px 0px;\"><\/div>\n<p>&nbsp;<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p class=\"\" style=\"font-size: 17px; line-height: 30px; font-family: 'Roboto Slab'; font-weight: 400;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400;\">In this article, we will guide you on <\/span><span style=\"color: #ff9900;\"><b>how to add the LVGL source code to an STM32 project<\/b><\/span><span style=\"font-weight: 400;\"> and run sample applications on the STM32 board. We will start by covering the STM32F429 Discovery Board, which will serve as our primary board for demonstration purposes.<\/span><\/p>\n<p class=\"\" style=\"font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400;\">To begin, please visit the<\/span><span style=\"color: #0000ff;\"><a style=\"color: #0000ff;\" href=\"https:\/\/github.com\/lvgl\"><span style=\"font-weight: 400;\"> LVGL repository on GitHub<\/span><\/a><\/span><span style=\"font-weight: 400;\">. You will find that the LVGL project is already available for STM32F429, as well as other ST boards. If you navigate to the Repositories section, you will discover projects for boards such as STM32F769, STM32F746, and STM32H745.<\/span><\/p>\n<p class=\"\" style=\"font-size: 17px; line-height: 30px;\"><span style=\"color: #0000ff;\"><a style=\"color: #0000ff;\" href=\"https:\/\/github.com\/lvgl\"><span style=\"font-weight: 400;\">github.com\/lvgl<\/span><\/a><\/span><\/p>\n<figure id=\"attachment_15352\" aria-describedby=\"caption-attachment-15352\" style=\"width: 683px\" class=\"wp-caption aligncenter\"><img fetchpriority=\"high\" decoding=\"async\" class=\"wp-image-15352 \" src=\"https:\/\/fastbitlab.com\/wp-content\/uploads\/2023\/08\/Figure-1-1.png\" alt=\"Figure 1. Lvgl repository\" width=\"683\" height=\"351\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-1-1.png 1823w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-1-1-300x154.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-1-1-1024x526.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-1-1-768x395.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-1-1-600x308.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-1-1-1536x789.png 1536w\" sizes=\"(max-width: 683px) 100vw, 683px\" \/><figcaption id=\"caption-attachment-15352\" class=\"wp-caption-text\">Figure 1. Lvgl repository<\/figcaption><\/figure>\n<p class=\"\" style=\"font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400;\">We will be using some files from the LVGL project. Therefore, you can simply download the project and run it without encountering any issues.<\/span><\/p>\n<p class=\"\" style=\"font-size: 17px; line-height: 30px; font-family: 'Roboto Slab'; font-weight: 400;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400;\">However, in this article, we are going to create an STM32Cube project. This is because, for our projects, we need to add and remove various peripherals, and we will be incorporating a significant amount of peripheral initialization code. This is why we choose to utilize the STM32CubeIDE&#8217;s auto code generation engine, which is a feature of STM32Cube.<\/span><\/p>\n<p class=\"\" style=\"font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400;\">Within the lv_port_stm32f429_disco project, you will come across the hal_stm_lvgl (Figure 2) folder, which contains the TFT driver files (Figure 3). These files include the LCD driver chip code and the driver for the touchpad, which is used by the touchscreen controller on this board.<\/span><\/p>\n<figure id=\"attachment_15353\" aria-describedby=\"caption-attachment-15353\" style=\"width: 724px\" class=\"wp-caption aligncenter\"><img decoding=\"async\" class=\"wp-image-15353 \" src=\"https:\/\/fastbitlab.com\/wp-content\/uploads\/2023\/08\/Figure-2-1.png\" alt=\"Figure 2. Lv_port_stm32f429_disco\" width=\"724\" height=\"402\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-2-1.png 1811w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-2-1-300x166.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-2-1-1024x568.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-2-1-768x426.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-2-1-600x333.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-2-1-1536x852.png 1536w\" sizes=\"(max-width: 724px) 100vw, 724px\" \/><figcaption id=\"caption-attachment-15353\" class=\"wp-caption-text\">Figure 2. Lv_port_stm32f429_disco<\/figcaption><\/figure>\n<p class=\"\">&nbsp;<\/p>\n<figure id=\"attachment_15354\" aria-describedby=\"caption-attachment-15354\" style=\"width: 721px\" class=\"wp-caption aligncenter\"><img decoding=\"async\" class=\"wp-image-15354 \" src=\"https:\/\/fastbitlab.com\/wp-content\/uploads\/2023\/08\/Figure-3-1.png\" alt=\"Figure 3. TFT driver files\" width=\"721\" height=\"385\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-3-1.png 1751w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-3-1-300x160.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-3-1-1024x547.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-3-1-768x410.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-3-1-600x320.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-3-1-1536x820.png 1536w\" sizes=\"(max-width: 721px) 100vw, 721px\" \/><figcaption id=\"caption-attachment-15354\" class=\"wp-caption-text\">Figure 3. TFT driver files<\/figcaption><\/figure>\n<p class=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400;\">First, download this project onto your machine and save it in a convenient location. And then, we will create a new project using STM32CubeIDE, and we will use hal_stm_lv driver files.<\/span><\/p>\n<p class=\"\" style=\"font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400;\">For that, go to the lv_port_stm32f429_disco project, and you can clone it(Figure 4).<\/span><\/p>\n<figure id=\"attachment_15355\" aria-describedby=\"caption-attachment-15355\" style=\"width: 808px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-15355 \" src=\"https:\/\/fastbitlab.com\/wp-content\/uploads\/2023\/08\/Figure-4-1.png\" alt=\"Figure 4. Clone the project\" width=\"808\" height=\"448\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-4-1.png 1672w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-4-1-300x166.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-4-1-1024x567.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-4-1-768x425.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-4-1-600x332.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-4-1-1536x851.png 1536w\" sizes=\"(max-width: 808px) 100vw, 808px\" \/><figcaption id=\"caption-attachment-15355\" class=\"wp-caption-text\">Figure 4. Clone the project<\/figcaption><\/figure>\n<p class=\"\" style=\"font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400;\">Just copy the git clone, and download this.&nbsp;<\/span><\/p>\n<p class=\"\" style=\"font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400;\">So, I cloned that project into my machine and can do it somewhere on your computer.&nbsp;<\/span><\/p>\n<figure id=\"attachment_15356\" aria-describedby=\"caption-attachment-15356\" style=\"width: 798px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-15356 \" src=\"https:\/\/fastbitlab.com\/wp-content\/uploads\/2023\/08\/Figure-5-1.png\" alt=\"Figure 5. Paste the git clone code\" width=\"798\" height=\"405\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-5-1.png 1907w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-5-1-300x152.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-5-1-1024x519.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-5-1-768x389.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-5-1-600x304.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-5-1-1536x779.png 1536w\" sizes=\"(max-width: 798px) 100vw, 798px\" \/><figcaption id=\"caption-attachment-15356\" class=\"wp-caption-text\">Figure 5. Paste the git clone code<\/figcaption><\/figure>\n<p class=\"\" style=\"font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400;\">Next, return to the LVGL repository and clone the main LVGL code, which is found in the lvgl repository. We are particularly interested in the source folder. Clone this repository using the provided link.&nbsp; Note that now the lvgl.h file indicates the version as 8.3.0.<\/span><\/p>\n<p class=\"\" style=\"font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400;\">So, now let&#8217;s clone this.&nbsp;<\/span><\/p>\n<figure id=\"attachment_15357\" aria-describedby=\"caption-attachment-15357\" style=\"width: 752px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-15357 \" src=\"https:\/\/fastbitlab.com\/wp-content\/uploads\/2023\/08\/Figure-6-1.png\" alt=\"Figure 6. clone the main LVGL code\" width=\"752\" height=\"407\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-6-1.png 1835w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-6-1-300x162.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-6-1-1024x554.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-6-1-768x416.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-6-1-600x325.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-6-1-1536x831.png 1536w\" sizes=\"(max-width: 752px) 100vw, 752px\" \/><figcaption id=\"caption-attachment-15357\" class=\"wp-caption-text\">Figure 6. clone the main LVGL code<\/figcaption><\/figure>\n<p class=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400;\">Just copy the main LVGL code and let\u2019s do that(Figure 7).<\/span><\/p>\n<figure id=\"attachment_15358\" aria-describedby=\"caption-attachment-15358\" style=\"width: 758px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-15358 \" src=\"https:\/\/fastbitlab.com\/wp-content\/uploads\/2023\/08\/Figure-7-1.png\" alt=\"Figure 7. clone the main LVGL code\" width=\"758\" height=\"417\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-7-1.png 1800w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-7-1-300x165.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-7-1-1024x563.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-7-1-768x422.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-7-1-600x330.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-7-1-1536x845.png 1536w\" sizes=\"(max-width: 758px) 100vw, 758px\" \/><figcaption id=\"caption-attachment-15358\" class=\"wp-caption-text\">Figure 7. clone the main LVGL code<\/figcaption><\/figure>\n<p class=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400;\">After that, let&#8217;s go to our STM32CubeIDE and create a new project. We are just trying out some examples from the LVGL repository in this project. Let&#8217;s create a new project first.<\/span><\/p>\n<ol class=\"\" style=\"font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\">\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Go to File \u2192 New \u2192 STM32 Project.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">In the Board Selector, enter the name of your board. For instance, I&#8217;m using the STM32F429I-DISC1 board.&nbsp; Select the appropriate board from the list and click Next (Figure 8).<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Provide a project name, select C as the targeted language, choose executable as the targeted binary type, and select STM32 project as the targeted project type. Click Next. Finally, click Finish (refer to Figure 9).<\/span><\/li>\n<\/ol>\n<figure id=\"attachment_15359\" aria-describedby=\"caption-attachment-15359\" style=\"width: 711px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-15359 \" src=\"https:\/\/fastbitlab.com\/wp-content\/uploads\/2023\/08\/Figure-8.png\" alt=\"Figure 8. Select the board\" width=\"711\" height=\"418\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-8.png 1712w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-8-300x177.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-8-1024x603.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-8-768x452.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-8-600x353.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-8-1536x904.png 1536w\" sizes=\"(max-width: 711px) 100vw, 711px\" \/><figcaption id=\"caption-attachment-15359\" class=\"wp-caption-text\">Figure 8. Select the board<\/figcaption><\/figure>\n<p class=\"\">&nbsp;<\/p>\n<figure id=\"attachment_15360\" aria-describedby=\"caption-attachment-15360\" style=\"width: 711px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-15360 \" src=\"https:\/\/fastbitlab.com\/wp-content\/uploads\/2023\/08\/Figure-9.png\" alt=\"Figure 9. STM32 project setup\" width=\"711\" height=\"335\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-9.png 1454w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-9-300x142.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-9-1024x483.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-9-768x362.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-9-600x283.png 600w\" sizes=\"(max-width: 711px) 100vw, 711px\" \/><figcaption id=\"caption-attachment-15360\" class=\"wp-caption-text\">Figure 9. STM32 project setup<\/figcaption><\/figure>\n<p class=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400;\">At this point, you will be prompted to initialize all peripherals with their default mode. Choose &#8220;No&#8221; for now.<\/span><\/p>\n<p class=\"\" style=\"font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400;\">The Device Configuration Editor will now open up. Click &#8220;Yes&#8221; to proceed (see Figure 10).<\/span><\/p>\n<figure id=\"attachment_15361\" aria-describedby=\"caption-attachment-15361\" style=\"width: 683px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-15361 \" src=\"https:\/\/fastbitlab.com\/wp-content\/uploads\/2023\/08\/Figure-10.png\" alt=\"Figure 10. Board Project options\" width=\"683\" height=\"273\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-10.png 1642w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-10-300x120.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-10-1024x409.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-10-768x307.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-10-600x240.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-10-1536x614.png 1536w\" sizes=\"(max-width: 683px) 100vw, 683px\" \/><figcaption id=\"caption-attachment-15361\" class=\"wp-caption-text\">Figure 10. Board Project options<\/figcaption><\/figure>\n<p class=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400;\">Please wait patiently as the editor initializes.&nbsp;<\/span><\/p>\n<ol class=\"\" style=\"font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\">\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Open your STM32CubeIDE project.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">In the Project Explorer view, expand the project folder.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Look for a file with the extension &#8220;.ioc&#8221; (e.g., &#8220;your_project.ioc&#8221;). This is the Device Configuration File.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Double-click on the &#8220;.ioc&#8221; file to open it in the Device Configuration Tool.<\/span><\/li>\n<\/ol>\n<p class=\"\" style=\"font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400;\">So, you already know what are the peripherals we need to use. We are using LTDC, SPI, and all initialization codes you can generate using this device configuration tool, which is a nice feature of this IDE.<\/span><\/p>\n<figure id=\"attachment_15362\" aria-describedby=\"caption-attachment-15362\" style=\"width: 712px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-15362\" src=\"https:\/\/fastbitlab.com\/wp-content\/uploads\/2023\/08\/Figure-11.png\" alt=\"how to add the LVGL source code to an STM32 project\" width=\"712\" height=\"383\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-11.png 1836w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-11-300x161.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-11-1024x551.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-11-768x413.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-11-600x323.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-11-1536x827.png 1536w\" sizes=\"(max-width: 712px) 100vw, 712px\" \/><figcaption id=\"caption-attachment-15362\" class=\"wp-caption-text\">Figure 11. Device configuration tool STM32CubeIDE<\/figcaption><\/figure>\n<p class=\"\" style=\"font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400;\">Now that you have a good understanding of LTDC (Layered Timing Display Controller) configurations, you can easily set up synchronization, timing details for SPI, and other configuration parameters. These options allow you to configure various aspects such as the display type, the number of layers, window position, pixel format, and timing parameters like HSW (Horizontal Synchronization Width), HBP (Horizontal Back Porch), active width, front porch, and back porch details.<\/span><\/p>\n<p class=\"\" style=\"font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400;\">However, for this specific project, we don&#8217;t need to make any such configurations. Therefore, I will keep these settings disabled for now, and I&#8217;ll explain why.<\/span><\/p>\n<p class=\"\" style=\"font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400;\">By keeping these configurations disabled, you don&#8217;t need to generate additional code using the STM32Cube Device Selector tool. Instead, you can simply activate the required peripherals. When you activate a peripheral, the corresponding driver for that peripheral will be automatically added to the project. Hence, you don&#8217;t need to perform any additional configurations.<\/span><\/p>\n<p class=\"\" style=\"font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400;\">For example, to activate the LTDC in STM32CubeIDE, follow these steps:<\/span><\/p>\n<ol class=\"\" style=\"font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\">\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Go to the &#8220;Multimedia&#8221; section in the Device Configuration Tool.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Look for the LTDC option and select it.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">In the LTDC settings, you will need to specify the display type connected to the LTDC.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Choose the appropriate display type from the available options. For example, if your display type is RGB666, select that.<\/span><\/li>\n<\/ol>\n<p class=\"\" style=\"font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400;\">By following these steps and activating the LTDC with the correct display type, you can proceed without performing any further configurations.<\/span><\/p>\n<p class=\"\" style=\"font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400;\">It&#8217;s important to note that this approach assumes that the default configuration of the LTDC and the connected display will work for your project. If you have specific requirements for synchronization, timings, pixel format, or other parameters, you may need to revisit the LTDC configuration and make the necessary adjustments.<\/span><\/p>\n<p class=\"\" style=\"font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400;\">However, if the default configuration is sufficient for your project, activating the LTDC with the correct display type should be enough to integrate it into your STM32CubeIDE project.<\/span><\/p>\n<p class=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400;\">Similarly, go to Connectivity and enable SPI5, as we are using SPI for this project.&nbsp;<\/span><\/p>\n<p class=\"\" style=\"font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400;\">You can choose to enable Full-Duplex Master or Half-Duplex Master, depending on your specific requirements. No additional configuration settings are required here either because the LVGL&#8217;s tft.c file already handles that.<\/span><\/p>\n<p class=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400;\">Next, let&#8217;s move on to the important aspect of clock configuration. We need to ensure that our system&#8217;s HCLK (High-Speed Clock) is set to the maximum value supported by the microcontroller, which in this case is 180 MHz. To achieve this, enter &#8220;180&#8221; in the appropriate field and press Enter.<\/span><\/p>\n<p class=\"\" style=\"font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400;\">The clock configuration tool will analyze the system requirements and attempt to find a suitable solution to achieve the desired 180 MHz HCLK frequency. If it successfully finds a suitable configuration, you can proceed with that. However, if it fails to find a suitable solution, you have the option to cancel and manually configure the values.<\/span><\/p>\n<p class=\"\" style=\"font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400;\">When manually configuring the clock values, it&#8217;s important to choose legal values that adhere to the specifications and limitations of the microcontroller. These legal values ensure proper functioning and stability of the system.<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><\/p>\n<figure id=\"attachment_15363\" aria-describedby=\"caption-attachment-15363\" style=\"width: 855px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-15363\" src=\"https:\/\/fastbitlab.com\/wp-content\/uploads\/2023\/08\/Figure-12.png\" alt=\"how to add the LVGL source code to an STM32 project\" width=\"855\" height=\"475\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-12.png 1828w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-12-300x167.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-12-1024x569.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-12-768x427.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-12-600x333.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-12-1536x854.png 1536w\" sizes=\"(max-width: 855px) 100vw, 855px\" \/><figcaption id=\"caption-attachment-15363\" class=\"wp-caption-text\">Figure 12. Clock configuration<\/figcaption><\/figure>\n<p class=\"\" style=\"font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400;\">Take the time to carefully select the appropriate values for the clock configuration, considering factors such as the input clock source, PLL settings, and division factors. By choosing legal values, you can maintain the integrity and reliability of the system&#8217;s clock setup.<\/span><\/p>\n<p class=\"\" style=\"font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400;\">For example, if I select some wrong value here (some bad options), and you can see that it shows in Red, that means it&#8217;s not a legal value, as shown in Figure 13.<\/span><\/p>\n<p class=\"\" style=\"font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400;\">By paying attention to the color-coding and avoiding red-highlighted options, you can make sure that the selected clock values are valid and compatible with the microcontroller. This attention to detail helps maintain the integrity and proper functioning of the system&#8217;s clock setup.<\/span><\/p>\n<figure id=\"attachment_15364\" aria-describedby=\"caption-attachment-15364\" style=\"width: 758px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-15364\" src=\"https:\/\/fastbitlab.com\/wp-content\/uploads\/2023\/08\/Figure-13.png\" alt=\"how to add the LVGL source code to an STM32 project\" width=\"758\" height=\"400\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-13.png 1838w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-13-300x158.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-13-1024x540.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-13-768x405.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-13-600x317.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-13-1536x811.png 1536w\" sizes=\"(max-width: 758px) 100vw, 758px\" \/><figcaption id=\"caption-attachment-15364\" class=\"wp-caption-text\">Figure 13.Clock configuration<\/figcaption><\/figure>\n<p class=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400;\">Once you have completed the clock configuration and finalized the settings, it&#8217;s time to save the configuration. Click on the appropriate option to save the settings.<\/span><\/p>\n<p class=\"\" style=\"font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400;\">After saving the configuration, STM32CubeIDE prompts you with the question, &#8220;Do you want to generate code?&#8221; Here, click on &#8216;Yes&#8217; to proceed. The tool will then generate the necessary code based on the configured settings.<\/span><\/p>\n<p class=\"\" style=\"font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400;\">During the code generation process, STM32CubeIDE automatically adds all the required drivers to your project, including the LTDC driver as shown in Figure 14.&nbsp;<\/span><\/p>\n<figure id=\"attachment_15365\" aria-describedby=\"caption-attachment-15365\" style=\"width: 714px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-15365\" src=\"https:\/\/fastbitlab.com\/wp-content\/uploads\/2023\/08\/Figure-14.png\" alt=\"how to add the LVGL source code to an STM32 project\" width=\"714\" height=\"335\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-14.png 1816w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-14-300x141.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-14-1024x480.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-14-768x360.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-14-600x281.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-14-1536x721.png 1536w\" sizes=\"(max-width: 714px) 100vw, 714px\" \/><figcaption id=\"caption-attachment-15365\" class=\"wp-caption-text\">Figure 14. Generated Code<\/figcaption><\/figure>\n<p class=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400;\">However, there is a small issue with this generated code. If you navigate to the main.c file, you will notice that it also includes the LTDC configuration code and SPI configuration code (Figure 15), which is not necessary for our project since we are obtaining those configurations from the LVGL repository.<\/span><\/p>\n<figure id=\"attachment_15366\" aria-describedby=\"caption-attachment-15366\" style=\"width: 693px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-15366\" src=\"https:\/\/fastbitlab.com\/wp-content\/uploads\/2023\/08\/Figure-15.png\" alt=\"how to add the LVGL source code to an STM32 project\" width=\"693\" height=\"286\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-15.png 1724w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-15-300x124.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-15-1024x423.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-15-768x317.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-15-600x248.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-15-1536x634.png 1536w\" sizes=\"(max-width: 693px) 100vw, 693px\" \/><figcaption id=\"caption-attachment-15366\" class=\"wp-caption-text\">Figure 15.generated code<\/figcaption><\/figure>\n<p class=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400;\">To resolve this, go back to the &#8216;.ioc&#8217; file in STM32CubeIDE. Then, navigate to Project Manager, followed by Advanced Settings. Under Generate code, uncheck the following options: MX_LTDC_Init, MX_SPI5_Init, and MX_GPIO_Init, as shown in Figure 16. These configurations are not required since the LVGL file itself will handle the pin configurations.<\/span><\/p>\n<figure id=\"attachment_15367\" aria-describedby=\"caption-attachment-15367\" style=\"width: 789px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-15367\" src=\"https:\/\/fastbitlab.com\/wp-content\/uploads\/2023\/08\/Figure-16.png\" alt=\"how to add the LVGL source code to an STM32 project\" width=\"789\" height=\"418\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-16.png 1842w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-16-300x159.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-16-1024x543.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-16-768x407.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-16-600x318.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-16-1536x814.png 1536w\" sizes=\"(max-width: 789px) 100vw, 789px\" \/><figcaption id=\"caption-attachment-15367\" class=\"wp-caption-text\">Figure 16. Project Manager<\/figcaption><\/figure>\n<p class=\"\" style=\"font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400;\">Save the changes and generate the code once again. You will notice that the unnecessary function calls for LTDC and SPI configurations have disappeared from the main.c file. This ensures that only the essential LVGL-related code is included in your project.<\/span><\/p>\n<p class=\"\" style=\"font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400;\">By unchecking these options, you maintain consistency with the LVGL repository and prevent any potential conflicts or redundant configurations. Now, your code is streamlined and ready for further development with the LVGL integration.<\/span><\/p>\n<p class=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"font-family: 'Roboto Slab'; font-weight: 400; font-size: 20px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><strong>Fastbit Embedded Brain Academy Courses<\/strong><\/p>\n<p class=\"\" style=\"font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 25px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><a href=\"https:\/\/fastbitlab.com\/course1\">https:\/\/fastbitlab.com\/course1<\/a><\/p>\n<p class=\"\">&nbsp;<\/p>\n<\/div>\n<div class=\"col-lg-1 col-md-12 col-sm-12 col-xs-12\"><\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; Add the LVGL source code to an STM32 project &nbsp; In this article, we will guide you on how to add the LVGL source code to an STM32 project and run sample applications on the STM32 board. We will start by covering the STM32F429 Discovery Board, which will serve as our primary board for [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":15362,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ocean_post_layout":"","ocean_both_sidebars_style":"","ocean_both_sidebars_content_width":0,"ocean_both_sidebars_sidebars_width":0,"ocean_sidebar":"0","ocean_second_sidebar":"0","ocean_disable_margins":"enable","ocean_add_body_class":"","ocean_shortcode_before_top_bar":"","ocean_shortcode_after_top_bar":"","ocean_shortcode_before_header":"","ocean_shortcode_after_header":"","ocean_has_shortcode":"","ocean_shortcode_after_title":"","ocean_shortcode_before_footer_widgets":"","ocean_shortcode_after_footer_widgets":"","ocean_shortcode_before_footer_bottom":"","ocean_shortcode_after_footer_bottom":"","ocean_display_top_bar":"default","ocean_display_header":"default","ocean_header_style":"","ocean_center_header_left_menu":"0","ocean_custom_header_template":"0","ocean_custom_logo":0,"ocean_custom_retina_logo":0,"ocean_custom_logo_max_width":0,"ocean_custom_logo_tablet_max_width":0,"ocean_custom_logo_mobile_max_width":0,"ocean_custom_logo_max_height":0,"ocean_custom_logo_tablet_max_height":0,"ocean_custom_logo_mobile_max_height":0,"ocean_header_custom_menu":"0","ocean_menu_typo_font_family":"0","ocean_menu_typo_font_subset":"","ocean_menu_typo_font_size":0,"ocean_menu_typo_font_size_tablet":0,"ocean_menu_typo_font_size_mobile":0,"ocean_menu_typo_font_size_unit":"px","ocean_menu_typo_font_weight":"","ocean_menu_typo_font_weight_tablet":"","ocean_menu_typo_font_weight_mobile":"","ocean_menu_typo_transform":"","ocean_menu_typo_transform_tablet":"","ocean_menu_typo_transform_mobile":"","ocean_menu_typo_line_height":0,"ocean_menu_typo_line_height_tablet":0,"ocean_menu_typo_line_height_mobile":0,"ocean_menu_typo_line_height_unit":"","ocean_menu_typo_spacing":0,"ocean_menu_typo_spacing_tablet":0,"ocean_menu_typo_spacing_mobile":0,"ocean_menu_typo_spacing_unit":"","ocean_menu_link_color":"","ocean_menu_link_color_hover":"","ocean_menu_link_color_active":"","ocean_menu_link_background":"","ocean_menu_link_hover_background":"","ocean_menu_link_active_background":"","ocean_menu_social_links_bg":"","ocean_menu_social_hover_links_bg":"","ocean_menu_social_links_color":"","ocean_menu_social_hover_links_color":"","ocean_disable_title":"default","ocean_disable_heading":"default","ocean_post_title":"","ocean_post_subheading":"","ocean_post_title_style":"","ocean_post_title_background_color":"","ocean_post_title_background":0,"ocean_post_title_bg_image_position":"","ocean_post_title_bg_image_attachment":"","ocean_post_title_bg_image_repeat":"","ocean_post_title_bg_image_size":"","ocean_post_title_height":0,"ocean_post_title_bg_overlay":0.5,"ocean_post_title_bg_overlay_color":"","ocean_disable_breadcrumbs":"default","ocean_breadcrumbs_color":"","ocean_breadcrumbs_separator_color":"","ocean_breadcrumbs_links_color":"","ocean_breadcrumbs_links_hover_color":"","ocean_display_footer_widgets":"default","ocean_display_footer_bottom":"default","ocean_custom_footer_template":"0","ocean_post_oembed":"","ocean_post_self_hosted_media":"","ocean_post_video_embed":"","ocean_link_format":"","ocean_link_format_target":"self","ocean_quote_format":"","ocean_quote_format_link":"post","ocean_gallery_link_images":"off","ocean_gallery_id":[],"footnotes":""},"categories":[8],"tags":[],"class_list":["post-15349","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog","entry","has-media"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to add the LVGL source code to an STM32 project?<\/title>\n<meta name=\"description\" content=\"In this article, you learn how to add the LVGL source code to an STM32 project and run sample applications on the STM32 board. STM32F429\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/fastbitlab.com\/blog\/add-the-lvgl-source-code-to-an-stm32-project\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to add the LVGL source code to an STM32 project?\" \/>\n<meta property=\"og:description\" content=\"In this article, you learn how to add the LVGL source code to an STM32 project and run sample applications on the STM32 board. STM32F429\" \/>\n<meta property=\"og:url\" content=\"https:\/\/fastbitlab.com\/blog\/add-the-lvgl-source-code-to-an-stm32-project\/\" \/>\n<meta property=\"og:site_name\" content=\"FastBit EBA\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/fastbiteba\/\" \/>\n<meta property=\"article:published_time\" content=\"2023-08-11T04:02:31+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-03-01T11:37:24+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-11.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1836\" \/>\n\t<meta property=\"og:image:height\" content=\"988\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"FastBitLab\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@fastbiteba\" \/>\n<meta name=\"twitter:site\" content=\"@fastbiteba\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"FastBitLab\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"11 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/add-the-lvgl-source-code-to-an-stm32-project\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/add-the-lvgl-source-code-to-an-stm32-project\\\/\"},\"author\":{\"name\":\"FastBitLab\",\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/#\\\/schema\\\/person\\\/e32b38e733a0d76ffa7e6bc998652e5d\"},\"headline\":\"STM32-LTDC, LCD-TFT, LVGL(MCU3) Lecture 50| Exercise 002 : project creation\",\"datePublished\":\"2023-08-11T04:02:31+00:00\",\"dateModified\":\"2024-03-01T11:37:24+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/add-the-lvgl-source-code-to-an-stm32-project\\\/\"},\"wordCount\":1727,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/add-the-lvgl-source-code-to-an-stm32-project\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/08\\\/Figure-11.png\",\"articleSection\":[\"Blog\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/add-the-lvgl-source-code-to-an-stm32-project\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/add-the-lvgl-source-code-to-an-stm32-project\\\/\",\"url\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/add-the-lvgl-source-code-to-an-stm32-project\\\/\",\"name\":\"How to add the LVGL source code to an STM32 project?\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/add-the-lvgl-source-code-to-an-stm32-project\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/add-the-lvgl-source-code-to-an-stm32-project\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/08\\\/Figure-11.png\",\"datePublished\":\"2023-08-11T04:02:31+00:00\",\"dateModified\":\"2024-03-01T11:37:24+00:00\",\"description\":\"In this article, you learn how to add the LVGL source code to an STM32 project and run sample applications on the STM32 board. STM32F429\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/add-the-lvgl-source-code-to-an-stm32-project\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/add-the-lvgl-source-code-to-an-stm32-project\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/add-the-lvgl-source-code-to-an-stm32-project\\\/#primaryimage\",\"url\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/08\\\/Figure-11.png\",\"contentUrl\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/08\\\/Figure-11.png\",\"width\":1836,\"height\":988,\"caption\":\"Figure 11. Device configuration tool STM32CubeIDE\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/add-the-lvgl-source-code-to-an-stm32-project\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"STM32-LTDC, LCD-TFT, LVGL(MCU3) Lecture 50| Exercise 002 : project creation\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/\",\"name\":\"FastBit EBA\",\"description\":\"Your Online Academy of Embedded Systems\",\"publisher\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/#organization\",\"name\":\"FastBit EBA\",\"url\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/04\\\/logo-EzNrEnyr.png\",\"contentUrl\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/04\\\/logo-EzNrEnyr.png\",\"width\":640,\"height\":640,\"caption\":\"FastBit EBA\"},\"image\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/fastbiteba\\\/\",\"https:\\\/\\\/x.com\\\/fastbiteba\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/fastbit-embedded-brain-academy-b3167b124\\\/\",\"https:\\\/\\\/www.youtube.com\\\/channel\\\/UCa1REBV9hyrzGp2mjJCagBg\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/#\\\/schema\\\/person\\\/e32b38e733a0d76ffa7e6bc998652e5d\",\"name\":\"FastBitLab\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/9230d0f9bdef28b63a01e7ca274ee7b2e8ed9abe932ee564af8809caaf52a0c8?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/9230d0f9bdef28b63a01e7ca274ee7b2e8ed9abe932ee564af8809caaf52a0c8?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/9230d0f9bdef28b63a01e7ca274ee7b2e8ed9abe932ee564af8809caaf52a0c8?s=96&d=mm&r=g\",\"caption\":\"FastBitLab\"},\"description\":\"The FastBit Embedded Brain Academy uses the power of internet to bring the online courses related to the field of embedded system programming, Real time operating system, Embedded Linux systems, etc at your finger tip with very low cost. Backed with strong experience of industry, we have produced lots of courses with the customer enrolment over 3000+ across 100+ countries.\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to add the LVGL source code to an STM32 project?","description":"In this article, you learn how to add the LVGL source code to an STM32 project and run sample applications on the STM32 board. STM32F429","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/fastbitlab.com\/blog\/add-the-lvgl-source-code-to-an-stm32-project\/","og_locale":"en_US","og_type":"article","og_title":"How to add the LVGL source code to an STM32 project?","og_description":"In this article, you learn how to add the LVGL source code to an STM32 project and run sample applications on the STM32 board. STM32F429","og_url":"https:\/\/fastbitlab.com\/blog\/add-the-lvgl-source-code-to-an-stm32-project\/","og_site_name":"FastBit EBA","article_publisher":"https:\/\/www.facebook.com\/fastbiteba\/","article_published_time":"2023-08-11T04:02:31+00:00","article_modified_time":"2024-03-01T11:37:24+00:00","og_image":[{"width":1836,"height":988,"url":"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-11.png","type":"image\/png"}],"author":"FastBitLab","twitter_card":"summary_large_image","twitter_creator":"@fastbiteba","twitter_site":"@fastbiteba","twitter_misc":{"Written by":"FastBitLab","Est. reading time":"11 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/fastbitlab.com\/blog\/add-the-lvgl-source-code-to-an-stm32-project\/#article","isPartOf":{"@id":"https:\/\/fastbitlab.com\/blog\/add-the-lvgl-source-code-to-an-stm32-project\/"},"author":{"name":"FastBitLab","@id":"https:\/\/fastbitlab.com\/blog\/#\/schema\/person\/e32b38e733a0d76ffa7e6bc998652e5d"},"headline":"STM32-LTDC, LCD-TFT, LVGL(MCU3) Lecture 50| Exercise 002 : project creation","datePublished":"2023-08-11T04:02:31+00:00","dateModified":"2024-03-01T11:37:24+00:00","mainEntityOfPage":{"@id":"https:\/\/fastbitlab.com\/blog\/add-the-lvgl-source-code-to-an-stm32-project\/"},"wordCount":1727,"commentCount":0,"publisher":{"@id":"https:\/\/fastbitlab.com\/blog\/#organization"},"image":{"@id":"https:\/\/fastbitlab.com\/blog\/add-the-lvgl-source-code-to-an-stm32-project\/#primaryimage"},"thumbnailUrl":"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-11.png","articleSection":["Blog"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/fastbitlab.com\/blog\/add-the-lvgl-source-code-to-an-stm32-project\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/fastbitlab.com\/blog\/add-the-lvgl-source-code-to-an-stm32-project\/","url":"https:\/\/fastbitlab.com\/blog\/add-the-lvgl-source-code-to-an-stm32-project\/","name":"How to add the LVGL source code to an STM32 project?","isPartOf":{"@id":"https:\/\/fastbitlab.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/fastbitlab.com\/blog\/add-the-lvgl-source-code-to-an-stm32-project\/#primaryimage"},"image":{"@id":"https:\/\/fastbitlab.com\/blog\/add-the-lvgl-source-code-to-an-stm32-project\/#primaryimage"},"thumbnailUrl":"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-11.png","datePublished":"2023-08-11T04:02:31+00:00","dateModified":"2024-03-01T11:37:24+00:00","description":"In this article, you learn how to add the LVGL source code to an STM32 project and run sample applications on the STM32 board. STM32F429","breadcrumb":{"@id":"https:\/\/fastbitlab.com\/blog\/add-the-lvgl-source-code-to-an-stm32-project\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/fastbitlab.com\/blog\/add-the-lvgl-source-code-to-an-stm32-project\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fastbitlab.com\/blog\/add-the-lvgl-source-code-to-an-stm32-project\/#primaryimage","url":"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-11.png","contentUrl":"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2023\/08\/Figure-11.png","width":1836,"height":988,"caption":"Figure 11. Device configuration tool STM32CubeIDE"},{"@type":"BreadcrumbList","@id":"https:\/\/fastbitlab.com\/blog\/add-the-lvgl-source-code-to-an-stm32-project\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/fastbitlab.com\/blog\/"},{"@type":"ListItem","position":2,"name":"STM32-LTDC, LCD-TFT, LVGL(MCU3) Lecture 50| Exercise 002 : project creation"}]},{"@type":"WebSite","@id":"https:\/\/fastbitlab.com\/blog\/#website","url":"https:\/\/fastbitlab.com\/blog\/","name":"FastBit EBA","description":"Your Online Academy of Embedded Systems","publisher":{"@id":"https:\/\/fastbitlab.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/fastbitlab.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/fastbitlab.com\/blog\/#organization","name":"FastBit EBA","url":"https:\/\/fastbitlab.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fastbitlab.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2026\/04\/logo-EzNrEnyr.png","contentUrl":"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2026\/04\/logo-EzNrEnyr.png","width":640,"height":640,"caption":"FastBit EBA"},"image":{"@id":"https:\/\/fastbitlab.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/fastbiteba\/","https:\/\/x.com\/fastbiteba","https:\/\/www.linkedin.com\/in\/fastbit-embedded-brain-academy-b3167b124\/","https:\/\/www.youtube.com\/channel\/UCa1REBV9hyrzGp2mjJCagBg"]},{"@type":"Person","@id":"https:\/\/fastbitlab.com\/blog\/#\/schema\/person\/e32b38e733a0d76ffa7e6bc998652e5d","name":"FastBitLab","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/9230d0f9bdef28b63a01e7ca274ee7b2e8ed9abe932ee564af8809caaf52a0c8?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/9230d0f9bdef28b63a01e7ca274ee7b2e8ed9abe932ee564af8809caaf52a0c8?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/9230d0f9bdef28b63a01e7ca274ee7b2e8ed9abe932ee564af8809caaf52a0c8?s=96&d=mm&r=g","caption":"FastBitLab"},"description":"The FastBit Embedded Brain Academy uses the power of internet to bring the online courses related to the field of embedded system programming, Real time operating system, Embedded Linux systems, etc at your finger tip with very low cost. Backed with strong experience of industry, we have produced lots of courses with the customer enrolment over 3000+ across 100+ countries."}]}},"_links":{"self":[{"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/posts\/15349","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/comments?post=15349"}],"version-history":[{"count":5,"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/posts\/15349\/revisions"}],"predecessor-version":[{"id":16292,"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/posts\/15349\/revisions\/16292"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/media\/15362"}],"wp:attachment":[{"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/media?parent=15349"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/categories?post=15349"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/tags?post=15349"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}