In STM32CubeIDE: file -> new -> STM32 project board selector -> 32L4R9IDISCOVERY name the project -> Finish 'Yes' to initialize all peripherals with their default mode ..wait a minute or two.. a large amount of data may have to download from the Internet & unzip. Now in the Pinout & Configuration (CubeMX code generator GUI) - which you can return to by choosing the 'project name.ioc' file in the project's file list of STM32CubeIDE: System Core -> RCC: High Speed Clock (HSE): Crystal/Ceramic Resonator Clock Configuration tab, set the HSE input frequency to 16MHz to match the crystal on the disco board. Then click resolve clock issues. Connectivity -> I2C1: I2C Connectivity -> SDMMC1: Disable unless you plan to use it. default code causes big pause at startup Multimedia -> LTDC: Display Type, set to RGB565 (or RGB888, but ensure you use the correct DSI_DCS_SET_PIXEL_FORMAT as explained further down) Active Width -> 320px active height -> 320 lines Layer Settings: Window Position: Horizontal stop 319 Window Position: Vertical stop 319 Layer 0 Alpha constant for blending: 255 Frame Buffer: Layer 0 color frame buffer line length: 320 Frame Buffer: Layer 0 color frame buffer number of lines: 320 Number of Layers: 1 Layer Multimedia -> DSIHOST: Adapted command mode with TE Pin (can't remember if the TE pin is necessary, or if it's OK to have the TE signal as a DSI packet). It's wired in correctly to PF11 anyway. It looks like CubeMX doesn't let you configure Graphics middleware to use DSI Serial, unless you also use the GFXMMU. It seems to be very much stuck to the original smartwatch spec. Multimedia -> GFXMMU: Activated Default Value: 124 (this is so that you can see an obvious colour if the LUT mask is slightly wrong..) Physical address of buffer 0: (set to No Checking to allow arbitrary input): (uint32_t) GFXMMU_PHY_BUF_0 LUT Configuration -> Excel Import, and choose the Panasys LUT.xlsx. Set the Display BPP to match elsewhere Computing -> CRC: Activated Middleware -> GRAPHICS: Tick STemWin Display Interface -> Display Serial Interface using LTDC-DSIHOST-GFXMMU Parameter Settings -> MFX Driver -> RES Signal -> MFX-IO-PIN10 (this is because the reset pin goes via MFX IO expander) disable sdmmc or there will be a 10 second delay, unless you're using it. Project menu -> Generate Code, or use shortcut Alt-K. Watch in the bottom right for 'Code generation' to finish. Also it will offer to Generate Code if it thinks it needs to anyway. To the HARDWARE CONFIGURATION_Private_Variables of HW_Init.c, add: uint8_t GFXMMU_PHY_BUF_0[GFXMMU_FB_SIZE] __attribute__ ((aligned (16))); With the STM32L4R9I-DISCO board, it looks like CubeMX doesn't give you the option to choose 'other screen', so it generates code for the original smartwatch screen. With the F769I-DISCO board, you have the choice of the kit screen, or 'other'. So on the L4R9I we'll have to remove lots of unneeded DSI DCS codes. Open up STemwin_wrapper.c: Find the LCD Power ON sequence. remove all of it up until the Sleep out. Keep the sleep out and Display_On stuff there, and just add this in above it: HAL_DSI_ShortWrite(&hdsi, 0, DSI_DCS_SHORT_PKT_WRITE_P1, 0x36, 0x48); and //set to 16bpp pixel format (as per the ST7789S datasheet) HAL_DSI_ShortWrite(&hdsi, 0, DSI_DCS_SHORT_PKT_WRITE_P1, DSI_SET_PIXEL_FORMAT, 0x05); or //set to 24bpp pixel format. This seems to be default and can be left out. HAL_DSI_ShortWrite(&hdsi, 0, DSI_DCS_SHORT_PKT_WRITE_P1, DSI_SET_PIXEL_FORMAT, 0x07); Also, remove / disable the HAL_DSI_LongWrite for DSI_SET_TEAR_SCANLINE ScanLineParams, which is about 10 lines further down. The DSI_SET_TEAR_ON must remain, but the SET_TEAR_SCANLINE must go. The LCD Reset pin is connected via the MFX IO expander - pin 10 of it. I think because CubeMX says 'BSP API: Unknown', as usual, it doesn't configure any of the reset functions, even though we selected it. CubeMX does not work with the BSP libraries at all at this time as far as I know. Because I don't know what's really involved in getting the MFX to activate the reset pin (only just come across this) we'll just add the relavent BSP libraries and use the functions that are in there. So: Find where the FW/libraries are stored, usually under %userprofile% -> STM32Cube -> Repository -> STM32Cube_FW_L4_V1.14.0. Then go into Drivers -> BSP -> STM32L4R9I-Discovery, and copy the following header files into your project's include dir: stm32l4r9i_discovery_io.h stm32l4r9i_discovery.h and copy the same .c files into your projects Src dir. To the 'Private includes - USER CODE' section of main.h, add this: #include "stm32l4r9i_discovery.h" #include "stm32l4r9i_discovery_io.h" To the LCD_LL_Reset() function in STemwin_wrapper.c, inside the USER CODE area (so it won't get wiped out by CubeMX every time) add this (copied from STM32Cube\Repository\STM32Cube_FW_L4_V1.14.0\Projects\32L4R9IDISCOVERY\Examples\DSI\DSI_CmdMode_SingleBuffer\Src): BSP_IO_Init(); /* Configure the GPIO connected to DSI_3V3_POWERON signal as output low */ /* to activate 3V3_LCD. VDD_LCD is also activated if VDD = 3,3V */ BSP_IO_WritePin(IO_PIN_8, GPIO_PIN_RESET); BSP_IO_ConfigPin(IO_PIN_8, IO_MODE_OUTPUT); /* Wait at least 15 ms (minimum reset low width is 10ms and add margin for 1V8_LCD ramp-up) */ HAL_Delay(15); /* Configure the GPIO connected to DSI_RESET signal */ BSP_IO_ConfigPin(IO_PIN_10, IO_MODE_OUTPUT); /* Desactivate DSI_RESET */ BSP_IO_WritePin(IO_PIN_10, GPIO_PIN_SET); /* Wait reset complete time (maximum time is 5ms when LCD in sleep mode and 120ms when LCD is not in sleep mode) */ HAL_Delay(120); also, in the same place, add this, which is the code to enable the LCD backlight. You could / should put it in a nice function somewhere but this will do: __HAL_RCC_GPIOB_CLK_ENABLE(); GPIO_InitTypeDef GPIO_InitStruct; GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; GPIO_InitStruct.Pull = GPIO_NOPULL; GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; GPIO_InitStruct.Pin = GPIO_PIN_1; HAL_GPIO_Init(GPIOB, &GPIO_InitStruct); HAL_GPIO_WritePin(GPIOB, GPIO_PIN_1, GPIO_PIN_SET); Lastly, make the GUI_App.c do something better than a static 'Hello World': In the USER CODE part of GRAPHICS_MainTask(), put this: GUI_Clear(); GUI_SetColor(GUI_WHITE); GUI_SetFont(&GUI_FontD80); int i = 0; while(1) { GUI_DispDecAt( i++, 40, 120, 4); if (i > 9999) { i = 0; } } It should never reach the other while(1){GUI_Delay(100);} stuff, so that can stay there, since CubeMX will re-generate it every time anyway. Now when you try to compile it may probably fail due to IO_OK, IO_ERROR and IO_TIMEOUT being redeclared. That's because they're declared in that stm32l4r9i_discovery_io.h file above, as well as the project's STemwin_wrapper.h. So comment them out in STemwin_wrapper.h, just after the includes. You may have to 'clean' the project now, to fix the re-declaration problem. Project -> Clean menu. F11 to compile / debug Hopefully it works. EVERY TIME YOU MAKE A CHANGE IN CUBEMX, you will lose and have to re-do the following. This is because I can't see a USER CODE section that these bits could be put in to: add: HAL_DSI_ShortWrite(&hdsi, 0, DSI_DCS_SHORT_PKT_WRITE_P1, 0x36, 0x48); // if using 16bpp: HAL_DSI_ShortWrite(&hdsi, 0, DSI_DCS_SHORT_PKT_WRITE_P1, DSI_SET_PIXEL_FORMAT, 0x05); ..to STemwin_wrapper.c remove: all the other DSI init commands up until the sleep out, which stays remove: DSI_LongWrite Scanline in STemwin_wrapper.c remove: IO_OK, IO_ERROR etc in STemwin_wrapper.h (this bit here): typedef enum { IO_OK = 0x00, IO_ERROR = 0x01, IO_TIMEOUT = 0x02 }IO_StatusTypeDef; add: uint8_t GFXMMU_PHY_BUF_0[GFXMMU_FB_SIZE] __attribute__ ((aligned (16))); ..to HW_Init.c