cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CUBE BSP package STM32F746G Bug at stlogo.h

Stefan Hittinger
Associate II
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.

6 REPLIES 6
Walid FTITI_O
Senior II
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
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.

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

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
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

Posted on January 11, 2017 at 16:27

Hi

Hittinger.Stefan

‌,

Thank you for posting yourfinding. I will check this case.

I recommend to review the BmpCvt.exe '

https://www.segger.com/emwin-bitmap-converter.html

' for emWin that you find in the STemwin package(STemWin_Library_V1.1.2\Libraries\STemWinLibrary522\Software)forconverting image formats like bmp andrefer to the emwin user manual in Chapter 10 Bitmap Converter.

Regards

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
Stefan Hittinger
Associate II
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