1. Introduction
When debugging the E3 chip, using the IAR integrated development environment is an efficient and convenient method. This article will explain how to debug the E3 chip using IAR, including how to view the values of E3 registers, set data breakpoints, and dynamically observe variable values.
2. Viewing E3 Register Values Using IAR
Method 1:
View the corresponding register values through the Memory Window:
- First, obtain the register address:
Retrieve the register value from the RM, obtain the peripheral base address through the Memory Map, and then locate the specific description of the peripheral register in the corresponding section to find the offset address of the desired register. Alternatively, you can find the base address and offset in the program, such as in xxxx_reg.h.
Example: How to obtain the address of the GPIO_L2 multiplexing register?
Thus, the address of the GPIO_L2 multiplexing register can be calculated as 0xF30E0000 + 0x2008 = 0xF30E2008
-
Open the IAR menu bar and navigate to View->Memory->Memory1. A Memory1 window will appear. Enter the address found in step 1 into the Go to field and press Enter to jump to the corresponding register, where the cursor will appear.









-
In the IAR installation directory: C:\Program Files (x86)\IAR Systems\Embedded Workbench 8.4\arm\src\debugger\DCC, copy the following files to the project directory to be debugged and add these files to the project compilation.DCC_Write.c (optional)JLINKDCC.h (mandatory)JLINKDCC_HandleDataAbort.s (optional)JLINKDCC_Process.c (mandatory)

-
Register JLINKDCC_HandleDataAbort to the Cortex-R5's data abort handler. Modify JLINKDCC_HandleDataAbort to return to the original data abort handler during normal program data aborts. (Optional: This step is to avoid handling data aborts that may occur when the debugger attempts to read invalid memory.)

-
In IAR Options-->Debugger-->Extra Options, set the DCC timeout to --jlink_dcc_timeout=, with a range of 5~5000ms. The default value is 100. Set this to a value greater than the cycle of JLINKDCC_Process().

-
Set the refresh cycle for the Live Watch window. Configure the Live Watch observation window as follows:


-
For systems with an OS, add the following code to periodically retrieve the values of variables added to the Live Watch:
void Task_JLINKDCC_Process(void *pvParameters)
{
(void)pvParameters;
while (1) {
vTaskDelay(10UL);
JLINKDCC_Process();
}
}
//Create a task for JLINKDCC polling
xTaskCreate(Task_JLINKDCC_Process, "Task_JLINKDCC_Process", configMINIMAL_STACK_SIZE, NULL,
(tskIDLE_PRIORITY + 2), NULL);
-
Test case example:

