nRF51822调试时遇到的各种“奇葩”问题

前言:本人之前话说是做嵌入式开发的,但主要工作是做C++开发的,因为我们的嵌入式的复杂逻辑都是用C++写的,C++代码在PC端跑,嵌入式板的代码调试都是盲调或者通过串口输出进行调试,嵌入式的代码从没进行过断点的调试,因为整个公司的不用,不用的原因很简单,因为基本的部分已经写好并且蛮成熟的了。因此本人对嵌入式的断点调试经验空白可想而知。现切入到另外一款单片机进行开发,调试时遇到的一些“奇葩”问题,本人不知道真正的原因所在,尽管通过各种方式,规避了问题。下面我就奉上我遇到的部分Debug问题,最终在官方的用户手册里找到了答案,在官方的Troubleshooting部分,找到答案之后,心里瞬间踏实了不少!

18、The debugger seems to freeze while debugging.

答:If running a SoftDevice that has been programmed with the “Lock SoftDevice from Read back” enabled (see section section 6.1 on page 27, the debugger will halt while stepping to an SVC instruction. You should set the breakpoint after the SVC instruction and run the application to the breakpoint, or step over any SVC instructions. See section 7.1.2 on page 41 for more details.

19.Software gets out of sync while debugging

答:Setting/modifying breakpoints on a running system using the SEGGER debugger will halt the CPU, which may result in software that is out of sync. You should avoid setting breakpoints while the system is running.(不要在运行时设置断点或者更改断点,使用SEEGER调试

20.The debugger does not halt on breakpoints.

答:Some Keil projects in the SDK have Optimization level 3 (-03) and Optimize for time checked. If you are debugging an application with these settings, your breakpoint set might have no effect.

1. Press Alt+F7 to open the Target options dialog.

2. Select C/C++.

3. Select Optimization level 0 from the scroll down list.

4. Uncheck Optimize for time.


你可能感兴趣的:(NORDIC,nRF5)