Thanks for replying. Can you please explain, how to enable an interrupt on NVIC? The things given in the reference manual is not clear to me. I believe that there is a set of registers in STM32L, which need to be configured. Any support provided is highly appreciated. Thank you.
Posted on May 17, 2011 at 14:13 Hi ANN, I hope that ST engineer or someone else correct me if I am wrong. EXTI means external interrupt controller and it is made by ST NVIC means Nest vector interrupt controller and it is made by ARM. EXTI is mainly used for external interrupt control: edge config(rising, falling or both), mode (event or interrupt) To use let say PA0 as interrupt source: you should configure EXTI0 line then connect PA0 to EXTI0 and finally configure NVIC correspnding to EXTI0 line. I hope that EXTI controller is the same for both STM32F1xx and STM32L1xx. I hope it is clear. HErzlich, MCU Lüfter
1- GPIO configuration using GPIO registers 2- configure EXTI using EXTI registers 3- connect PA0 to EXTI0 using ''SYSCFG_EXTICR1'' In fact EXTI0 can be connected to PA0 or PB0 or PC0 or ..... and you have to select the pin through these registers. 4- configure NVIC NVIC_InitStructure.NVIC_IRQChannel = EXTI0_IRQn; NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0x0F; NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0x0F; NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE; NVIC_Init(&NVIC_InitStructure); refer to ''Interrupt and exception vectors '' section in the reference manual. That is my comprehension from documentation and I hope that I can get an STM32152-EVAL. Herzlich, MCU Lüfter
''You should configure EXTI0 line then connect PA0 to EXTI0 and finally configure NVIC correspnding to EXTI0 line.'' Can you please explain which registers of STM32 needs to be configured to achieve above configurations. Thank you.
because ST library doesn't support STM32L devices, STM32L152-EVAL isn't available and we are ''thirsty'' to use STM32L. we start documentation from reference manual ans waiting for ST. MCU Lüter
If you have difficulty coping with direct register access, why don't you just use the ST Library??
A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
We use Wizards for these configuration things. In the image below you can see the NVIC code for EXTI0. To start with you only need the first line. You can set the priorty later when you know what you want it to be. This is for the STM32F103. Best regards Crossware
This is the solution I found. In order to make the interrupt works on STM32L152 within IAR workbench I needed to included the following files, other than the header file stm32l1xx.h.
stm32l1xx_it.h
system_stm32l1xx.h
core_cm3.h
After that to invoke TIM4 interrupt i needed to have the expression in my main program. NVIC_EnableIRQ(TIM4_IRQn); The ISR that needs to be implemented with TIM4 IRQ should be mentioned in stm32l1xx_it.c. :) Thank you.