Accessing PSRAM with DMA

MarcoM90

Member
Hi all!
I have found various topics but I would like a definitive clarification on this: I have to draw to various SPI TFT diplays using the ILI9341_t3n library through DMA. So if I put the TFT buffers into EXTMEM (soldering both chips) will the library be able to access them automatically? The SPI speed is currently 50MHz so if I clock the PSRAM to 132MHz I should be able to keep the maximun SPI speed (probably not really a problem though).

If somewhere I need to dynamically allocate memory the EXTMEM will be used?

Thanks for the answers!
 
If somewhere I need to dynamically allocate memory the EXTMEM will be used?
if you use malloc or new, by default these will be allocated in RAM2
1726100695242.png

This is from the T4.1 product page, in the memory section.
If you wish to allocate from the PSRAM, you would instead call extmem_malloc.
 
Mst of the libraries, unless you allocate the buffer your self, it will try to use malloc to allocate it.

However most if not all, give you and api to set the frame buffer to wherever you want it.
One example:
Code:
tft_frame_buffer = (uint8_t *)extmem_malloc(frame_buffer_size + 36);
...
    tft.setFrameBuffer((uint16_t *)(((uintptr_t)tft_frame_buffer + 31) & ~((uintptr_t)(31))), BIT_DEPTH);
Note: I try to make sure it is set at a 32 byte alignment...
 
Thanks for the code! All the buffers will be declared with EXTMEM and passed to the library.
Then as stated in the first post, can they be accessed by DMA when sending to SPI, ideally without speed loss?
 
Hard to say about speed…. Works reasonably when you boost the psram speed up. I am currently playing with it on Nt35510 display 800 by 480, and I have been playing with different number of bytes per pixel. 2,3,4…
 
Back
Top