Other Parts Discussed in Thread: C2000WARE
Tool/software:
Hello,
I am having an issue developing a custom bootloader that boots from flash. It seems that adding code to support branching is causing my firmware update function to fail, and I suspect the failure is in the MCAN module. The problem manifests as a corruption in the data sent from and received by the MCAN.
The bootloader is configured to idle until it receives instructions over DCAN from an external controller (for now, a PC). It will either be instructed to 1) accept a new firmware update over DCAN and pass a new firmware update over MCAN to several submodules (up to 10 f28003x's) or 2) to branch to the main application.The firmware update portion of the code was developed first, and has been working well for some time.
The issue arises when I introduce code for option 2 as described above. I added a handshaking loop to put the f28388D and the submodule(s) in a branch-ready state before branching. The handshaking loop takes place after the main loop, which contains the check on received data to determine if the f28388D should enter its firmware update function or not. If a branch command is received by the f28388D, the program exits the main loop and enters the handshaking loop. Simply including the handshaking loop in my program causes the firmware update to fail. That is to say that I can omit the handshaking loop and do firmware updates without issue, but if I include the handshaking loop and make no other changes to my code, the data sent and received by the MCAN is corrupted. The MCAN data I receive in the f28388D does not match the data sent by the submodule(s), and the submodule(s) don't see some messages sent by the MCAN. This was determined by running both programs in debug sessions and monitoring the data in the expressions window.
I would like some help understanding why my firmware update code or the MCAN module would behave differently when I add in code unrelated to the part that works.
Other issues that may be related to this: My program will often get stuck in CAN_initRam at seemingly random times. This problem did not arise until I started trying to include this handshaking loop to control branching. I also have seen that the MCAN stops sending and receiving messages whenever I hit a breakpoint or pause my program for debugging purposes. I typically need to re-start my program every time I hit a breakpoint, and I find this very inconvenient.
Thanks,
Tom