Skip to main content
Graduate II
August 5, 2023
Solved

how to convert image to hex file for STM32F746G-Disco board

  • August 5, 2023
  • 2 replies
  • 4101 views

I have loaded example from CubeMX for STM32F746G-Disco board, it is working fine.

This is the top of the hex file the original from CubeMX example

const uint32_t RGB565_480x272[65280] =
{
0x7A537A53,
0x82538253,

But when I am trying my own image, I cannot get the right format. Does anybody know what was used for the image conversion. I tired almost everything I could think about a few HEX converters and PhotoShop.

this is what I am getting, from the header it looks like 32 bit, RGB565 format with alpha.IMG_4320.JPG

 

this is what I am trying to display

240 x 160

lake.bmp

 

 

    This topic has been closed for replies.
    Best answer by MNapi

    it is guessing, you can spend this way another few weeks those online converters give 8 bit format like 0xFF so it does not look like the example format from CubeMX 0x7A537A53,

     

    I have just found pdf file called

    an4861-lcdtft-display-controller-ltdc-on-stm32-mcus-stmicroelectronics-2

    it explains that LCD-Image-Converter-20161012 was used (20161012 is version number from 5 years ago) and how

    so it look like this now, this is not the first time I am trying to find out what STM team used for image conversion. They give example in CubeMX but no explanation how to do the conversion was done. 

    IMG_4321.JPG

     

     

     

    2 replies

    Graduate II
    August 5, 2023

    BMPCONV or BMP2BIN type tools?

    If you understand the formats and basic C STDIO file routines you could presumably code something simple PC side.

    Use PAINT or similar to take complex forms like JPG or GIF which have compression, etc. The Microsoft BMP formats aren't particularly complicated, pretty simple raster formats..

    MNapiAuthor
    Graduate II
    August 5, 2023

    this does not help I tired BMPCONV. Actually I used BMPCONV on STM32F469I Diso and it worked but not STM32F746G. I uesd PAINT. PHOTOSHOP no luck.

     

    Graduate II
    August 5, 2023

    Primary you need understand formats usw. Strore 32 uint is only for optimal memory place. But if pixels is RGB565 then this is one pixel 16bit and no alpha. Good converting have TochGFX or LVGL.

    MNapiAuthor
    Graduate II
    August 5, 2023

    this does not make sense this is original format which works from CubeMX example

    0x7A537A53,

    16 bit would look like

    0xFFFF, for one pixel

     

    Graduate II
    August 5, 2023