cancel
Showing results for 
Search instead for 
Did you mean: 

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

Dolence
Associate III

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!

17 REPLIES 17
Dolence
Associate III
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?

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
Up vote any posts that you find helpful, it shows what's working..

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
Associate III

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.​

>>What you mean by reading back the framebuffer?

The SSD1963 has a 1.2MB frame buffer it is using to render the image to the screen.

Read it back to the STM32 side, and make sure it has the same exact content as you placed in it, byte-for-byte. Cat picture, or whatever.

Also expect you need to define the X, Y, height and width you're writing into the frame buffer on the SSD1963 side, make sure those values aren't wrong or transposed.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Ok, this night I will test this and report back. Thank you very much for your support.​

Dolence
Associate III

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?

clive1, tanks for your help. I managed to solve my issues. ​

hjh
Associate III

Hi

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

Hjalmar