cancel
Showing results for 
Search instead for 
Did you mean: 

stm32f0 spi dma and no interrupt

timotet
Associate II
Posted on July 13, 2012 at 23:08

Hi

Ive been trying to get the SPI DMA TX interrupt to work with no luck.

Im trying to load an array onto the SPI bus then get the interrupt to finish the transaction.

attached is my spi, dma , and nvic setup code.

thanks in advance

tim

#stm32f0-spi-dma
13 REPLIES 13
timotet
Associate II
Posted on July 17, 2012 at 02:14

clive 1

Thanks for your help.

I edited the code to C and moved the DMA interrupt to the

stm32f0xx_it.c file and DMA is working great.

I had tried to move the interrupt code before and it made no difference.

After reading your post, I tried changing the interrupt to :

void cdecl SPI_PORT_DMA_TX_IRQHandler()

That didnt work either. What exactly is the cdecl supposed do?

Why does C++ not work?

thanks again

Tim

Posted on July 17, 2012 at 02:43

C++ mangles function names based on the input/output parameters of a function, cdecl (or __cdecl in Keil) forces ''C declaration'' mode. I'm not a ''C++'' guy, let me see if I can figure out what GNU/GCC wants.

From your listing file you have :

08001cb8 <
_Z26DMA1_Channel4_5_IRQHandlerv
>:
///DMA interrupt routine
void SPI_PORT_DMA_TX_IRQHandler() {
8001cb8: b580 push {r7, lr}
8001cba: af00 add r7, sp, #0
// Test if DMA Stream Transfer Complete
if (DMA_GetITStatus(DMA1_IT_TC5)) {
8001cbc: 2380 movs r3, #128 ; 0x80
8001cbe: 029b lsls r3, r3, #10
8001cc0: 1c18 adds r0, r3, #0
8001cc2: f000 fbcb bl 800245c <
DMA_GetITStatus
>

Notice that

_Z26DMA1_Channel4_5_IRQHandlerv

is not in the vector table, and consequently will not be called, ever.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
timotet
Associate II
Posted on July 17, 2012 at 06:03

thanks alot clive1

learned alot from this.
honestapple
Associate
Posted on August 20, 2012 at 12:13

Hello, I tried to driving nokia5110 with stm32f0 discovery using spi and dma. The code can enter the dma interrupt routine, but can not display anything on the lcd. Could you give me some advices. Thank you.