Skip to main content
Stefan Hittinger
Associate II
December 16, 2016
Question

STM32CUBE BSP package STM32F746G Bug at stlogo.h

  • December 16, 2016
  • 3 replies
  • 2207 views
Posted on December 16, 2016 at 08:41

I tried to use the project at C:\Users\xxx\STM32Cube\Repository\STM32Cube_FW_F7_V1.5.1\Projects\STM32746G-Discovery\Examples\BSP\Inc with Atollic IDE. With some efforts i was able to compile and debug. All was ok.

Then i used our company logo, transformed from BMP to .h instead of stlogo.h, but the resulting picture was a trapezoid one...

After some tests i found the following bug:

stlogo.h:

   - line 45: change entry 3 from 0x50 to 0x4F

stm32746g_discovery_lcd.c:

   - line 1060:   pbmp += (index + ((width + 1) * (height - 1) * (bit_pixel/8)));

   - line 1070:   pbmp -= (width + 1)*(bit_pixel/8);

With this change you can use standard BMP data from Windows bitmap files.

    This topic has been closed for replies.

    3 replies

    Walid FTITI_O
    Visitor II
    December 16, 2016
    Posted on December 16, 2016 at 16:20

    Hi

    hittinger.stefan

    ,

    First, thanks for the feedback and contribution.

    Just to make things more clear, I have a question: when you tried

    with Atollic IDE using stlogo.h, did that work ok or after the change of line 45 ? and the change number 2 in the Lcd file is necessary even when using stlogo.h ?

    Thanks in advance,

    -Walid F-

    Stefan Hittinger
    Associate II
    January 2, 2017
    Posted on January 02, 2017 at 13:11

    Hi Walid,

    sorry for my late answer, is was on holidays until now...

    I had to change both values. If i only change line 45, the default stlogo also was trapezoid (each new line starts 1 pixel earlier than the previous). Only with both changes, stlogo and other bmp are shown correctly.

    Technical Moderator
    January 10, 2017
    Posted on January 10, 2017 at 17:24

    Hello

    Hittinger.Stefan

    ‌,

    I have checked this case with same board and example and I cannot reproduce this issue.

    Could you please provide a screenshot of the resulting picture trapezoid that you have.

    Best Regards

    Imen

    In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks
    Stefan Hittinger
    Associate II
    January 11, 2017
    Posted on January 11, 2017 at 13:36

    Hello Imen,

    if you take the original files, all looks fine. if you use another logo instead of stlogo.h you will see the trapezoid version of this new logo. The changes allow you to see both, stlogo and external generated logo, in correct manner.

    Take any .bmp. convert it to hex. replace the code within stlogo.h by the new generated code. Translate and see...

    One other issue can produce this error: the Hex-converter i used. It is called HexConverter.exe from

    http://www.csoft.co.uk

    How do you convert bmp files?

    Best regards

    Stefan

    Stefan Hittinger
    Associate II
    January 12, 2017
    Posted on January 12, 2017 at 09:58

    Hello Imen,

    i read the format description of the bmp file format and checked stlogo an my own logo. Both have the correct values for dimension, color ... So they seemed to be ok.

    The difference between the 2 bmp is the line size: stlogo 80, my logo 115

    I changed my logo so i get a line length of 116 and used the original display routine.

    Now my logo and stlogo looked ok.

    It seems to be a problem with the line width, even number or uneven.

    Best regards

    Stefan