2017-07-19 03:15 PM
Evaluating the above processor using gcc toolchain and openocd and J-Link. Not using cmsis (various reasons) and writing all the low level hal and header files, as a way to become more familiar with the processor. Already have a simple non interrupt based program running, but need to understand the relationship between the interrupt numbers for the device and how these are derived. From what I can see, each device has a different set of interrupt numbers to control access to the nvic, but can find no docs that define that, after extensive web search and scan of the device data sheets etc. Would assume that this has been defined and docs must exist somewhere ?...
Regards,
Chris
2017-07-20 04:42 PM
Hello Chris!!
Look at
paragraph 10.1.2
Theese are the definitions you searched for.
Regards.
2017-07-21 07:02 AM
Hi,
Thanks for the reply. I'm looking at RM00008 tech manual, and paragraph 10.1 describes the dma controller. The interrupt numbers for the (non connectivity) devices are at Table: 53, Page: 172-174, which is fine, but still doesn't explain how that is related to the nvic interrupt enable/disable and priority setting table entries. I don't have cmsis sources to see how that is done, but assume some indexing, bit twiddling and masking to access the correct field for the peripheral. Is this relationship defined anywhere, or perhaps point me to the cmsis sources so that I can work it out ?.
Correction: Was looking at an older version of RM0008 manual earlier. The latest (11-2015) has the interrupt numbers for the device at Table: 63, Pages: 203-205, but still can't find any definition on how those interrupt numbers are related to the nvic enable/disable and priority etc entries...
Regards,
Chris
2017-07-21 07:31 AM
Hello again!!
This time must try
http://infocenter.arm.com/help/topic/com.arm.doc.dui0552a/DUI0552A_cortex_m3_dgug.pdf
from ARMSTM32F1xx series contains M3 cortex cpu. M3 peripherals like NVIC, MPU, Systick, are common for all M3 containining MCUs All information about M3 is in this link.
ST and any other M3 based MCU manufacturer provide detailed info about their devices assuming that someone is familiar with M3 cpu.
Regards!
Vf
2017-07-21 11:15 AM
Hello !
IPSR register of Cortexm3 holds the interrupt number of an ISR
so when you enable n interrupt in NVIC, after interrupt you will take the number n when you read the IPSR
Is this a relation?
2017-07-21 12:32 PM
Vf,
Thanks again for the reply. Have already looked at that manual, but nowhere does it describe how the interrupt number relates to the entries in the nvic set/enable, priority setting areas. All it does is quote CMSIS function usage eg: Section 4.3.8, NVIC_GetPriority (IRQn_Type IRQn) etc
.
Don't want to sound difficult, but it seemed like a simple unambiguous question to me :-), so is this info documented, or if not, can we access the cmsis sources, so we can work it out ?...Regards,
Chris
2017-07-21 01:15 PM
The NVIC has hundreds on IRQ inputs, the table describes how these are wired up on the STM32 parts. The numbers translate to bits within the NVIC, and provide an inherent sequence/level of priority. You can change the priority settings, and if you have two identical settings the pin ordering internally breaks the tie.
2017-07-21 01:45 PM
You may have to look at ARM's CMSIS source (file core_cm3.h, widely available).
There you can see various mask definitions and translations from IRQ number to register bits, for example:
/**
* @brief Enable Interrupt in NVIC Interrupt Controller
*
* @param IRQn The positive number of the external interrupt to enable
*
* Enable a device specific interupt in the NVIC interrupt controller.
* The interrupt number cannot be a negative value.
*/
static __INLINE void NVIC_EnableIRQ(IRQn_Type IRQn)
{
NVIC->ISER[((uint32_t)(IRQn) >> 5)] = (1 << ((uint32_t)(IRQn) & 0x1F)); /* enable interrupt */
}�?�?�?�?�?�?�?�?�?�?�?�?
2017-07-21 02:20 PM
Hello again Chris..
Finaly i understand
St provides this information .
you may find this information to stm32f103xb.h
this file is made from ST
Is included in
software packI hope this time to realy help you
this file is placed under CMSIIS directory but is made from ST
St is responsible to provide you for every family of MCU an stm32fXXXxx.h with proper definitions about theese interrupt numbers
Regards
2017-07-21 04:00 PM
,
,
Hi Again,
Perhaps i'm not explaining it very well, so let's try an example of the sort of thing I need to be able to do. Reading the programming manual, PM0056, April 2010. In nvic section starting 4.3.2, we see a description of the 32 bit interrupt enable register. If I want to enable an interrupt for timer ♯ 1 for example, what is the translation between interrupt number for timer ♯ 1 and the bit that needs to be set ?. Or, how do I know which bit to set to enable timer ♯ 1 interrupt ?. Same goes for other nvic registers. This is a serious gap in the documentation as far as I can see.
The problem is that all st docs assume the use of cmsis and i've already said that that won't be used here, for various reasons. I should be able to bare metal program your devices without using it, using only the official docs...
Regards,
Chris