I have some trouble using the SDRAM of the STM32F746G-Disco as a framebuffer for the LTDC with CubeMX 4.22 instead of CubeMX 4.18.
I configured my Project according to the Pinout of the Disco-Board and it worked fine with CubeMX 4.18. The SDRAM was configured like
in the BSP examples provided with CubeMX (I noticed that CubeMX does not allow WriteRecoveryTime set to 2 like in the BSP, only 3 or higher is possible).
I added my own code to initialise the SDRAM IC which is not generated by CubeMX. CubeMX initialises the FMC only. With CubeMX 4.18, everything works fine.
Also a Project created with the BSP files and CubeMX 4.18 and 4.22 work fine. After updating my Project to CMX 4.22, the SDRAM did not work correctly as
Framebuffer any more. Every 64. pixel, there are vertical lines and also there ist some random Pixel snow running all over the Screen (I am using CLUT 8 as colour mode).
The intended Screen Content is still visible but disturbed. The graphics data shown on the Screen is read from the internal Flash.
But I can fix this by flashing first my CubeMX 4.18 Project binary or the BSP Project binary of CMX 4.18 or 4.22 and afterwards flashing my CMX 4.22 Project binary.
Than, the SDRAM is still initialised correctly and working perfect as a Frame buffer. Only a power cycle resets the Hardware so my Project binary will not work properly.
This leads me to the conclusion that some Registers are not set correctly with my code, but after comparing the BSP Projects with my CMX 4.22 Project, I found no clue
what is going wrong. Migrating to CMX 4.23 crashed the whole Project, so i returned to 4.22, because everything except the SDRAM initialisation works there.
As a desperate step, i tried to copy and paste the BSP code into my Project to initialise the SDRAM without CMX, but I did not have success, the distortions of the
TFT Output are still the same.
Can someone give me a hint what is going wrong in my SDRAM initialisation code I attached in the Zip file ? A example using SDRAM with a CubeMX 4.22 Project would help, too.