CN / EN
Doc Feedback
Thanks for your interest, welcome to contact us.
Thanks for your feedback

Configuring the Debugger

Configure the debugger before debugging. Click (Options for Target) on the Keil toolbar to open the Options for Target ‘GRxx_Soc’ dialog box, and then select Debug tab. In the window, software simulation debugging displays on the left, and online hardware debugging displays on the right. Bluetooth LE example projects adopt the online hardware debugging. Related default configurations of the debugger are shown as follows:

Figure 28 Debugger configuration

The default initialization file sram.ini is in SDK_Folder\build\keil. You can use this file directly, or copy it to the project directory.

Note:

SDK_Folder is the root directory of GR551x SDK.

The initialization file sram.ini contains a set of debug commands, which are executed during debugging. On the Initialization File bar, click Edit... on the right side, to open the sram.ini file. Example code of sram.ini is provided as follows:

/**
*****************************************************************
*	GR55xx object loading script through debugger interface
*	(e.g.Jlink, *etc).
*	The goal of this script is to load the Keils's object file to the
*	GR55xx RAM
*	assuring that the GR55xx has been previously cleaned up.
*****************************************************************
*/
// Debugger reset(check Keil debugger settings)
// Preselected reset type(found in Options->Debug->Settings)is
// Normal(0);
// -Normal:Reset core & peripherals via SYSRESETREQ & VECTRESET bit
RESET

// Load object file 
LOAD %L

// Load stack pointer  
SP = _RDWORD(0x00000000)
// Load program counter
$ = _RDWORD(0x00000004)
// Write 0 to vector table register, remap vector
_WDWORD(0xE000ED08, 0x00000000)
Note:

Keil supports executing debugger commands set by developers in the following order:

  1. When Load Application at Startup (Options for Target ‘GRxx_Soc’ > Debug > Load Application at Startup) is enabled, the debugger first loads the file under Name of Executable (Options for Target ‘GRxx_Soc’ > Output > Name of Executable).
  2. Execute the command in the file specified in Options for Target ‘GRxx_Soc’ > Debug > Initialization File.
  3. When options under Options for Target ‘GRxx_Soc’ > Debug > Restore Debug Session Settings are checked, restore corresponding Breakpoints, Watch Windows, Memory Display, and other settings.
  4. When Options for Target ‘GRxx_Soc’ > Debug > Run to main() is checked, or the command g,main is discovered in the Initialization File, the debugger automatically starts executing CPU commands, until running to the main() function.

Scan to follow

Open WeChat, use "Scan" to follow.