2013-08-06 06:30 AM
I am having trouble using the DMA transfer complete interrupt with the USB Virtual COM Port. The USB port stops functioning when the interrupt is called. The interrupt command is:
DMA_ITConfig(DMA1_Stream7, DMA_IT_TC,
ENABLE
);
I removed all code from the interrupt to make sure their was no conflict in the interrupt call itself and this had no effect. The DMA itself is functioning as I am using it to ramp speed for a motor and the motor speed is ramping as programmed. If do not call the interrupt the system stays connected. If I call the interrupt the USB stops communicating. I also changed streams and channels with same effect. FYI this code has been working for years using the STM32F1. I am also trying to use a DMA interrupt with the ADC and the interrupt is not being called. The ADC and DMA are working as I can access the data without an interrupt. Same command as above but for DMA2 Stream 0. Not sure if these problems are related. I have not tested the ADC part enough to know if it is only the interrupt. Thanks for any suggestions. I have examined the USB Virtual COM Port code and have not found any obvious conflicts with the DMA interrupt. #virtual-com-port-usb-dma2013-08-06 07:20 AM
If the service routine does not clear the interrupt properly, then you'll be trapped in an interrupt storm forever. ie it will continually tail-chain rather than run other foreground code, or interrupts of lower priority.
2013-08-06 08:22 AM
Clive1:
Thanks for the response. You hit the nail on the head. I was clearing the interrupt pending bit but for the wrong channel. I was using DMA_IT_TCIF1 instead of DMA_IT_TCIF7 in the line:DMA_ClearITPendingBit(DMA1_Stream7, DMA_IT_TCIF7);
I have been having many problems like this in migrating from the STM32F1 to STM32F4. ST makes a big point of saying that the pins are compatible between microprocessors in the STM32 product line. This lulls one into thinking the code is also compatible. It generally is but there are many small changes required. The DMA for example is much more complex on the F4 part than the F1 part with many more streams and channels. It requires a detailed look at the code when migrating. Thanks again for your help.2015-03-13 10:21 PM