[FAQ] AM62x & AM64x: How to use CCS to debug a running M4F core that was started by Linux?

I am using AM62x or AM64x.

I want to use Code Composer Studio (CCS) to debug a program running on the M4F. The M4F was already initialized and loaded by Linux. I want CCS to attach to the M4F and start debugging the code that is already running (i.e., I do NOT want CCS to restart the M4F or load new code onto the M4F).


Q: Why would I want CCS to attach to the M4F without resetting the M4F? 

If the remote core (i.e., M4F) uses RPMsg communication with Linux, then some information about RPMsg is included in the M4F firmware. However, some RPMsg information needs to be provided by Linux. That information is typically provided by the Linux RemoteProc and RPMsg drivers while Linux is booting up. If CCS reloads firmware onto the M4F after Linux has already booted, then CCS overwrites the RPMsg information from Linux. If the RPMsg information from Linux is deleted, then RPMsg with the Linux cores will not work.

If CCS needs to be the one to load the M4F firmware (instead of Linux), and if the firmware uses Linux RPMsg, consider shutting down and restarting the Linux IPC drivers as described here.

Q: What if the remote core firmware does not use RPMsg? Can CCS reset the M4F in that case without messing with the Linux IPC drivers? 

Yes, CCS can reset the M4F and load new firmware into the M4F if the M4F firmware does not need information from Linux. Steps for loading and running remote core firmware from CCS are covered in the MCU+ SDK documentation under "CCS Launch, Load and Run".

Q: Does this example also work for R5F cores? 

The same concept also applies to R5F cores. However, some of the specific steps might need to be changed.