Other Parts Discussed in Thread: HALCOGEN
This is a copy of a post which did not get a resolution and then was locked: e2e.ti.com/.../2331703
I'm having a really strange issue which I have been debugging for over a week now, so I thought I would see if anyone here had any ideas. I will explain the relevant parts of my system then explain what I am seeing.
I am using DMA along with CAN together to receive CAN messages. In this setup, all of the hardware mailboxes are dedicated to an individual CAN message except for the last one. The last one is set to trigger DMA to transfer the received message into a buffer which is periodically processed. This DMA channel has another DMA channel in its chain register. This secondary channel writes and indicator of what index in the CAN message buffer was written last.
We have an external real time clock which feeds a 32kHz tick into the NHET module. We use the HTU in order to retrieve the time current time.
This system has been tested and working for a long time, but we have one piece of code which has issues when any message gets into the last CAN mailbox and should be transmitted with DMA. When it receives one of these messages, the message is not transmitted, the time is never retrieved, and the memory browser in the debugger shows BAD0BAD0 for all values when refreshed until the code execution is paused.
This is the code we use to get the time. After receiving a CAN message and DMA starts processing it, it gets stuck at the while loop.
In addition to this, the CAN message never shows up in the destination buffer. From what I can tell from the DMA registers, it thinks the CAN message has been transferred to the buffer and it is waiting on the chained channel to complete. There are no other DMA channels active, and it should only copy one byte, so it shouldn't take any time.
This behaviour happens when interrupts are enabled or disabled, so I don't think some interrupt is causing issues when the CAN message is received.
The thing that is very strange about this to me is that DMA and the HTU seem to both be effected, even though I don't know any way they are linked.
Here are register states for DMA before and after sending the CAN message.
The nhet and htu registers both look the same before and after the crash while waiting in the while loop I mentioned above.
Thanks in advance. Let me know if any other information is helpful.