cancel
Showing results for 
Search instead for 
Did you mean: 

µVision4 doesn't generate code of DMA1 ISR????!!!!

michaelkammerer9
Associate II
Posted on November 12, 2010 at 14:05

µVision4 doesn't generate code of DMA1 ISR????!!!!

8 REPLIES 8
Posted on May 17, 2011 at 14:14

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

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
michaelkammerer9
Associate II
Posted on May 17, 2011 at 14:14

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?

0690X00000602eDQAQ.jpg

aqueisser
Senior
Posted on May 17, 2011 at 14:14

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.

Andrew

Posted on May 17, 2011 at 14:14

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.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
michaelkammerer9
Associate II
Posted on May 17, 2011 at 14:14

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 6

 

                DCD    

DMAChannel7_IRQHandler

    ; DMA Channel 7

 

                DCD     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

Posted on May 17, 2011 at 14:14

''µ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...?

michaelkammerer9
Associate II
Posted on May 17, 2011 at 14:14

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''?

Posted on May 17, 2011 at 14:14

''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!