SDK 2.12.1 - RT1052 SAI (MQS): proper init/de-init flow w/ FreeRTOS?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

SDK 2.12.1 - RT1052 SAI (MQS): proper init/de-init flow w/ FreeRTOS?

642 Views
variable_andrew
Senior Contributor I

The SAI demo shows how to init the SAI, but not de-init.

I'm wondering if how I'm initializing (or deinitializing) is leading to some system instability, as when the SAI has completed playing a sound clip, and i run my deinit code, the system somehow gets stuck in the `SAI3_TX_IRQHandler` perhaps once in a few hours of use here (so not easy to reproduce) WHILE the code is actually running the deinit routine (EDMA_Deinit), as per:

Screen Shot 2023-01-23 at 1.20.36 PM.png

 

I only run the deinit routine once my clip has completed playing (and this works fine 99.9% of the time...), but it still seems to create instability.

 

Attached is the base source code for my SAI control.

I was deinit'ing the Mclk as well as everything else, but made it only so I would init that once @ system startup in hopes that it'd fix my issue. (It didn't).

Another option is to never de-init, but I thought that I should force the SAI to abort any existing DMA's when I'm done w/ a sound clip, right?

Tags (1)
0 Kudos
3 Replies

557 Views
variable_andrew
Senior Contributor I

anything?

 

0 Kudos

621 Views
variable_andrew
Senior Contributor I

bumping this thread up for help / ideas

0 Kudos

581 Views
variable_andrew
Senior Contributor I

any ideas?

0 Kudos