Callback priority in 21571

Hi,

I have some questions about sport callbacks.

1) Asume that I use SPORT0A,0B,1A,1B, all 4 sports use the same clocks from PCGA. So 4 four sports call the callback function at the same time, what is the callback order, which is fisrt and which is last.

2) When in sport0A callback, if at the same time sport0B callback occur, can the new callback interrupt the fisrt one? Or is it safe in sport0A callback that it will not be interrupted by anyother callbacks, such as UART callback,MDMA callback,etc.

3) It seems that I can't enable a MDMA transfer using adi_mdma_Copy1D() function when in the sport0A callback, which is good outside the sport0A callback.

4) Is there some methods to delay a callback when I do something in a function, and after the function I can deal with the callback.

Thanks.

  • +1
    •  Analog Employees 
    on Oct 19, 2021 6:37 AM

    Hi Foster,

    Please find the details here

    1) Assume that I use SPORT0A,0B,1A,1B, all 4 sports use the same clocks from PCGA. So 4 four sports call the callback function at the same time, what is the callback order, which is fisrt and which is last.
    >> Each system interrupt source has its own programmable priority level which is configured using "adi_sec_SetPriority". The SCI evaluates the priority of all pending sources to determine the source of the highest-priority pending system interrupt for forwarding to the attached core. If more than one source of the pending system interrupt has the same priority setting, the SCI chooses the one with the lowest SID. For example, if SID 0, SID 1, and SID 2 are all pending and have the same priority setting, the SCI chooses SID 0 as the highest priority source.

    In your case, by default SPORT0A,0B,1A,1B have priority 0. So, SCI chooses the one with the lowest SID. SPORT0A have lowest SID. below is the callback order SPORT0A SPORT0B, SPORT1A, SPORT1B

    We recommend to refer chapter 6 "System Event Controller (SEC) and Generic Interrupt Controller (GIC)" for more information about interrupts:
    www.analog.com/.../adsp-sc57x-2157x_hwr.pdf

    2) When in sport0A callback, if at the same time sport0B callback occur, can the new callback interrupt the fisrt one? Or is it safe in sport0A callback that it will not be interrupted by anyother callbacks, such as UART callback,MDMA callback,etc.
    >> If sport0B callback occurs, When sport0A callback is processing: sport0A callback completed and then sport0B callback start to process.
    UART callback,MDMA callback have highest SID. so, UART callback and MDMA callback will not interrupt SPORT callback processing.

    3) It seems that I can't enable a MDMA transfer using adi_mdma_Copy1D() function when in the sport0A callback, which is good outside the sport0A callback.
    >>Callbacks operate at interrupt level, so care must be taken to minimize the amount of code executed inside of the interrupt.

    Each driver documents the various “events” that can occur and cause a callback. It is the application's responsibility to process the event in the callback and take an appropriate action. If the cause of the callback is a transaction complete event,the application must synchronize the event with the application. Synchronization can beaccomplished via a simple global variable or, in the context of an RTOS, via a semaphore.

    4) Is there some methods to delay a callback when I do something in a function, and after the function I can deal with the callback.
    >> No, we are not having such option in driver.

    Best Regards,
    Santhakumari.K