CTRL-AP implements a mailbox interface which enables the CPU to communicate with a debugger over the SWD interface.
The mailbox interface consists of a transmit register MAILBOX.TXDATA with its corresponding status register MAILBOX.TXSTATUS, and a receive register MAILBOX.RXDATA with its corresponding status register MAILBOX.RXSTATUS. Status bits in registers TXSTATUS/RXSTATUS will be set and cleared automatically when registers TXDATA/RXDATA are written to and read from, independently of the direction.
Mailbox transfer sequence
- Sender writes TXDATA
- CTRL-AP sets sender's TXSTATUS to DataPending
- CTRL-AP sets receiver's RXSTATUS to DataPending
- Receiver reads RXDATA
- CTRL-AP sets receiver's RXSTATUS to NoDataPending
- CTRL-AP sets sender's TXSTATUS to NoDataPending
Events
EVENTS_RXREADY is generated when MAILBOX.RXSTATUS changes to DataPending. This indicates that a debugger has written new data to MAILBOX.RXDATA.
EVENTS_TXDONE is generated when the MAILBOX.TXSTATUS changes to NoDataPending. This indicates that a debugger has read the data from MAILBOX.TXDATA.