2366907_en-US

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

2366907_en-US

2366907_en-US

Writing Data to PSRAM from DSP on RT685

I am using the RT685 platform, connecting a PSRAM through FlexSPI. The PSRAM (ISSI IS66WVR8M8FALL) is connected to PortA2, and there is a QSPI Flash connected to PortA1.

PSRAM was configured to access by AHB, FlexSPI was configured on MCU side after startup, then after a few minutes, wrote data from DSP side. When writing data from DSP side, there were some 0x00 data in the PSRAM, and the data looks regular. To debug this issue, I wrote 192 bytes 0x32 at once and then 0x33 ...

spi_ram.png

There is no problem of writing and reading data from MCU side. This issue only occurred when writing data from DSP side.


The configuration of FlexSPI,

const flexspi_config_t FLEXSPI_config = {
  .rxSampleClock = kFLEXSPI_ReadSampleClkLoopbackInternally,
  .enableSckFreeRunning = false,
  .enableDoze = true,
  .enableHalfSpeedAccess = false,
  .enableSckBDiffOpt = false,
  .enableSameConfigForAll = false,
  .seqTimeoutCycle = 65535,
  .ipGrantTimeoutCycle = 255,
  .txWatermark = 8U,
  .rxWatermark = 8U,
  .ahbConfig = {
    .ahbGrantTimeoutCycle = 255,
    .ahbBusTimeoutCycle = 65535,
    .resumeWaitCycle = 32,
    .buffer = { 
      { .priority = 0, .masterIndex = 0U, .bufferSize = 256U, .enablePrefetch = true },
      { .priority = 1, .masterIndex = 0U, .bufferSize = 256U, .enablePrefetch = true },
      { .priority = 2, .masterIndex = 0U, .bufferSize = 256U, .enablePrefetch = true },
      { .priority = 3, .masterIndex = 0U, .bufferSize = 256U, .enablePrefetch = true },
      { .priority = 4, .masterIndex = 0U, .bufferSize = 256U, .enablePrefetch = true },
      { .priority = 5, .masterIndex = 0U, .bufferSize = 256U, .enablePrefetch = true },
      { .priority = 6, .masterIndex = 0U, .bufferSize = 256U, .enablePrefetch = true },
      { .priority = 7, .masterIndex = 0U, .bufferSize = 256U, .enablePrefetch = true }
    },
    .enableClearAHBBufferOpt = true,
    .enableReadAddressOpt = false,
    .enableAHBPrefetch = false,
    .enableAHBBufferable = true,
    .enableAHBCachable = false
  }
};

Configuration of PSRAM,

flexspi_device_config_t FLEXSPI_config_Device_SPIRAM = {
   .flexspiRootClk       = SPIRAM_ROOT_CLOCK_HZ,
   .isSck2Enabled        = false,
   .flashSize            = SPIRAM_SIZE_KBYTES,
   .CSIntervalUnit       = kFLEXSPI_CsIntervalUnit1SckCycle,
   .CSInterval           = 2,
   .CSHoldTime           = 3,
   .CSSetupTime          = 3,
   .dataValidTime        = 0,
   .columnspace          = 0U,
   .enableWordAddress    = false,
   .AWRSeqIndex          = SPIRAM_LUT_SEQ_IDX_WRITE,
   .AWRSeqNumber         = 1U,
   .ARDSeqIndex          = SPIRAM_LUT_SEQ_IDX_READ,
   .ARDSeqNumber         = 1U,
   .AHBWriteWaitUnit     = kFLEXSPI_AhbWriteWaitUnit2AhbCycle,
   .AHBWriteWaitInterval = 1,
   .enableWriteMask      = false,
};

Does anyone have idea about this problem?

i.MXRT 600Re: Writing Data to PSRAM from DSP on RT685

Hi @VincentW 

I think the issue is most likely caused by incorrect FlexSPI AHB configuration for multi-master access.

Currently, all AHB buffers are assigned to master 0.

 .buffer = { 
      { .priority = 0, .masterIndex = 0U, .bufferSize = 256U, .enablePrefetch = true },
      { .priority = 1, .masterIndex = 0U, .bufferSize = 256U, .enablePrefetch = true },
      { .priority = 2, .masterIndex = 0U, .bufferSize = 256U, .enablePrefetch = true },
      { .priority = 3, .masterIndex = 0U, .bufferSize = 256U, .enablePrefetch = true },
      { .priority = 4, .masterIndex = 0U, .bufferSize = 256U, .enablePrefetch = true },
      { .priority = 5, .masterIndex = 0U, .bufferSize = 256U, .enablePrefetch = true },
      { .priority = 6, .masterIndex = 0U, .bufferSize = 256U, .enablePrefetch = true },
      { .priority = 7, .masterIndex = 0U, .bufferSize = 256U, .enablePrefetch = true }
    },

You can try to assign one buffer to the dsp.

Enabling AHB write buffering (enableAHBBufferable = true) may delay or merge writes, which is not suitable for PSRAM and can lead to missing data.

You can try to 

enableAHBBufferable = false;

BR

Harry

Tags (1)
No ratings
Version history
Last update:
Thursday
Updated by: