Skip to main content
AP.10
Associate II
November 10, 2021
Question

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

  • November 10, 2021
  • 1 reply
  • 1179 views

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.

This topic has been closed for replies.

1 reply

TDK
November 10, 2021

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""."