The debug system has a cross-trigger network used to simultaneously start and halt the cores in the system.
The following diagram shows an overview of the cross-trigger connections.
Both the application and network cores have a cross-trigger interface (CTI) peripheral that can trigger events or be triggered by signals in the processor or debug blocks. The CTI can be configured to route trigger in-signals to trigger out-signals within the CTI or the cross-trigger matrix. The cross-trigger matrix has four channels in total that can be used to communicate trigger signals between cores.
You can stop the network core when the application core is stopped (due to a breakpoint or a stopped debug session), by doing the following:
- Configure the application core CTI to generate an event on channel 0 for CTITRIGIN[0] (processor halted) using CTIINEN[0].
- Configure the network core CTI to trigger CTITRIGOUT[0] (processor debug request) on channel 0 using CTIOUTEN[0].
Configuring the cross-trigger interface
- Channel 0 is used to relay debug requests from the application to the network domain.
- Channel 1 is used to relay debug requests from the network to the application domain.
- Channel 2 is used by the debugger to send a common trigger for restarting both domains after a breakpoint.
For the application core, add the following code:
#define CTI_TRIGIN_CPUHALTED 0
#define CTI_TRIGOUT_DEBUGREQ 0
#define CTI_TRIGOUT_CPURESTART 1
...
// Enable global CTI routing
NRF_CTI_S->CTICONTROL = CTI_CTICONTROL_GLBEN_Enabled;
// Connect the CPU halted trigger of this domain to debug request of the other domain
NRF_CTI_S->CTIINEN[CTI_TRIGIN_CPUHALTED] = CTI_CTIINEN_TRIGINEN_0_Msk;
NRF_CTI_S->CTIOUTEN[CTI_TRIGOUT_DEBUGREQ] = CTI_CTIOUTEN_TRIGOUTEN_1_Msk;
NRF_CTI_S->CTIOUTEN[CTI_TRIGOUT_CPURESTART] = CTI_CTIOUTEN_TRIGOUTEN_2_Msk;
For the network core, add the following code:
#define CTI_TRIGIN_CPUHALTED 0
#define CTI_TRIGOUT_DEBUGREQ 0
#define CTI_TRIGOUT_CPURESTART 1
...
// Enable global CTI routing
NRF_CTI_NS->CTICONTROL = CTI_CTICONTROL_GLBEN_Enabled;
// Connect the CPU halted trigger of this domain to debug request of the other domain
NRF_CTI_NS->CTIINEN[CTI_TRIGIN_CPUHALTED] = CTI_CTIINEN_TRIGINEN_1_Msk;
NRF_CTI_NS->CTIOUTEN[CTI_TRIGOUT_DEBUGREQ] = CTI_CTIOUTEN_TRIGOUTEN_0_Msk;
NRF_CTI_NS->CTIOUTEN[CTI_TRIGOUT_CPURESTART] = CTI_CTIOUTEN_TRIGOUTEN_2_Msk;
See the following tables for more information about trigger connections to and from the CTI.
| Signal | Description |
|---|---|
| CTITRIGIN[0] | Processor halted |
| CTITRIGIN[1] | DWT comparator output 0 |
| CTITRIGIN[2] | DWT comparator output 1 |
| CTITRIGIN[3] | DWT comparator output 2 |
| CTITRIGIN[4] | ETM event output 0 |
| CTITRIGIN[5] | ETM event output 1 |
| Signal | Description |
|---|---|
| CTITRIGOUT[0] | Processor debug request |
| CTITRIGOUT[1] | Processor restart |
| CTITRIGOUT[2] | N/A |
| CTITRIGOUT[3] | N/A |
| CTITRIGOUT[4] | ETM event input 0 |
| CTITRIGOUT[5] | ETM event input 1 |
| CTITRIGOUT[6] | ETM event input 2 |
| CTITRIGOUT[7] | ETM event input 3 |
| Signal | Description |
|---|---|
| CTITRIGIN[0] | Processor halted |
| CTITRIGIN[1] | DWT comparator output 0 |
| CTITRIGIN[2] | DWT comparator output 1 |
| CTITRIGIN[3] | DWT comparator output 2 |
| Signal | Description |
|---|---|
| CTITRIGOUT[0] | Processor debug request |
| CTITRIGOUT[1] | Processor restart |