2022-03-24 07:59 AM
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:
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.
2022-03-24 08:28 AM
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.
2022-03-24 09:14 AM
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.