cancel
Showing results for 
Search instead for 
Did you mean: 

How to enable QSPI PSRAM as data memory

Hi:

I use STM32L4P5RG with APS6404L-3SQR to develop GUI.

I want use QSPI PSRAM as data memory for GUI.

Now, I enable QSPI PSRAM as data memory as follows:

1.configure QSPI PSRAM , SPI with NVIC in CubeMX

2. add PSRAM (xrw) : ORIGIN = 0x70000000, LENGTH = 8M to LinkerScript.ld

3. add following to LinkerScript.ld again:

 

   .ext_ram :
  {
    . = ALIGN(4);
    _ext_ram_start = .;        /* create a global symbol at ext_ram start */
    *(.ext_ram)         /* .ext_ram sections */
    *(.ext_ram*)        /* .ext_ram* sections */
    . = ALIGN(4);
    _ext_ram_end = .;         /* define a global symbols at end of ext_ram */
  } >PSRAM 

 

4.configure PSRAM to memory map mode after MX_OCTOSPI1_Init/MX_OCTOSPI2_Init

5.create one global array out of main function for GUI, will use later by pointer:

 

__attribute__((section(".ext_ram"))) static uint8_t buf_for_disp[153600];

 

6.create two static arrays in main function for GUI, will use later by pointer:

 

    __attribute__((section(".ext_ram"))) static uint8_t buf_1[153600];
    __attribute__((section(".ext_ram"))) static uint8_t buf_2[153600];

 

7.later, SPI data will transfer to TFT by SPI DMA, the data is stored in arrays above.

 

The question is:

1. Should I enable NVIC for QSPI in CubeMX? If Yes, which value should the priority be (I don't use RTOS now, but maybe use later)?

2. Is this flow correct? Do I miss anything?

3. At first, the GUI work correctly, but after serval hours, the GUI can't display anything. I think the data in arrays is incorrect or the pointer address is wrong, but I don't know how to analyze this, because at first everything is OK, can you give me some advice?

10 REPLIES 10

Hi :

After I debug serval times, I figure out it is a hardware issue.

Nothing wrong with the software.