Part Number: TMS320F28035
Tool/software: Code Composer Studio
I am trying to do something very simple, and I'm having major issues.
I want to enable the AME bit for a mailbox. The first step to doing that is to disable the mailbox, set the AME bit for that mailbox, then re-enable the mailbox. I know the CAN control registers must be written to as a full 32 bit value, so I'm using a shadow object as follows:
struct ECAN_REGS ECanaShadow;
ECanaShadow.CANME.all = ECanaRegs.CANME.all;
Then all I have to do is modify the shadow CANME member, then write it back to ECANaRegs, easy. However, these two lines of code cause the mcu to jump to the USER11_ISR trap function and stop there. I have no idea what's causing it. I don't understand why creating the ECanaShadow object, then simply copying the CANME register to it it from ECAnaRegs (which happens elsewhere in the code many times) is causing such an issue. I don't even know where to begin to troubleshoot this as this code is so simple and should just work. I haven't even tried to write back to ECanaRegs yet.
Oh, and by the way, it doesn't seem to be jumping to USER11_ISR from those lines of code. If I set a breakpoint on that code, it doesn't even get to it before it jumps to USER11_ISR, which is even more confusing.
Something else I've noticed. This issue only happens when I have mailboxes enabled before calling those lines of code, specifically 0-11, 14, and 15. If I don't use 0-11, everything works fine.