Post Go back to editing

OSAL_DEBUG prevents installing Irq Handlers

Category: Software
Product Number: ADSP-BF706
Software Version: CCES 2.12.0.1

I want to install an irq handler (adi_int_InstallHandler). This fails if called from an ISR. adi_int_InstallHandler calls adi_osal_InstallHandler which checks whether it was called from an ISR if DEBUG is set (setting OSAL_DEBUG).

Why should that be prohibited? There is no OS or alike. I deliberatly _do_ want to set and configure interrupts from ISRs. My code is fully interrupt driven, so everything is executed from inside some ISR.

Thread Notes

Parents
  • ... and what settings exactly I have to modify to disable these library checks i.e. to have the compiler/linker use the release version of the libs?

  • Hi Julian,

    Are you talking about the "libosal_noos.dlb" library to disable?

    If so, could you please explain about the purpose you want to disable. Are you planning to replace your custom library or any other.

    Also, can you please explain more about your issue. This would be helpful for us to assist you further.

    Awaiting for your reply.

    Regards,
    Nishanthi.V

  • I wanted to use adi_int_InstallHandler for installing a handler from inside some interrupt service routine (ISR) This failes because of the following check in libosal_noos:

    adi_osal_InstallHandler (
       uint32_t iid,
       ADI_OSAL_HANDLER_PTR highLevelHandler,
       void* handlerArg
    )
    {
        adi_dispatched_handler_t pfWrapper;
        int32_t index;

    #ifdef OSAL_DEBUG
        if (CALLED_FROM_AN_ISR)
        {
            return ADI_OSAL_CALLER_ERROR;
        }
    #endif /* OSAL_DEBUG */

    ....

    }

    So question is: Why should adi_int_InstallHandler not be called from an ISR? What is the reason for this check?

    I have to do this from an ISR, i.e.

    - I need a lib (libosal_noos.dlb) that's able run this function from inside an ISR

    - or I need to write my own code to replace the lib

Reply
  • I wanted to use adi_int_InstallHandler for installing a handler from inside some interrupt service routine (ISR) This failes because of the following check in libosal_noos:

    adi_osal_InstallHandler (
       uint32_t iid,
       ADI_OSAL_HANDLER_PTR highLevelHandler,
       void* handlerArg
    )
    {
        adi_dispatched_handler_t pfWrapper;
        int32_t index;

    #ifdef OSAL_DEBUG
        if (CALLED_FROM_AN_ISR)
        {
            return ADI_OSAL_CALLER_ERROR;
        }
    #endif /* OSAL_DEBUG */

    ....

    }

    So question is: Why should adi_int_InstallHandler not be called from an ISR? What is the reason for this check?

    I have to do this from an ISR, i.e.

    - I need a lib (libosal_noos.dlb) that's able run this function from inside an ISR

    - or I need to write my own code to replace the lib

Children
  • Hi,

    This check is present in order to make sure that if you write code for No-OS using OSAL, then you would be able to swap out No-OS for another OS and the code would continue to work. It shoudn't need to be a constraint of the No-OS code itself, but was a constraint in the ucOS version of OSAL and so the check was also added here for consistency.

    Therefore we believe that it you use the non-debug version of the library (by unchecking the "Use Debug system libraries" check-box in the project options at Tools Settings > CrossCore Blackfin Linker > Libraries), or if you add the code to your project and remove the check (the code can be found at Blackfin/lib/src/osal_noos/Ports/Blackfin/CCES/adi_osal_noos_arch_c.c), then you should be able to install the handler within the ISR.

    It's worth noting that ADI has not tested this use case.

    Michael.