First, open IAR EWARM 8.22.1/9.20.2, select File->Open Workspace,
H:\hk32f030m\HK32F030Mxx_ExampleV1.0.5\HK32F030Mxx_ExampleV1.0.5\project\10 GPIO\1_GPIO_Toggle\EWARM\HK32F030M_Demo.eww file open
We select HK32F030M_Demo-Debug*, right-click or select Project from the menu, then select Options, observe General Option in the Category box, select the tab Target on the right, and check whether the selected debugging device is correct.
Observe the C\C++ Compiler settings again, especially whether the two parts under Preprocessor are correct or not.
Look at the link location file again,
Finally set up the emulator, because we are using the J-Link emulator and the default is the ST-Link emulator.
Select the J-Link/J-Trace option, then select the J-Link/J-Trace option under Category, look at the Connecttion tab on the right, and see if the Interface section below is SWD, and press OK to end the setup. At this time, we see the main interface, and the J-Link menu option appears on the menu bar.
We select the project file HK32F030M_Demo-Debug*, right-click on the pop-up menu or select Make under Project on the main menu to compile the project. During the compilation process, the Build window below displays the compilation results and problems. After the compilation is completed, errors and The number of warnings, and zero errors means the compilation was successful.
Next, we can choose Download and Debug under Project on the menu or on the toolbar.
Since J-Link does not officially support this chip, you may also select the core Cortex-M0 in the J-Link chip selection box,
At this time, the J-Link emulator will download the program to the chip. You can use IAR EWARM for normal debugging.
When you execute this program by single step, you can see that Led2 on the board will be on and off for a while. When you execute this program, Led2 will flash.