Post Go back to editing

Simultaneous OSPI read and write operations in EV-SC594-SOM

Category: Software
Product Number: ADSP-SC594

Hi Team,

We were able to perform OSPI write, read and erase operations individually in freeRTOS.

However, while we were trying to obtain simultaneous OSPI write and read operations using a single OSPI phDevice handle in freeRTOS, we are getting ADI_OSPI_NOT_OPENED error during read operation. This error comes only if we have an on-going parallel write operation.

Could you please let us know, how to handle simultaneous OSPI read and write operations?



Added Evaluation board to Subjest
[edited by: HMUser at 5:58 PM (GMT -4) on 25 Apr 2024]

Thread Notes

Parents Reply Children
  • Hi  ,

    Thanks for your reply. We would like to perform RWW operation using ISSI flash. This requires parallel task to handle simultaneous operations.

    Hence, we have to go with freeRTOS. 

    1. Write Operation task - This task is a continuous write operation task. We are using DMA based buffer with function  status = adi_ospi_DirectWrite( *phDevice, &DAC_Program_Command ); to perform flash write operation.

    2. Read Operation - This task perform continuous read operation using the function -  status = adi_ospi_DirectRead( *phDevice, &DAC_Read_Command );. While performing read operation, we are getting error: ADI_OSPI_NOT_OPENED. We looked into the API and found that pDevData->eState is having ADI_OSPI_STATE_BUSY state. 

    So, Is there a way to perform OSPI write and read operation without checking the  pDevData->eState ?



  • Hi Akshay,

    Since OSPI of SC594 processor was configured using single MDMA channel to generate secure transaction between Source and Destination.

    So, while OSPI doing continuous write operation task using MDMA, It will wait for MDMA to finish OSPI Write operation. During the write operation, we cannot force the OSPI to perform flash read operation.

    Also, we do not recommend customers to make modifications to driver APIs because this alteration may affect other functions in the driver module, as it is not being tested.

    For more information, please refer to "Configuring OSPI for DAC Read/Write Operation" section under "21 Octal Serial Peripheral Interface (OSPI)" from the below HRM manual.

    Hope this helps.

    Best Regards,

  • Hi Santha,

    Thanks for your response.

    As mentioned earlier, we would require to perform a parallel write and read operation, So, instead of going with MDMA mode, can we go with STIG command mode ( eResult = adi_ospi_StigCommand(*hDevice, &pSTIG_Command);) 
    approach? Or Do we have any other APIs which perform these parallel activities?

    Thanks and Regards,

  • Hi Akshay,

    Please note that, the STIG is controlled using the OSPI_FCCTL register by setting up the command to issue to the flash device. But, we cannot set the OSPI_FCCTL.WREN and OSPI_FCCTL.RDEN bits simultaneously.

    A given command can either read data or send data to the flash, but not both at the same time/parallel.

    Also, there is no any API's for perform these Flash read and write activities by parallel. For more information, please refer the OSPI's  API source file from below CCES installation path:
    [Installation Directory]\Analog Devices\CrossCore Embedded Studio 2.12.0\SHARC\lib\src\drivers\Source\ospi\adi_ospi_2156x.c

    Best Regards,

  • Hi  ,

    Thanks again for the response and sharing links to documents for our references.

    Since, we wanted to perform RWW functionality on ISSI chip, we were looking for APIs/possible ways to perform OSPI data write and read in parallel.

    Can we use two separate OSPI handles for data write and read operations, to achieve this parallel activity?

    Best Regards,


  • Hi Akshay,

    We are checking this query with our Internal Design team about whether this OSPI flash controller IP supports simultaneous flash read and read operation in OCTAL mode.

    We will get back to you once we get a response from them.

    Best Regards,