cancel
Showing results for 
Search instead for 
Did you mean: 

What is the most effective way for using assembly code at the core of interrupt handling?

Hansel
Senior

I've been able to successfully handle my tasks via C using the interrupt entry for DMA1_Stream0_IRQHandler() but want to rewrite it in assembly code (let's please not get into a discussion of whether this is worth it or not for performance reasons).

When trying to write pure assembly code, I see STMCubeIDE offer me only C or C++ source files, apparently nothing for ASM. What's an effective way to do it then? I specifically want to write code that is called when the interrupt for DMA1_Stream0_IRQHandler() is called.

Some hints in the right direction or even some simple framework would be highly appreciated. I can take it from there. So far I haven't really had much luck to find instructions on the internet.

3 REPLIES 3
Pavel A.
Evangelist III

> see STMCubeIDE offer me only C or C++ source files, apparently nothing for ASM. 

Every CubeIDE project has at least one pure asm file. The startup.s.

The best way to deal with assembly is to have a code review with an expert.

Nikita91
Lead II

Write your code in a .s file. it will be compiled automatically.

Have a look to the startup assembly file as example.

Hansel
Senior

D'oh. Should've known that. Thanks for the hints.