TouchGFX & STM32CUBEMX integration results in a white LCD screen using STM32H7B3I-DK.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-04-11 06:59 PM
Hello,
INFO
1- I currently have a problem with the STM32H7B3I-DK that I recently purchased.
2- I followed a tutorial from ST @ https://www.youtube.com/watch?v=mU5eZ_EXW8c . I'm using the same exact board.
3- TouchGFX rev: 4.13.0
4- STM32CUBEMX rev: 5.6.0
5-STM32CUBEIDE rev: 1.3.0
5- I have attached the whole project file to this post as "DK.rar". This .ioc file was generated via STM32CUBEMX using the Boards Selector filter when creating a new project and searching for the board "STM32H7B3I-DK" . The only thing edited in the .ioc file was similar to what was edited in the youtube video above.
Problem
The Code compiles successfully on STM32CUBEIDE however as soon as I enter debug (which runs successfully too) I get a white screen only on the LCD display. Which is different than what I have in the generated TouchGFX .
**It is important to mention that everything works fine if the application is generated by TouchGFX as a standalone program rather than being integrated with STM32CUBEMX.
Could someone please shed some light on this issue as to what the cause might be?
Thanks in advanced to all your replies !
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-04-12 02:32 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-04-12 04:10 PM
Hi @Community member​ Thanks for your reply! Unfortunately your solution did not work. I tried replacing the .ioc file and the linker files as you suggested. I also used your .ioc file to create a project from scratch, also didn't work. Finally, I tried making the same changes you did with my old project file I attached (DK.rar) and didn't work either.
It is my understanding that choosing an allocated buffer vs defining a buffer address doesn't make a difference since in the end they're reserved a space in the RAM. Do you have further suggestions? Thanks again !
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-04-13 02:12 AM
Hi,
I don't know (I never used) your uC (I read only its manual).
By your ioc file you have also an external RAM, in this first step you can use only the internal RAM (to check if the LCD work well).
You have to be sure about LCD hw configuration:
- clock (now it is 96Mhz... is it right?)
- LCD synchronization params (LTDC Parameter Settings)
- ram address for the frame buffer (LTDC layer setting)
If you use as frame buffer the area from 0x24000000 to 0x24000000+480*272*2 (it is the internael RAM) you can check if the LCD controller work fine (disabling TGFX),
it is sufficient to write in this area (writing a simple code) a color code (3 bytes per pixel: 0xFF0000) and see if the LCD views the right color or not. after that you can try to enable TGFX. If you use this area you have to exclude this area from linker script otherwise the linker will use this area for the variables of your firmware (see my linker script).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-04-14 01:51 AM
Hello,
In TouchGFX Designer, you have an Application Template for the STM32H7B3I-DK board which is compatible with TouchGFX Generator.
You can start from here as everything is correctly set up in this project to work on the spot.
Hope this will help you,
/Alexandre
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-04-14 09:41 AM
Hi @Alexandre RENOUX​ Thanks for your reply.... Yes, everything works well with TouchGFX as a standalone program. However, I would like to integrate TouchGFX with CubeMX. Do you know how to integrate them by having CubeMX as the starting point rather than starting from TouchGFX ?
Please refer to the "**It is Important" section of my question.
Looking forward to your reply.. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-04-14 11:34 PM
Hello,
I downloaded your project and I can see that the linker file STM32H7B3LIHXQ_FLASH.ld is not updated. In your case, CubeIDE does not know where is the external Flash so it cannot put anything in it when building.
A part of your .ld file:
MEMORY
{
DTCMRAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K
ITCMRAM (xrw) : ORIGIN = 0x00000000, LENGTH = 64K
RAM (xrw) : ORIGIN = 0x24000000, LENGTH = 1024K
FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 2048K
}
A part of the correct .ld file available in the AT in Designer :
MEMORY
{
DTCMRAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K
ITCMRAM (xrw) : ORIGIN = 0x00000000, LENGTH = 64K
RAM (xrw) : ORIGIN = 0x24000000, LENGTH = 256K
RAMFB (xrw) : ORIGIN = 0x24040000, LENGTH = 768K
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 2048K
OSPI (xrw) : ORIGIN = 0x90000000, LENGTH = 64M
}
You can see an OctoSPI Flash of 64M is declared in the correct one.
Replace your linker file by the enclosed one (which is the one from the AT).
We provide ATs to help people having a working project right at the start and as a reference. So that if you want something customized you can already start from a working and clean project with many parameters you can look through.
Creating an AT from scratch is very long and difficult and it depends on the board so I do not recommend this approach especially if it is a board that we support. The AT v3.0.0 work with CubeMX so I do not understand why you try to do it this way. Could you provide your reason ?
Hope this will help you,
/Alexandre
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-04-14 11:54 PM
Hi @Alexandre RENOUX​ ,
I did do this exactly. I compiled a standalone TouchGFX project, copied the linker file (ld) and did exactly what you described. It still does NOT work.
Linker File Differences
The difference between the linker file generated between TouchGFX and the CubeMX is actually further than what you described. The differences are :
1- Memory Section as you described above
2- A FramebufferSection added at the end of the linker file generated by TouchGFX, i copied that code below
FramebufferSection :
{
*(TouchGFX_Framebuffer TouchGFX_Framebuffer.*)
*(.gnu.linkonce.r.*)
. = ALIGN(0x4);
} >RAMFB
FontFlashSection :
{
*(FontFlashSection FontFlashSection.*)
*(.gnu.linkonce.r.*)
. = ALIGN(0x4);
} >OSPI
TextFlashSection :
{
*(TextFlashSection TextFlashSection.*)
*(.gnu.linkonce.r.*)
. = ALIGN(0x4);
} >OSPI
ExtFlashSection :
{
*(ExtFlashSection ExtFlashSection.*)
*(.gnu.linkonce.r.*)
. = ALIGN(0x4);
} >OSPI
What I have done
1- I copied the linker file generated by TouchGFX and replaced the one generated by CubeMX and simply compiled
The result: Successful compilation but error when clicking debug, See photo below. The error goes away when the linker file is returned to the original generated by CubeMX
2- I simply replaced the memory lines as you described above in the linker file generated by CubeMX and same error above happened.
3-I replaced all the main file generated by TouchGFX with the main file generated by CubeMx and lots of errors showed up
4- I tried to fix all the errors in step 3 one by one such as replacing core files, library files and driver files and the errors got worse.
I tried everything rational I could do but nothing worked. Thanks for your feedback though, do you have other thoughts? It would be nice if you could have access to the actual board so that you can see that nothing works as advertised.
Looking forwards & Thanks for your help again :)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-04-15 12:19 AM
Hello,
Can you try commenting FramebufferSection, FontFlashSection and TextFlashSection and tell me the error it throws ?
Unfortunately, I don't have the board with me, but I will see if I can find one. In the meantime, I'll try to have a look without debug.
What's very important to notice is that it works if you only use TouchGFX Designer and then it does not work if you use CubeIDE. It might also be due to the .launch file that is created when you make your debug configuration (just an idea).
/Alexandre
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-04-15 12:45 AM
And please can you tell me the goal of your project ? Why not using the AT ? I am still a bit lost on this side.
/Alexandre