2011-10-01 04:54 AM
2011-10-01 06:12 AM
Check that SPI3's APB1 clock is enabled, and DMA2's AHB clock is enabled. Not saying you're not doing it, just don't see the code.
Not sure what tools chain and library you're using but you should find a list of interrupts handlers in something like stm32f10x_it.c, stm32f10x.s or startup_stm32f10x_hd.s2011-10-01 10:23 AM
Hi Clive,
Yes those clocks are enabled all right, just forgot to copy the clock configs into code. I'm using the Raisonance RLink and stm32 firmware lib v3.12. Of course I just checked the header file, stm32f10x.it and it lists the prototypes for the interrupts. Funny enough it only lists the following in terms of DMA: void DMAChannel1_IRQHandler( void ); void DMAChannel2_IRQHandler( void ); void DMAChannel3_IRQHandler( void ); void DMAChannel4_IRQHandler( void ); void DMAChannel5_IRQHandler( void ); void DMA1_Channel5_IRQHandler( void ); void DMAChannel6_IRQHandler( void ); void DMAChannel7_IRQHandler( void ); -> The interrupt I am trying to service has no header! I'll investigate further.......perhaps I have to update libraries or insert the header Will check back when I check it out. Thanks dude!2011-10-01 02:50 PM
2011-10-02 04:26 AM
Hi Clive,
I know it's pretty messy, sorry. This is a project I've had on the shelf for a few months, so it's taken me a couple of days to get my head around it! I've been doing mostly Java desktop stuff recently. The part is STM32F105vct6, which has DMA2. On examining startup_stm32f10x_cl.s the function prototype is DMA2_Channel1_IRQHandler. I've set up the codec as master and the I2S in question as slave recieve as this makes more sense with the DMA control. It seems the I2S3 or DMA2 is freezing when data arrives as if in a continuous subroutine, because the DMA transfer to I2S2 stops. The DMA2_Channel1_IRQHandler is never entered. A problem I have is that I have to disable JTAG to allow access to the pins for I2S3, so I can't read the registers while I2S3 is actually receiving, and am relying on toggling a pin output to check when the DMAs are firing. Is it possible I'm crashing the NVIC controller using some sort of bad configuration? Thanks again for you help2011-10-02 04:58 AM
You might want to add a GPIO output in the Hard Fault Handler, or use the serial port to provide some telemetry. A foreground heartbeat GPIO might tell you if it's locked up somewhere else.
I haven't looked at the exact pin configuration, could you still use SWD mode? The NVIC can give problems if the interrupt source isn't actually cleared by calling the IRQ routine (ie perhaps it's calling a stub routine). In this case you get stuck in an infinite tail-chaining loop, and it never executes foreground code again.2011-10-02 04:58 AM
Ah ok, I've tried checking some of the ISRs, and it's triggering the hardfault handler routine.
2011-10-02 05:17 AM
Hi Clive,
Happy to be getting somewhere with this. I added a GPIO toggle in the Hardfault ISR and its triggering continuously at about 1.6MHz. I'll have a look at the pinout for SWD, last time I was using the I2S as master and needed one more pin. I'll do some more reading on the NVIC and try the other ISRs too. Thanks, Ro2011-10-04 02:35 PM