2010-11-12 05:05 AM
µVision4 doesn't generate code of DMA1 ISR????!!!!
2011-05-17 05:14 AM
Has anyone an idea what's the problem is?
Sounds like you are doing it wrong. Try condensing your code into a project you can zip and attach to a post. The vectoring code is typically put in startup.s or startup_stm32f10x_xx.s and should already be there, while the handlers typically go in stm32f10x_it.c
2011-05-17 05:14 AM
The question is, what do i wrong? How you can see in the picture (µVision - Debug mode) is there a code for the ''EXTI4_IRQHandler'' but not for the ''DMA1_Channel6_IRQHandler''. But how can it be?
2011-05-17 05:14 AM
Seems like the optimizer got rid of your code. The link between the actual interrupt vector and your function is in the startup file (startup_stm32f10x_xx.s). In that assembly file the interrupt vector table is filled with ''weak'' references, e.g. if the linker finds your function DMA1_Channel6_IRQHandler, it should use that reference, otherwise it'll use the dummy loop in the startup file.
Clean your project, rebuild everything and then start looking whether your function is externally visible, e.g. makes it into the object file and map file as a symbol. From the screenshot it didn't look like the function was marked ''static'' so the linker should pick it up. Andrew2011-05-17 05:14 AM
The vector is missing from your startup file, or the startup file is not being linked in, and the linker is therefore dumping the code as it has identified it as being unused (ie nothing references it).
If you used one of the standard demo/example projects from the library code it would have complete startup/vector code and it would call the DMA1_Channel6_IRQHandler() Cut the project down to a small workable example, and either validate it for yourself, or post it.2011-05-17 05:14 AM
Ok, I found the problem. Indeed the reason for it is in the startup file ''STM32F10x.s''. µVision does create the startup file ''STM32F10x.s'' with wrong IRQ handler names.
In my case the DMA channel handlers did not be called ''DMA1_Channel6_IRQHandler'' and ''DMA1_Channel7_IRQHandler'' but ''DMAChannel6_IRQHandler'' and ''DMAChannel7_IRQHandler''!Extraction of the original startup file created by µVision:; External Interrupts
DCD WWDG_IRQHandler ; Window Watchdog
DCD PVD_IRQHandler ; PVD through EXTI Line detect
DCD TAMPER_IRQHandler ; Tamper
DCD RTC_IRQHandler ; RTC
DCD FLASH_IRQHandler ; Flash
DCD RCC_IRQHandler ; RCC
DCD EXTI0_IRQHandler ; EXTI Line 0
DCD EXTI1_IRQHandler ; EXTI Line 1
DCD EXTI2_IRQHandler ; EXTI Line 2
DCD EXTI3_IRQHandler ; EXTI Line 3
DCD EXTI4_IRQHandler ; EXTI Line 4
DCD DMAChannel1_IRQHandler ; DMA Channel 1
DCD DMAChannel2_IRQHandler ; DMA Channel 2
DCD DMAChannel3_IRQHandler ; DMA Channel 3
DCD DMAChannel4_IRQHandler ; DMA Channel 4
DCD DMAChannel5_IRQHandler ; DMA Channel 5
DCD
DMAChannel6_IRQHandler
; DMA Channel 6DCD
DMAChannel7_IRQHandler
; DMA Channel 7DCD ADC_IRQHandler ; ADC
DCD USB_HP_CAN_TX_IRQHandler ; USB High Priority or CAN TX
End of extraction!
Thanks to all for your help...... Greeting Kammic
2011-05-17 05:14 AM
''µVision does create the startup file ''STM32F10x.s'' with wrong IRQ handler names.''
There is no such thing as a ''right'' or ''wrong'' function name! If you want to use the startup file created by µVision (or any other tool) then you have to adopt whatever names it happened to choose - if you don't like them, then you can change then as you see fit! I think the ''default'' names did change between versions of the ST Library; so perhaps you are using one version in your project, but have Keil looking at different one - or, at least, using the startup files from a different one...?
2011-05-17 05:14 AM
Ok, you're right. Names are nothing but smoke and mirrors. But I'd be interested in knowing how Keil - µVision does differentiate about ''DMA2_Channel1_IRQHandler'' and ''DMA1_Channel1_IRQHandler''?
2011-05-17 05:14 AM
''I'd be interested in knowing how Keil - µVision does differentiate about 'DMA2_Channel1_IRQHandler' and 'DMA1_Channel1_IRQHandler'?''
You have the source - you can look at it and see for yourself!