cancel
Showing results for 
Search instead for 
Did you mean: 

Could a running I2S DMA function affect my encoder interrupt service routine?

AP.10
Associate II

I have two things in code running simultaneously:

1) A CODEC using I2S with DMA is initialized and started as soon as the code is compiled and flashed.

2) I have an interrupt for my encoder which is used for selecting things from a menu.

The problem I am having is the following:

When I rotate my encoder and thus the ISR gets triggered, the passing object to the ISR function contains very weird values. Coincidently, my program gets stuck in this interrupt.

I have attached a copy of my code and also a screenshot of the object with its properties.

I would like to know how I can fix this bug and avoid it for future implementations.

Notes: I did not set up any DMA for my encoder. I only set it up using the Encoder mode T1 & T2.

1 REPLY 1
TDK
Guru

Your htim object has bogus values, most likely due to an out of bounds write or a stack overflow. Set up a watchpoint on that variable and see what is changing it.

If you feel a post has answered your question, please click "Accept as Solution".