eric2013 发表于 2020-12-2 15:31:36

关于DAPLINK调试支持的硬件断点个数和软件断点个数

断点有硬件断点,软件断点之分,在Flash上调试是硬件断点限制的,不同内核芯片支持的硬件断点数不同,对于Cortex-M内核一般是4-8个。

比如STM32H7,M7内核可以支持8个:




而软件断点是不限制的,可以无限个,在MDK上使用,DAPLINK没法直接使用软件断点,可以手动加上__asm("BKPT 0"),可以无限个。

动态GIF效果,我直接做全速运行展示:




__asm("BKPT 0")里面用的是数值0,此参数范围是0-255,大家可以根据需要设置,也可以全部用0。


参考资料:
1、http://www.armbbs.cn/forum.php?mod=viewthread&tid=82840
2、https://www.silabs.com/community ... re_breakpoints-5yrw

eric2013 发表于 2020-12-2 16:16:10

What is Special about Software Breakpoints in Flash?
A: Unlimited Flash Breakpoints allow you to set an unlimited number of breakpoints even if your application program is not located in RAM, but in flash memory. This is a scenario which was very rare before ARM-microcontrollers hit the market. This new technology makes very powerful, yet inexpensive ARM microcontrollers available for systems, which required external RAM before. The downside of this new technology is that it is not possible to debug larger programs on these micros in RAM, since the RAM is not big enough to hold program and data (typically, these chips contain about 4 times as much flash as RAM), and therefore with standard debuggers, only 2 breakpoints can be set. The 2 breakpoint limit makes debugging very tough; a lot of times the debugger requires 2 breakpoints to simply step over a line of code. With software breakpoints in flash, this limitation is gone.

zqz1201135 发表于 2020-12-2 20:22:17

学了一招,厉害了:victory:

soyshell 发表于 2024-3-17 12:15:12

请教硬件歌,软件断点的最大用处有哪些?这些软件断点是写在源程序中的吧?

eric2013 发表于 2024-3-18 08:31:41

soyshell 发表于 2024-3-17 12:15
请教硬件歌,软件断点的最大用处有哪些?这些软件断点是写在源程序中的吧?

对,可以做个条件编译,各个需要地方都加入个。
页: [1]
查看完整版本: 关于DAPLINK调试支持的硬件断点个数和软件断点个数