Author Topic: DMA interrupts and Channels  (Read 965 times)

0 Members and 1 Guest are viewing this topic.

Offline benyBTopic starter

  • Newbie
  • Posts: 9
  • Country: jp
DMA interrupts and Channels
« on: August 04, 2018, 12:20:06 am »
Hi ,

I'm trying to get 4 DMA streams working on stm32f7x

I have 4 streams, 2 for Serial Audio Interface and 2 for uSD card. They are working but not at the same time !

one of the possible SAI streams conflicts with the uSD card although its on a different channel. shares the same stream number.

Can you use multiple streams on the same Stream number if its on a different channel ?
if not then whats the point in having channels ? are channels a way of defining DMA mapping and that's all ?

I tried avoided using the same stream number ( uSD and SAI ) by init and deinit the Audio input or output with the same stream number. (Audio is either played or being recorded so only one channel needed for audio)

BUT, the interrupt points to the same DMA2_Stream4_IRQHandler and this causes a crash

So , my question is,

1st , can DMA channels help ? if yes how can you have different interrupts for them ? 

2nd, can you define more than one interrupt for a DMA stream given that its not used at the same time?

I'm assuming  DMA2_Stream4_IRQHandler has to be used with Stream 4 but can you use DMA2_Stream7_IRQHandler on stream 4
or define another ?

[EDIT]

ok, solution was this.. not sure if its the best way ?

/**
  * @brief This function handles DMA2 Stream 4 interrupt request.
  * @param None
  * @retval None
  */
 void DMA2_Stream4_IRQHandler(void)
 {
if (some_varibale = 1)
{
    HAL_DMA_IRQHandler(haudio_in_sai.hdmarx);
}
else
{
    HAL_DMA_IRQHandler(haudio_out_sai.hdmatx);   
}
 }





« Last Edit: August 04, 2018, 04:38:07 pm by benyB »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf