Skip to content
This repository has been archived by the owner on Jan 23, 2022. It is now read-only.

A LVGL porting for Cortex-M55 running on an Arm official FPGA prototyping development board called MPS3 (AN547), see Figure 1. It is also possible to run the project template on an emulator called Corstone-300-FVP, which is free.

License

Notifications You must be signed in to change notification settings

GorgonMeducer/lv_port_mps3_an547_cm55

Repository files navigation

lv_port_mps3_an547_cm55

A LVGL porting for Cortex-M55 running on an Arm official FPGA prototyping development board called MPS3 (AN547), see Figure 1. It is also possible to run the project template on an emulator called Corstone-300-FVP, which is free.

Figure 1 Arm MPS3 FPGA prototyping board

Features

  • LVGL 8.1.x (CMSIS-Pack)
  • 320 * 240 RGB565 LCD Display connected with an Integrated Color LCD parallel interface.
  • Default System Clock: 32MHz (50MHz Max)
  • CPU: Cortex-M55 with Helium
    • DCache
    • ICache
    • ITCM: 512KB
    • DTCM: 512KB
  • NPU: Ethos-U55
  • PRAM (Used for Code and RO-Data): 2MByte
  • SRAM: 4MByte
  • DDR4: 1GByte
  • MDK Project with Arm Compiler 6

How To Use

How to run the simulation

  1. Download the Corstone-300-FVP and install it.
  2. Open project in MDK
  3. Select the 'Cortex-M55_FVP'

  1. Open 'Options for Target' window and select the 'Debug' panel

  1. Press 'Settings' button on the right corner

  1. Click the '...' button on the top-right corner, browse to the folder where Corstone-300-FVP is installed and and select the executable file, i.e. FVP_Corstone_SSE-300_EThos-U55.exe.

Usually the Corstone-300-FVP is located in the following path:

C:\Program Files\ARM\FVP_Corstone_SSE-300\models\Win64_VC2017\FVP_Corstone_SSE-300_Ethos-U55.exe
  1. Click the '...' button next to the 'Target' textbox and select the cpu0 in the popup dialog. Click OK to confirm.

  1. Click the OK button to close the 'Models Armv8-M Target Driver Setup' window.
  2. Compile and Debug. You should be able to see the LVGL benchmark running on the FVP window as shown below:

NOTE:

  1. FVP can ONLY be used to verify the correctness of firmware functionality

  2. NO performance data generated from FVP is trustworthy. FVP is simply NOT designed for performance evaluation.

    For example, the -O0 optimization might looks like running as fast as -Ofast and -Ofast+LTO (Link-Time-Optimization) runs very slow. In fact, in the real hardware, -Ofast+LTO > -Ofast >> -O0.

How to Run on MPS3

  1. Open project in MDK
  2. Select the 'Cortex-M55_MPS3' configuration
  3. Compile and Debug

LVGL Porting Exercise

For people to learn and practice how to port LVGL to a LCD-Ready MDK project using LVGL cmsis-pack, a dedicated branch called "lvgl_porting_exercise" has been introduced. It contains a clean project which provides:

  • Low-level LCD APIs
extern int32_t  GLCD_Initialize          (void);
extern int32_t  GLCD_Uninitialize        (void);
extern int32_t  GLCD_SetForegroundColor  (uint32_t color);
extern int32_t  GLCD_SetBackgroundColor  (uint32_t color);
extern int32_t  GLCD_ClearScreen         (void);
extern int32_t  GLCD_SetFont             (GLCD_FONT *font);
extern int32_t  GLCD_DrawPixel           (uint32_t x, uint32_t y);
extern int32_t  GLCD_DrawHLine           (uint32_t x, uint32_t y, uint32_t length);
extern int32_t  GLCD_DrawVLine           (uint32_t x, uint32_t y, uint32_t length);
extern int32_t  GLCD_DrawRectangle       (uint32_t x, uint32_t y, uint32_t width, uint32_t height);
extern int32_t  GLCD_DrawChar            (uint32_t x, uint32_t y, int32_t  ch);
extern int32_t  GLCD_DrawString          (uint32_t x, uint32_t y, const char *str);
extern int32_t  GLCD_DrawBitmap          (uint32_t x, uint32_t y, 
                                          uint32_t width, uint32_t height, const uint8_t *bitmap);
  • A simple main() function

  • A simple way to display string on LCD

extern 
int32_t GLCD_DrawString(uint32_t x, uint32_t y, const char *str);

#define __LL_LCD_PRINT_BANNER(__STR)                                            \
        do {                                                                    \
            GLCD_DrawString(    (GLCD_HEIGHT) / 2 - 8,                          \
                                (GLCD_WIDTH - sizeof(__STR) * 6) / 2,           \
                                __STR);                                         \
        } while(0)
  • printf() is retargeted to USART0 (telnet in FVP emulation).
  • A function, GLCD_DrawBitmap(), for flushing display buffer to LCD, which supports window-mode (partial flush).
extern 
int32_t  GLCD_DrawBitmap (uint32_t x, uint32_t y, 
                          uint32_t width, uint32_t height, 
                          const uint8_t *bitmap);
  • Ready to Compile and Debug in FVP (Emulation) as shown in Figure 2.

Figure 2 A Clean Project Template for practicing LVGL Porting using LVGL CMSIS-Pack

image-20220117225044592

  • A new method, __cycleof__(), for measuring cpu cycles consumed by specified code segment.
    __cycleof__("Draw strings on LCD") {
        __LL_LCD_PRINT_BANNER("Hello LVGL!!");
    }

Figure 3 printf() and __cycleof__

image-20220117231318232

License

  • LVGL used in this project is under MIT license.
  • This project template is under Apache 2.0 license.

Reference

  1. Arm Corstone SSE-300 with Cortex-M55 and Ethos-U55 Example Subsystem for MPS3

About

A LVGL porting for Cortex-M55 running on an Arm official FPGA prototyping development board called MPS3 (AN547), see Figure 1. It is also possible to run the project template on an emulator called Corstone-300-FVP, which is free.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages