Author: RakshithM_16 Version: **
Why does the debug pointer not reach main() when using Keil uVision and ULink2/ULink Pro Debugger?
The steps that are needed to be followed to export a PSoC 6 project from PSoC Creator to Keil uVision can be found in –
Help > PSoC Creator Help Topics > Integrating into 3rd Party IDEs > PSoC 6 Designs > Creating µVision Projects for PSoC 6
The steps mentioned works for a CM4 project. But for a CM0+ project, after exporting the project into Keil uVision you find that you are able to program the device successfully as shown in Figure 1, but, when trying to debug, the debug pointer gets stuck before it reaches the main() function as shown in Figure 2.
Figure 1. Programming the device is successful
Figure 2. Debug Pointer does not reach main()
This scenario occurs when a CM0+ core project is exported to Keil uVision and VECTRESET option is selected as ULink2/Ulink Pro debugger reset mode.
In Options for Target window under Debug tab click on Settings as shown in Figure 3.
Figure 3. Click on Settings button as shown
In the Target Driver Setup window select SYSRESETREQ instead of VECTRESET as shown in Figure 6. VECTRESET mode is not supported in Cortex-M0+ core which is why the debugging process fails. Please refer this link for more information regarding SYSRESETREQ and VECTRESET. Next, click on OK.
Figure 4. Select SYSRESETREQ as the Reset option
The debug pointer should now reach main() as shown in Figure 5.
Figure 5. Debug Pointer reaches main()