Tuesday, October 17th 2017, 7:59am UTC+2

You are not logged in.

  • Login
  • Register

Dear visitor, welcome to SEGGER Forum. If this is your first visit here, please read the Help. It explains how this page works. You must be registered before you can use all the page's features. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

vala

Beginner

Date of registration: May 10th 2017

Posts: 2

1

Thursday, May 11th 2017, 10:02am

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

vala

Beginner

Date of registration: May 10th 2017

Posts: 2

2

Friday, May 12th 2017, 10:32am

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

SEGGER - Johannes

Super Moderator

Date of registration: Aug 31st 2012

Posts: 360

3

Wednesday, June 21st 2017, 4:25pm

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