Store Framebuffer in OSPI PSRAM?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-04-07 4:07 PM
MCU: STM32L4R9ZIJ6
PSRAM: APS1604M-3SQR-SN
Display: 800x480, RGB888, 24-bit
Hi, I'd like to use the mentioned PSRAM to store the TouchGFX framebuffer using OCTOSPI in QuadSPI mode.
I have tried setting the Frame Buffer Start Address to
OCTOSPI1_BASE (0x90000000), but that does not seem to work. I only get junk data.
I have read the TouchGFX docs, LTDC datasheets, and OSPI datasheets very thoroughly, and still cannot figure it out.
Additional Q's:
- How does the MCU "know" an external PSRAM has been added?
- Should I have used FMC for this procedure instead?
Note: I am using a custom board/application. Please assume the hardware is correct for the sake of discussion.
Any help would be appreciated. If any further clarification is needed please ask. I will include an image of the LCD display image as it stands.
- Labels:
-
OctoSPI
-
STM32L4 series
-
TouchGFX
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-04-07 6:44 PM
>>How does the MCU "know" an external PSRAM has been added?
You'd have BSP code initializing the clocks,pins and OSPI/OSPIM peripheral, bring-up/config memory, enable the memory-mapping.
If you don't initialize it on the MCU, it will Hard Fault
You can validate the memory works via data pattern testing.
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-04-08 8:38 AM
Thank you for your response.
I've done the initializing through CubeMX with GPIO pins as such:
// octospi.c
/**OCTOSPI1 GPIO Configuration
PC11 ------> OCTOSPIM_P1_NCS
PF8 ------> OCTOSPIM_P1_IO0
PF6 ------> OCTOSPIM_P1_IO3
PF7 ------> OCTOSPIM_P1_IO2
PF10 ------> OCTOSPIM_P1_CLK
PF9 ------> OCTOSPIM_P1_IO1
*/
Is there anything further I need to do?(Outside of the MX generated code)
I have tried the APS1604M-3SQR-SN example code on pg.57 of AN5050, but found nothing written to 0x90000000 upon inspection in the CubeIDE Memory Monitor.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-04-08 8:48 AM
I'm not familiar with your design/implementation.
If this is a custom design you'll likely have to do some validation
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-04-08 8:56 AM
No worries. It is a custom design. I'm looking for software answers and assuming the hardware is correct. If all I need to do is setup OSPI in CubeMX then write to address 0x90000000 then that answers my question to a degree. Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-04-08 9:51 AM
It seems I'm having an issue between OSPI indirect mode and memory mapped mode. Memory mapped mode is read-only and likely works better for Flash memory, where Images and other TouchGFX things are stored. I am trying to use memory mapped mode to read the frame buffer, but since it is read only OSPI cannot "store" or write the frame buffer to the OSPI address 0x90000000.
I will try using indirect mode instead.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-04-08 10:17 AM
I'm not sure this L4+ device supports memory mapped read/write to RAM on the OctoSPI, read perhaps, write don't think so.
For DMA/LTDC operation it's going to need to be memory-mapped for those to read data.
The memory-mapped and command modes aren't exactly inter-operable.
The general expectation being that the display/frame buffer is within the internal SRAM, so that it's not constantly switching modes, and disturbing the painting of images onto the screen.
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-07-04 2:23 PM
There are limitation with the STM32L4R... to use OPI & QSPI RAM.
This is solved with later STM32 (L5, U5, H7...)
Alex
