Skip to main content
Dolence
Associate III
July 23, 2020
Question

Almost working! SSD1963 + FSMC + External SRAM. Why my images are like this?

  • July 23, 2020
  • 17 replies
  • 7722 views

Hi! I have been trying to make things work for a couple of days. I'm using an Alientek Explorer developer board (STM32F407) and it the documentation is nonexistent. Everything is in chinese characters and it's been so hard to learn from examples when everything is unintelligible. Lucky me the new STM32CubeIDE is a breeze to use! It's so good the way everything is well connected!

I have this display: https://www.buydisplay.com/7-tft-screen-touch-lcd-display-module-w-ssd1963-controller-board-mcu

I'm not using DMA transfer yet. Trying to make the simpler way first and improve later.

I have been following the doc for "FMC and SPI Display Interface" and STM32F412G-DISCO example.

Someone could please help me to identify why my image is being drawn liek this? I suspect my buffer is the problem.

Designer:

0693W000001tPNYQA2.jpg

Display:

0693W000001tPLwQAM.jpg

Designer:

0693W000001tPNdQAM.png

Display:

0693W000001tPMQQA2.jpg

May the cause of this be here?

void TouchGFXHAL::copyFrameBufferBlockToLCD(const Rect rect)
{
 __IO uint16_t* ptr;
 int16_t height;
 
 // Use default implementation (CPU copy!).
 // This can be accelerated using regular DMA hardware
 for (height = 0; height < rect.height ; height++)
 {
 ptr = getClientFrameBuffer() + rect.x + (height + rect.y) * 799;
 SSD1963_WriteMultipleData((uint16_t*)ptr, rect.width);
 }
}

I've attached the entire project files, just in case someone wanna kindly give it a look! Thanks in advance!

This topic has been closed for replies.

17 replies

Dolence
DolenceAuthor
Associate III
July 23, 2020
for (height = 0; height < rect.height ; height++)
 {
 ptr = getClientFrameBuffer() + rect.x + (height + rect.y) * 800;
 SSD1963_WriteMultipleData((uint16_t*)ptr, rect.width);
 }

How much this should be advancing the buffer? Actually for each loop it's advancing 1600 (0x640). I don't know why it's not working as expected.

After initialization I can write to display and everything works fine. I can clear screen, draw lines, draw rects and filled rects. I guess it means my problem isn't related to the display initialization or drawing to the FSMC bus. TouchGFX is drawing line by line until the display is filled as expected. What is wrong? Any thoughts on this?

Tesla DeLorean
Guru
July 23, 2020

If the width is 800 pixels, the buffer should advance 1600 bytes for 16-bit words

Make sure the casting and math is appropriate as some of the computations will exceed 16-bit

There could be some initialization of the SDD1963 causing multiple tiles/windows rather than a linear frame buffer.

Read back the frame buffer.

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
Dolence
DolenceAuthor
Associate III
July 23, 2020

Hi clive1! Thanks for your reply.

I made some tests before the touchgfx call. I can write sequentially to FSMC and data is being plotted to the screen as a linear fb.

I'm self learner coming from Atmel 8-bits micros. What you mean by reading back the framebuffer? I haven't made any progress since yesterday. Could you pelase elaborate a little more since I'm kind of lost here? Could it be something related to the differences between FSMC and FMC?

Edit: One thing different from touchgfx is the buffer in SRAM. I'm not sure if the address is correct as it's the first time I'm using it. Will double check this.

Dolence
DolenceAuthor
Associate III
July 27, 2020

Still couldn't get it working. Anyone else using Touchgfx and a similar high resolution display? I haven't found anything besides the 240x240 px examples.​

Dolence
DolenceAuthor
Associate III
July 30, 2020

I got it! I was suspecting on my SRAM configuration and the problem was on FSMC address configuration. It was set to 18 address pins and reading through the SRAM datasheet I noticed it has to be 19. I forgot to count A0!​

​​My main concern is regarding speed. Tomorrow I will try to setup DMA and optimize FSMC timings, but it still a very large screen to update. I have SRAM and LCD on FSMC, how much one affect the other fighting for the bus? Storing images on SPI flash would impact performance too, right?

hjh
Associate III
July 31, 2020

Hi

Are you able to share the working code as you did above ?

Hjalmar

Dolence
DolenceAuthor
Associate III
July 31, 2020

Yes, no problem! Which hardware you using? Only thing bothering me is speed. Didn't tried DMA transfers yet. I need to learn how to do it.

I'm considering to move to a RGB/LTDC setup. Unfortunately the board I want to buy have 40 pins RGB interface and the nicer displays are 50 pins.​

hjh
Associate III
August 1, 2020

Hi

THANKS ;o)

i do ust STM32F407VET6 and SSD1963 7 inch screen like yours ...it is running STEMWIN like a charm, but what to try TouchGfx

I do browse trough above code yesterday evening, but need some more time to understand how to implemet a custom driver in TouchGFX.

Therefore i ask to be sure that the code i am looking on are working ;o)

I do have my stm32F7-Discovery running fine with TouchGfx, but would also like to understand the custom driver setup.

Thanks an great summer to you

Hjalmar

ERund.1
Associate
October 17, 2020

Hi! Were you able to get DMA working?

Thank you!

Bdbsu.1
Visitor II
January 4, 2021

I think you have some technical issues in you software i also faced this type of problem in my software two months ago but then read an article that gave me a complete solution about it you can also search for its solution i hope you will find it.