FPGA processing method based on LVGL
The LVGL-based FPGA processing method simplifies FPGA system development, solves the problems of complex development and high resource consumption in the existing technology, and realizes a system with wider application range, shortened development cycle and easy maintenance, with hardware acceleration and multiple functions. Interface integration capabilities for multi-monitor systems.
Patent Information
- Application Number
- CN202410549681.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-06
- Publication Date
- 2024-08-27
AI Technical Summary
The existing FPGA system is complex to develop, has a long development cycle, is difficult to maintain and modify, and requires a large amount of PC-side and FPGA-side resources. Moreover, the existing MQTT-based implementation requires network connection and third-party software support.
Adopting LVGL-based FPGA processing methods, including LVGL underlying construction, library transplantation, driver adaptation, GUI interface development and control signal association steps, using the IIC protocol to achieve control, suitable for bare metal platforms, simplifying the development process, reducing resource consumption, and achieving independence GUI interface design and multi-monitor systems.
It has realized an FPGA system with wider application range, shortened development cycle, and easy maintenance. It has hardware acceleration capability and dynamic reconfiguration capability. It is suitable for diversified display needs, improves rendering rate and response speed, and supports the independent operation of multiple GUI instances.
Smart Images

Figure CN118550531A
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of FPGA development, and in particular to an FPGA processing method based on LVGL. Background Art
[0002] In the prior art, system-based Qt development mainly has the following problems:
[0003] 1. After building the underlying logic of FPGA, you must build the system, such as Linux, and then use FPGA system building tools such as petalinux to build the system, including the kernel, device tree, file system, etc., and then transplant development tool libraries such as qt and python on the system, and finally adapt the hardware interface to the UI interaction designed based on qt software.
[0004] 2. The development is complex, the development cycle is long, and the subsequent maintenance and modification are troublesome. It requires a huge amount of PC resources and FPGA PS resources.
[0005] After searching, the application publication number CN117667091A, a terminal human-computer interaction method and device based on LVGL and MQTT, uses LVGL to realize display. Compared with other display technologies, LVGL occupies less memory and is more suitable for use in power terminals based on embedded systems. The various controls provided by LVGL make the terminal interface more beautiful. LVGL supports the interactive mode of keys and the callback function processing mechanism, which makes the key response faster and the user's key operation smoother. MQTT is different from other communication protocols. It is lighter and simpler, and is suitable for terminals based on embedded systems. The present invention uses the lightweight, simple and easy-to-implement mqtt protocol to realize instant and stable communication of multiple modules in the terminal. The present invention uses one of the modules of the power terminal to manage the allocation of display rights, which realizes that multiple modules in the terminal share display resources while making the use of public display resources of the terminal device more orderly, realizing friendly human-computer interaction functions.
[0006] Disadvantages: This patent is based on MQTT (a lightweight network protocol). The implementation platform must be connected to the network and use third-party MQTT client software to achieve it.
[0007] This patent does not require a network environment or third-party software, and implements control based on the IIC protocol. It has a wider range of applications and is easier to implement. Summary of the invention
[0008] The present invention aims to solve the above problems of the prior art. A FPGA processing method based on LVGL is proposed. The technical solution of the present invention is as follows:
[0009] An FPGA processing method based on LVGL comprises the following steps:
[0010] LVGL lightweight multifunctional graphics library underlying construction steps; LVGL library porting steps; driver adaptation steps; GUI interface development steps; control signal association steps.
[0011] Furthermore, the LVGL bottom layer construction steps specifically include:
[0012] Display driver module construction;
[0013] Zynq7 system ip core configuration: IIC configuration, UART configuration, GPIO configuration, clock configuration, interrupt configuration;
[0014] The modules will be interconnected: ZYNQ7 system IP core, axi_smc multi-interaction IP core, ps7_axi_periph multi-interaction IP core, rst_ps7_0_100M clock reset IP core, axi_vdma data conversion IP core, rgb565to888 image conversion IP core, v_axi4s_vid_out data conversion IP core, rgb to lcd image conversion IP core, v_tc timing control IP core, axi_dynclk dynamic clock configuration IP core, xlconcat bit splicing IP core.
[0015] Furthermore, the LVGL library transplantation step specifically includes:
[0016] Download the library source code from the LVGL official website;
[0017] Ported to the vivado SDK (software development kit) development platform.
[0018] Furthermore, the drive adaptation step specifically includes:
[0019] LCD display driver adaptation;
[0020] Touch driver adaptation;
[0021] Dynamic clock driver adaptation.
[0022] Furthermore, the GUI interface development step specifically includes:
[0023] Use development tools such as CodeBlocks to open the LVGL library source code;
[0024] Conduct component and background design;
[0025] Simulation verification.
[0026] Furthermore, the control signal association step specifically includes:
[0027] Modify the lv_conf file in the LVGL library source code: enable the configuration file, configure the display memory location and size; modify the lv_port_disp file in the LVGL library source code: associate the LCD display drive signal;
[0028] Modify the lv_port_indev file in the LVGL library source code: associate the touch drive signal.
[0029] Furthermore, the BD visualization hardware module design of the system mainly consists of the following parts: ZYNQ7 system IP core, axi_smc multi-interaction IP core, ps7_axi_periph multi-interaction IP core, rst_ps7_0_100M clock reset IP core, axi_vdma data conversion IP core, rgb565to888 image conversion IP core, v_axi4s_vid_out data conversion IP core, rgb tolcd image conversion IP core, v_tc timing control IP core, axi_dynclk dynamic clock configuration IP core, xlconcat bit splicing IP core;
[0030] The ZYNQ7 system IP core is used to implement the interface between the processing system and the programmable logic. The axi_smc multi-interaction IP core is used to connect multiple AXI memory-mapped master and slave devices to improve interconnection and bandwidth efficiency. The ps7_axi_periph multi-interaction IP core is used to implement the communication interface between the processing system and the programmable logic, allowing high-speed data transmission. The rst_ps7_0_100M clock reset IP core is used to provide a 100Mhz clock and clock reset. The axi_vdma data conversion IP core is used to implement efficient direct memory access to video streams. The rgb565to888 image conversion IP core is used to convert 16-bit video data to 24 bits. The v_axi4s_vid_out data conversion IP core is used to route video stream data from the AXI4-Stream interface to the video interface. The rgb to The lcd image conversion IP core is used to convert the RGB video format to the LCD video output format, the v_tc timing control IP core is used to generate timing signals in the video system, including synchronization signals and blanking signals, the axi_dynclk dynamic clock configuration IP core is used to dynamically generate and adjust the clock signal, and the xlconcat bit splicing IP core is used to implement the serial operation of signals in hardware design;
[0031] The system interface mainly consists of the following parts: lcd_0 display interface, UART serial port printing interface, IIC and GPIO_EMIO touch interface.
[0032] Furthermore, the ZYNQ core is configured with IIC and GPIO_EMIO interfaces to adapt to the touch screen, and the UART is brought out to facilitate on-demand debugging of the system and print errors; then the HP port of the ZYNQ core is configured to connect to axi_vdma through asi_smc to transmit image data at high speed and convert it into the storage format of AXI Stream, and then the data bit width is converted into rgb888 format through rgb565to888 and transmitted to v_axi4s_vid_out; the function of the v_axi4s_vid_out ip core is to convert the data from the format of AXIStream into the RGB data format of video output, and in the meantime, the v_tc timing control ip core needs to be added to dynamically configure the output video timing; then the data image format is converted into RGB565 through rgb to lcd, and the LCD screen output is connected through the lcd_0 interface.
[0033] Furthermore, the system clock is 100Mhz, which is output by rst_ps7_0_100M ip, and the axi_dynclk ip core can automatically adapt to LCD screens with different clock requirements. Then, the LVGL library is ported on the PS side, the device driver is written and the interface is adapted; finally, LVGL is configured for UI design.
[0034] The advantages and beneficial effects of the present invention are as follows:
[0035] Compared with the existing system-based Qt development, the FPGA processing method based on LVGL of the present invention has a wider application range. In addition to being applicable to system development, it is also applicable to bare metal platforms. In addition, since the development process is simplified, the development cycle of the project can be greatly reduced and it is easy to maintain.
[0036] The innovation lies mainly in the significant hardware acceleration capability, dynamic reconfiguration capability and multi-interface integration capability of FPGA. By utilizing the parallel processing capability of FPGA, some operations of the graphics library can be hardware accelerated, thereby improving the rendering rate and response speed; and the logic of the GUI can be updated or modified without shutting down the system, thereby dynamically changing the interface function or style; and multiple LVGL GUI instances can be integrated on a single FPGA, each instance running an independent interface, which can be applied to diversified display requirements, such as multi-monitor systems. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 It is a flow chart of an FPGA processing method based on LVGL in a preferred embodiment provided by the present invention.
[0038] Figure 2 It is the BD design circuit diagram of the system. DETAILED DESCRIPTION
[0039] The following will describe the technical solutions in the embodiments of the present invention in detail in conjunction with the accompanying drawings in the embodiments of the present invention. The described embodiments are only part of the embodiments of the present invention.
[0040] The technical solution of the present invention to solve the above technical problems is:
[0041] like Figure 1 As shown, an FPGA processing method based on LVGL includes the following steps: LVGL (Lightweight Multi-Function Graphics Library) bottom layer construction step; LVGL library transplantation step; driver adaptation step; GUI interface development step; control signal association step.
[0042] Preferably, the LVGL bottom layer construction steps specifically include:
[0043] (1) Display driver module construction
[0044] (2) Zynq7 system ip core configuration: IIC configuration, UART configuration, GPIO configuration, clock configuration, interrupt configuration
[0045] (3) Module interconnection: ZYNQ7 system IP core, axi_smc multi-interaction IP core,
[0046] ps7_axi_periph multi-interaction ip core, rst_ps7_0_100M clock reset ip core,
[0047] axi_vdma data conversion ip core, rgb565to888 image conversion ip core,
[0048] v_axi4s_vid_out data conversion IP core, rgb to lcd image conversion IP core, v_tc timing control IP core, axi_dynclk dynamic clock configuration IP core, xlconcat bit splicing IP core. (Attached Figure 2 )
[0049] Preferably, the LVGL library transplantation step specifically includes:
[0050] (1) Download the library source code from the LVGL official website
[0051] (2) Ported to the Vivado SDK (Software Development Kit) development platform
[0052] Preferably, the drive adaptation step specifically includes:
[0053] (1) LCD display driver adaptation
[0054] (2) Touch driver adaptation
[0055] (3) Dynamic clock drive adaptation
[0056] Preferably, the GUI interface development step specifically includes:
[0057] (1) Use development tools such as CodeBlocks to open the LVGL library source code
[0058] (2) Design components and background
[0059] (3) Simulation Verification
[0060] Preferably, the control signal association step specifically includes:
[0061] (1) Modify the lv_conf file in the LVGL library source code: enable the configuration file, configure the display memory location and size
[0062] (2) Modify the lv_port_disp file in the LVGL library source code: Associate the LCD display drive signal
[0063] (3) Modify the lv_port_indev file in the LVGL library source code: Associate the touch drive signal
[0064] Preferably, the BD (visualization hardware module) design of the system is mainly composed of the following parts: ZYNQ7 system IP core, axi_smc multi-interaction IP core, ps7_axi_periph multi-interaction IP core, rst_ps7_0_100M clock reset IP core, axi_vdma data conversion IP core, rgb565to888 image conversion IP core, v_axi4s_vid_out data conversion IP core, rgb tolcd image conversion IP core, v_tc timing control IP core, axi_dynclk dynamic clock configuration IP core, xlconcat bit splicing IP core;
[0065] The ZYNQ7 system IP core is used to implement the interface between the processing system and the programmable logic. The axi_smc multi-interaction IP core is used to connect multiple AXI memory-mapped master and slave devices to improve interconnection and bandwidth efficiency. The ps7_axi_periph multi-interaction IP core is used to implement the communication interface between the processing system and the programmable logic, allowing high-speed data transmission. The rst_ps7_0_100M clock reset IP core is used to provide a 100Mhz clock and clock reset. The axi_vdma data conversion IP core is used to implement efficient direct memory access to video streams. The rgb565to888 image conversion IP core is used to convert 16-bit video data to 24 bits. The v_axi4s_vid_out data conversion IP core is used to route video stream data from the AXI4-Stream interface to the video interface. The rgb to The lcd image conversion IP core is used to convert the RGB video format to the lcd video output format, the v_tc timing control IP core is used to generate timing signals in the video system, such as synchronization signals and blanking signals, etc., and the axi_dynclk dynamic clock configuration IP core is used to dynamically generate and adjust the clock signal. The xlconcat bit splicing IP core is used to implement the serial operation of signals in hardware design.
[0066] The system interface mainly consists of the following parts: lcd_0 display interface, UART serial port printing interface, IIC and GPIO_EMIO touch interface.
[0067] Preferably, the ZYNQ core is configured with IIC and GPIO_EMIO interfaces to adapt to the touch screen, and the UART is brought out to facilitate on-demand debugging of the system and print errors; then the HP port of the ZYNQ core is configured to connect to axi_vdma through asi_smc to transmit image data at high speed and convert it into the storage format of AXI Stream, and then the data bit width is converted into rgb888 format through rgb565to888 and transmitted to v_axi4s_vid_out; the function of the v_axi4s_vid_out ip core is to convert the data from the format of AXIStream into the RGB data format of video output, and in the meantime, the v_tc timing control ip core needs to be added to dynamically configure the output video timing; then the data image format is converted into RGB565 through rgb to lcd, and the LCD screen output is connected by the lcd_0 interface.
[0068] Preferably, the system clock is 100Mhz, which is output by rst_ps7_0_100M ip, and the axi_dynclk ip core can automatically adapt to LCD screens with different clock requirements, and then transplant the LVGL library on the PS side, write the device driver and perform interface adaptation; finally, configure LVGL for UI design.
[0069] The human-computer interaction method based on FPGA mentioned in the present invention can be realized with bare metal and system platforms, is lightweight, consumes few resources, is easy to implement, has a short development cycle, and is easy to maintain and modify in the later stage, which greatly enhances the practicality of engineering development and realizes real-time and effective human-computer UI interaction.
[0070] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0071] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0072] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0073] The above embodiments should be understood to be only used to illustrate the present invention and not to limit the protection scope of the present invention. After reading the contents of the present invention, technicians can make various changes or modifications to the present invention, and these equivalent changes and modifications also fall within the scope defined by the claims of the present invention.
Claims
1. An FPGA processing method based on LVGL, It is characterized in that The following steps are involved: LVGL lightweight multi-functional graphics library bottom-level construction steps; LVGL library porting steps; driver adaptation steps; GUI interface development steps; control signal association steps.
2. The FPGA processing method based on LVGL according to claim 1, It is characterized in that The LVGL bottom layer construction steps specifically include: (1) Display driver module construction; (2) Zynq7 system ip core configuration: IIC configuration, UART configuration, GPIO configuration, clock configuration, interrupt configuration; (3) The modules are interconnected: ZYNQ7 system IP core, axi_smc multi-interaction IP core, ps7_axi_periph multi-interaction IP core, rst_ps7_0_100M clock reset IP core, axi_vdma data conversion IP core, rgb565to888 image conversion IP core, v_axi4s_vid_out data conversion IP core, rgb to lcd image conversion IP core, v_tc timing control IP core, axi_dynclk dynamic clock configuration IP core, and xlconcat bit splicing IP core.
3. The FPGA processing method based on LVGL according to claim 1, It is characterized in that The LVGL library transplantation steps specifically include: (1) Download the library source code from the LVGL official website; (2) Ported to the vivado SDK (software development kit) development platform.
4. The FPGA processing method based on LVGL according to claim 1, It is characterized in that The drive adaptation step specifically includes: (1) LCD display driver adaptation; (2) Touch driver adaptation; (3) Dynamic clock drive adaptation.
5. The FPGA processing method based on LVGL according to claim 1, It is characterized in that The GUI interface development steps specifically include: (1) Use development tools such as CodeBlocks to open the LVGL library source code; (2) Design components and background; (3)Simulation verification.
6. The FPGA processing method based on LVGL according to claim 1, It is characterized in that The control signal association step specifically includes: (1) Modify the lv_conf file in the LVGL library source code: enable the configuration file, configure the display memory location and size; (2) Modify the lv_port_disp file in the LVGL library source code: associate the LCD display drive signal; (3) Modify the lv_port_indev file in the LVGL library source code: associate the touch drive signal.
7. The FPGA processing method based on LVGL according to claim 1, It is characterized in that The BD visualization hardware module design of the system mainly consists of the following parts: ZYNQ7 system IP core, axi_smc multi-interaction IP core, ps7_axi_periph multi-interaction IP core, rst_ps7_0_100M clock reset IP core, axi_vdma data conversion IP core, rgb565to888 image conversion IP core, v_axi4s_vid_out data conversion IP core, rgb to lcd image conversion IP core, v_tc timing control IP core, axi_dynclk dynamic clock configuration IP core, xlconcat bit splicing IP core; The ZYNQ7 system IP core is used to implement the interface between the processing system and the programmable logic. The axi_smc multi-interaction IP core is used to connect multiple AXI memory-mapped master and slave devices to improve interconnection and bandwidth efficiency. The ps7_axi_periph multi-interaction IP core is used to implement the communication interface between the processing system and the programmable logic, allowing high-speed data transmission. The rst_ps7_0_100M clock reset IP core is used to provide a 100Mhz clock and clock reset. The axi_vdma data conversion IP core is used to implement efficient direct memory access to video streams. The rgb565to888 image conversion IP core is used to convert 16-bit video data to 24 bits. The v_axi4s_vid_out data conversion IP core is used to route video stream data from the AXI4-Stream interface to the video interface. The rgb to The lcd image conversion IP core is used to convert the RGB video format to the LCD video output format, the v_tc timing control IP core is used to generate timing signals in the video system, including synchronization signals and blanking signals, the axi_dynclk dynamic clock configuration IP core is used to dynamically generate and adjust the clock signal, and the xlconcat bit splicing IP core is used to implement the serial operation of signals in hardware design; The system interface mainly consists of the following parts: lcd_0 display interface, UART serial port printing interface, IIC and GPIO_EMIO touch interface.
8. The FPGA processing method based on LVGL according to claim 7, It is characterized in that The ZYNQ core is configured with IIC and GPIO_EMIO interfaces to adapt to the touch screen, and the UART is brought out to facilitate on-demand debugging of the system and print errors; then the HP port of the ZYNQ core is configured to connect to axi_vdma through asi_smc to transmit image data at high speed and convert it into the storage format of AXI Stream, and then the data bit width is converted into rgb888 format through rgb565to888 and transmitted to v_axi4s_vid_out; the function of the v_axi4s_vid_out ip core is to convert the data from the format of AXI Stream into the RGB data format of video output, and in the meantime, the v_tc timing control ip core needs to be added to dynamically configure the output video timing; then the data image format is converted into RGB565 through rgb to lcd, and the LCD screen output is connected through the lcd_0 interface.
9. The FPGA processing method based on LVGL according to claim 8, It is characterized in that The system clock is 100Mhz, which is output by rst_ps7_0_100M ip, and the axi_dynclk ip core can automatically adapt to LCD screens with different clock requirements. Then, the LVGL library is ported on the PS side, the device driver is written and the interface is adapted; finally, LVGL is configured for UI design.
