ISR Number meaning

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • ISR Number meaning

    Hi Segger team,

    First of all thanks for making this tool and making it free. I just started using it and everything went smooth and seems promising. In the first measurement that I did I noticed that the number of the ISR related to the only IRQ enabled in my target is 19. Shouldn't it be the number in NVIC? That interrupt is the 3rd interrupt in my NVIC but SYstemView shows number 19 for it. What do these numbers mean?

    Another question, I have used SEGGER_SYSVIEW_OnUserStart() in a couple of placed in my code by I noticed that although they are tracked down by Events window, they are not shown in Timeline window. Is there any way to add it in the Timeline window too? A workaround that came to my mind is to call SEGGER_SYSVIEW_RecordEnterISR() in my subroutines (which are not ISRs). So the question here is that if I call SEGGER_SYSVIEW_RecordEnterISR() outside an ISR what would be its number? Or even, is it allowed to do so?

    Vala
  • Updates:

    I found out that calling SEGGER_SYSVIEW_RecordEnterISR() and SEGGER_SYSVIEW_RecordExitISR() do nothing when they are called from the main. But I can call SEGGER_SYSVIEW_OnTaskStartExec() and SEGGER_SYSVIEW_OnTaskTerminate() from main and they work perfectly. Is there any harm to call these when there is OS?

    And about my previous question, I should probably clarify that I meant the enabled interrupt is the fourth bit in NVIC->ISER[0] register. And why the number is 19?

    I tested a couple more interrupts to find out if there is any meaning with the numbers reported by SEGGER_SYSVIEW_RecordEnterISR in SYSTEMVIEW. Here is my observation:


    Interrupt number 3 => is reported 19Interrupt number 35 => is reported 51
    Interrupt number 9 => is reported 25



    Therefore, it seems that the numbers are definitely not random. In the reported numbers, second byte should be multiplied by 16 and added to the first byte. Then I can get the interrupt number. This is a wise way to decrease to payload. If I write them in binary:



    Interrupt number 3 => NVIC->ISER[0] - bit 3 => reported number 0b 0001 0011Interrupt number 35 => NVIC->ISER[1] - bit 3 => reported number 0b 0011 0011
    Interrupt number 9 => NVIC->ISER[0] - bit 9 => reported number 0b 0001 1001
  • Hi,

    Thanks for the positive feedback, please excuse the delay.

    The interrupt ID used by SystemView is for Cortex-M devices the interrupt vector index, as read from the ICSR.
    Refer to SEGGER_SYSVIEW_GET_INTERRUPT_ID in SEGGER_SYSVIEW_Conf.h
    The first 16 indices are the generic Cortex-M vectors, followed by the target-specific vectors.

    So it is correct that device-specific interrupt 3 is recorded as 19.

    If SEGGER_SYSVIEW_RecordEnterISR() is called from the application code no interrupt is active, so this cannot be used.

    SEGGER_SYSVIEW_OnUSerStart() and OnUserStop() are not shown in the timeline, but only in the events list, as it might happen that they are called from different contexts and could then not be linked.

    If you do not use an OS, it should be safe to call SEGGER_SYSVIEW_OnTaskStartExec() and OnTaskStopExec() or OnTaskTerminate().
    You could also register your application as a module for SystemView and record each function as an API call as described in the manual.

    Best regards
    Johannes
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.