This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

cmsis NVIC question.

Hello, Everybody. I have several questions.

1. Please See the NVIC_Type structure. I don't understand about why ISER,ICER,ISPR and ICPR use size of array 1( I think It can use just __IO uint32_t ISER; ), and what does RESERVEDs do???

2. I would like to give priority to my timer.  I am confused about difference IP of NVIC_Type structure and SHP of SCB_Type.
 

Parents
  • The header file you quote is from the ARMv6-M Cortex-M0/M0+ version of CMSIS; these CPUs only support 32 configurable interrupts, and thus only need a single ISER (etc.) register. For the ARMv7-M Cortex-M3/M4/M7, the number of physical interrupts is greater than 32, and you will see ISER[2] etc. used to hold control information for those additional interrupts. The use of ICSR[0] enables source code to be easily reused with these higher performance devices.

    Each byte pointed to by NVIC_Type.IP[] defines the relative priority of each interrupt.

    Each byte pointed to by SCB_Type.SHP[] defines the relative priority of each system handler (SVC, SysTick etc.).

    For ARMv6-M, the usable values for each byte are 0x00, 0x40, 0x80 and 0xC0, with 0x00 being the highest priority, and 0xC0 being the lowest priority.

    It is likely easier to use the CMSIS functions, e.g. NVIC_SetPriority(IRQn, priority)

    See: Interrupts and Exceptions (NVIC)

    hth

    Simon.

Reply
  • The header file you quote is from the ARMv6-M Cortex-M0/M0+ version of CMSIS; these CPUs only support 32 configurable interrupts, and thus only need a single ISER (etc.) register. For the ARMv7-M Cortex-M3/M4/M7, the number of physical interrupts is greater than 32, and you will see ISER[2] etc. used to hold control information for those additional interrupts. The use of ICSR[0] enables source code to be easily reused with these higher performance devices.

    Each byte pointed to by NVIC_Type.IP[] defines the relative priority of each interrupt.

    Each byte pointed to by SCB_Type.SHP[] defines the relative priority of each system handler (SVC, SysTick etc.).

    For ARMv6-M, the usable values for each byte are 0x00, 0x40, 0x80 and 0xC0, with 0x00 being the highest priority, and 0xC0 being the lowest priority.

    It is likely easier to use the CMSIS functions, e.g. NVIC_SetPriority(IRQn, priority)

    See: Interrupts and Exceptions (NVIC)

    hth

    Simon.

Children
No data