2020-06-25 10:35 AM
In my project am using A mcu , and wanted to use pA0 and Pc13 as two interrupt.
But interrupt for pA0 is not coming and Pc13 is coming.
Please help to know the cause.
Rohit
+91-8141616356
2020-06-25 10:38 AM
Also I have checked in .s file , both interrupts are enabled, and also at power on, i have enabled interrupt as risinf edge triggered.
Both interrupts come independently, but if I run two interrupts combined ly, only single interrupt comes.
2020-06-25 10:41 AM
Read out and check/post relevant GPIO, SYSCFG, EXTI and NVIC registers content. Check in disasm, if the proper ISR vector is inserted in the respective position in the vector table.
JW
2020-06-25 10:47 AM
Please share the snap of what u are saying if possible.
2020-06-25 10:58 AM
Register dumps from the involved peripherals
Debugger should have a peripheral view, you could also read in your own code and print.
Show minimal code that illustrates the issues rather than have everyone guess what you are doing wrong.
2020-06-25 11:12 AM
Ok,
Initialisation part as below:-
------------------------------------------------------------------------------------------------------------------
interruptEnable (GPIOA_BASE,GPIO_Pin_0,INT_RISE); // BMS Alert-Lower
interruptEnable (GPIOC_BASE,GPIO_Pin_13,INT_RISE); // BMS Alert-Upper
------------------------------------------------------------------------------------------------------------------
==================================================================
Below is ISR i wrote for Both Pin Interrupt:-
------------------------------------------------------------------------------------------------------------------
void EXTI0_1_IRQHandler(void)
{
if(EXTI_GetITStatus(EXTI_Line0) != RESET)
{
if (isrtimeout[0] > 20)
{
alertFlag[0] = 1;
isrtimeout[0] = 0;
alerttimeout[0] = 0;
}
EXTI_ClearITPendingBit(EXTI_Line0);
}
}
void EXTI4_15_IRQHandler (void)
{
if(EXTI_GetITStatus(EXTI_Line13) != RESET)
{
if (isrtimeout[1] > 20)
{
alertFlag[1] = 1;
isrtimeout[1] = 0;
alerttimeout[1] = 0;
}
EXTI_ClearITPendingBit(EXTI_Line13);
}
}
------------------------------------------------------------------------------------------------------------------
===============================================================
Below is .s File snap only :-
------------------------------------------------------------------------------------------------------------------
; External Interrupts
DCD WWDG_IRQHandler ; Window Watchdog
DCD PVD_VDDIO2_IRQHandler ; PVD and VDDIO2 through EXTI Line detect
DCD RTC_IRQHandler ; RTC through EXTI Line
DCD FLASH_IRQHandler ; FLASH
DCD RCC_CRS_IRQHandler ; RCC and CRS
DCD EXTI0_1_IRQHandler ; EXTI Line 0 and 1
DCD EXTI2_3_IRQHandler ; EXTI Line 2 and 3
DCD EXTI4_15_IRQHandler ; EXTI Line 4 to 15
DCD TSC_IRQHandler ; TS
------------------------------------------------------------------------------------------------------------------
Regarding debugger with Hardware i can do in normning as my hardware is @ officeand am at home currentlly.
Thanks
Rohit
2020-06-26 02:13 AM
Am not getting what u requesting.
2020-06-26 03:47 AM
Clive,
Please share if it is necessary to set priority of interrupts? When more than one interrupts are present.
Rohit
2020-06-26 04:43 AM
Please see the IAR options i get on View -Tab, i could not get Registers to see vector interrupt addresses.
Please suggest where to see interrupt vector addresses, to confirm if PA0 & PC13 interrupts are properly working or not?
2020-06-26 06:23 AM
I'm not the user of IAR tools here
The Vector Table, presumably you could use a Memory View of 0x08000000, 32-bit unsigned words
Manually you can print register settings, for example
printf("CR2:%08X CR3:%08X BRR:%08X\n", USART2->CR2, USART2->CR3, USART2->BRR);
The idea here being to peek inside and see what settings where actually achieved, and what status/errors get reflected back, and do so in a way which is automated and reliable. Looking for first hand reporting of facts rather than second/third hand interpretations, as the hardware is usually less complicated than perceived, and the logic can be unwound if you know what information it is working with.
If you are exiting/leaving quickly the priorities shouldn't matter much. One problem is if the event/source is not cleared then the same interrupt will keep reentering effectively blocking everything else.