Follow these steps to program debugging using the µVision Debugger and the ULINK USB-JTAG Adapter. Detailed information can be found in the µVision User's Guide in the Creating Applications chapter.
Use the Options for Target toolbar button and click the Debug tab to display the Debug dialog.
Select Use: and ULINK ARM Debugger in the drop-down to choose the ULINK USB-JTAG Adapter as the debugging tool.
Check the Load Application aet Startup and the Run to main() options to load your application and execute code up to the beginning of your main() function when the debugger starts.
In the Initialization File text box, click the browse button and select the STM32DBG.INI initialization file which sets up the STM32 MCU Control Register for debug and trace mode when you start the debugger.
Check the SWJ checkbox and select the SW option under Port to use the Single Wire mode interface. Max Clock should be set to 5MHz.
Select the Verify Code Download option under Download Options to compare the loaded application program with the Flash ROM content. You may disable this option to speed up the debugger start.
Use the Start/Stop Debug Session toolbar button to start debugging the program.
Use the µVision command, Debug — Start/Stop Debug Session, to start debugging the program.