KB 03: Keil Real-Board Debugging Issue
If the system is not working as expected, you must use real-board debugging to track the code. Keil supports hardware debugger by selecting hardware debug from Options for Target ➤ Debug as shown in Figure 1.
Figure 1: Selecting Hardware Debug
Next, you have to build the code. If there are no error, then click the debug button to start the debug and click it again to exit the debug.
When trying to enter hardware debugging mode on Keil μVision, the debugger immediately exits upon entering. Keil can still download object code, but will not run the debugger. Usually, this problem occurs after a while when the Keil debugger is working properly.
The following steps can fix the error:
- Open windows registry:
Open Command Prompt window. On the screen type regedit.exe to open Registry Editor. The contents should look similar to the image below:
- In the Registry Editor, search for the directory:
HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers
- If there is a similar entry to the following items below (the name will depend on the version and the folder you installed Keil), and select the entry
C:\Keil_v5\UV4\UV4.exe REG_SZ $ IgnoreFreeLibrary <lmidk-agdi.dll>
then remove it.
- Reboot the computer and then try again.