Direct access to SPI FLASH, Problems with Image Decoder


What MCU/Processor/Board and compiler are you using?

I am using MCU: STM32F103ZET6 - Flash: W25Q128

What LVGL version are you using?

LVGL Version: V8.3.6

What do you want to achieve?

Directly read the image from FLASH and display it on the LCD。

What have you tried so far?

I have customized the image decoder interface, but I am not very familiar with color format conversion? Causing color confusion in rendering. The color depth is 16 bits.

Code to reproduce

Add a code snippet which can run in the simulator. It should contain only the relevant code that compiles without errors when separated from your main code base.

The code block(s) should be formatted like:

/*You code here*/
/*Post it another day*/

Screenshot and/or video

If possible, add screenshots and/or videos about the current state.

The extra bytes left me confused

My flash stores the original image .bin file.
The. bin file can be accurately read from flash without errors.
img size: 240 * 320 * 2 = 153600.
How to convert a 2-byte color depth to a 3-byte color depth

Finished product rendering

I solved it