2012-07-13 02:08 PM
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-dma2012-07-16 05:14 PM
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 Tim2012-07-16 05:43 PM
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.
2012-07-16 09:03 PM
thanks alot clive1
learned alot from this.2012-08-20 03:13 AM
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.