cancel
Showing results for 
Search instead for 
Did you mean: 

Weird pixels in the area of image which is loaded from external flash.

MSing.8
Associate III

I am getting weird pixels in the area of the LCD which has an image that is in "external" flash. The part of LCD where pixels are located in internal flash, are being displayed properly.

Only somewhat related post that i found is this below but my issue is an extension:

https://community.st.com/s/question/0D53W00000cyVN0SAM/copying-data-from-external-flash-doesnt-copy-into-buffer-using-generated-touchgfxgenerateddatareadercpp-on-stm32f4?t=1648085435733

How should the DataReader_StartDMAReadData() function look like?

This article does not have complete definition of readDataDMA()

https://support.touchgfx.com/4.19/docs/development/scenarios/using-serial-flash

void readDataDMA(uint32_t address24, uint8_t* buffer, uint32_t length)

{

// Pull Flash CS pin low

isReceivingData = 1;

FLASH_CS_GPIO_Port->BRR = FLASH_CS_Pin;

*((__IO uint8_t*)&hspi2.Instance->DR) = CMD_READ;

...

}

I tried to construct the function, it appears to be correct per my knowledge but I am getting weird pixels in the area of image which is located in flash.

Any leads/pointers would be helpful.

Thank you.

2 REPLIES 2

What STM32 part?

What NOR Flash part, connected how?

Assuming SPI, but clearly that's not going to be memory-mapped.

Review the data-sheet/manual for the memory device, understand its function and expectation, especially with clocking, addressing, transfer sizes, etc.

Why don't you implement DMA to memory for your SPI Flash device in a stand-alone application, and prove to yourself you can get that working properly, and as expected. ie reading blocks of data from the device, and that the data returns matches what's supposed to be in the device.

If appropriate get an oscilloscope or logic analyzer, and understand the timing, and data transfer, if that's not working properly.

>>This article does not have complete definition of readDataDMA()

Yes, I think it's generally assumed that engineer(s) on the project understand how to drive the hardware they have attached. GFX just wants you to move the data into STM32 side memory. So this shouldn't be markedly different from whatever BSP code or drivers you've built for your platform already.

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

Hello Tesla,

Thank you for helping.

I am using STM32F407VE.

Flash is W25Q64JVSSIQ on SPI2.

I have the DMA working on SPI1 for the LCD. That is how I got the pixels on the LCD and proper image through touchgfx.

The next step-up is to read data from flash when the internal flash is of limited memory.

I read the data from flash using below code. It is not through DMA though.

https://github.com/nimaltd/w25qxx

The data is read but like i said it is generating weird pixels (very slow rendering as DMA is not enabled). DMA part of the things are not working, so no pixels when using DMA.

Yes, the next level of debug is for me to check if the pixels are correctly read through the memory.