For debugging with Trust Zone (TZ) devices you need to first confirm the Device Lifecycle Management (DLM) state of the device. The device needs to be in the SSD state which has DBG2 debug level to have no restriction to access memories and peripherals for both Secure and Non-Secure partitions. Please note that the MCU can debug the non-secure only assets when the MCU is in NSECSD state, which has DGB1 debug level. The three debug levels are:
DBG2: The debugger connection is allowed, and no restriction to access memories and peripherals.
DBG1: The debugger connection is allowed and restricted to access only Non-Secure memory regions and peripherals.
DBG0: The debugger connection is not allowed.
The current DLM state can be read and it be initialized to SSD using the Renesas Flash Programmer (RFP) or using the Renesas Device Partition Manager, a tool integrated in the e2studio IDE and Renesas RA Smart Configurator.
For the HW debug connection, you will also need Renesas E2, or E2 Lite, or SEGGER J-Link emulator to connect host machine to the target board. The target board will need a debug connector with the JTAG or SWD interface pinout as per the below table:
The debug connector will also need to support Serial Programming using SCI to program Implementation Defined Attribution Unit (IDAU) register. This will require Pin 4, SWCLK/TCK and MD pins connection using wired OR circuit on the target board to use both debugging and serial programming. Please note that for RA8 devices, the IDAU registers can be accessed using JTAG or SWD to set up the TrustZone® boundaries. Hence, Serial Programming using SCI Boot Mode is not required.