This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

On DSP-side, can DSPLINK RingIO work in the SWI mode

Hi,

In our project, DSPLINK RingIO works fine in the TSK mode. For some reason, we want to use the SWI mode. Does RingIO work in the SWI mode? If yes, how to indicate the SWI ISR in the RingIO notification mechanism? I only found the dsp-side example codes for RingIO in the task mode.

Thanks,

Wei

  • Wei:

       From a cursory look at the source code, it appears RingIO APIs should be callable from SWI level.

       When calling RingIO_setNotifier(), you pass a callback that get's called from ISR context (from NOTIFY module).  Instead of that callback posting a SEM, post a SWI instead that will do the work for you.   Of course, you will need to create a SWI first (or SWIs: maybe one for the reader, one for the writer) which will run and do the necessary RingIO_acquire()/_release() calls when it gets posted.

      Note: RingIO work cannot be done from the callback itself:  from the DSPLink Programmer's Guide:

    8.2 Don'ts
    8.2.2 Do not call any DSP/BIOS Link API from a registered callback function
    No DSP/BIOS Link API should be called from a callback function registered through
    the RingIO or NOTIFY module. On DSP-side or on operating systems such as PrOS,
    the callback functions are run from ISR context and must not perform any operations
    that may take a lock or block, which is done by most DSPLink APIs. Minimum
    functionality must be used in the callback functions, most often limited to posting a
    semaphore on which application is waiting, posting SWI etc.

      See the BIOS5 documentation on usage of SWIs and examples.

    Regards,
    - Gil