硬汉嵌入式论坛

 找回密码
 立即注册
查看: 6942|回复: 4
收起左侧

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

[复制链接]

1万

主题

6万

回帖

10万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
106660
QQ
发表于 2020-12-2 15:31:36 | 显示全部楼层 |阅读模式
断点有硬件断点,软件断点之分,在Flash上调试是硬件断点限制的,不同内核芯片支持的硬件断点数不同,对于Cortex-M内核一般是4-8个。

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

QQ图片20201202160546.png


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

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

2.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

评分

参与人数 1金币 +20 收起 理由
zqz1201135 + 20 很给力!

查看全部评分

回复

使用道具 举报

1万

主题

6万

回帖

10万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
106660
QQ
 楼主| 发表于 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.
回复

使用道具 举报

1

主题

15

回帖

18

积分

新手上路

积分
18
发表于 2020-12-2 20:22:17 | 显示全部楼层
学了一招,厉害了
回复

使用道具 举报

4

主题

286

回帖

298

积分

高级会员

积分
298
发表于 2024-3-17 12:15:12 | 显示全部楼层
请教硬件歌,软件断点的最大用处有哪些?这些软件断点是写在源程序中的吧?
回复

使用道具 举报

1万

主题

6万

回帖

10万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
106660
QQ
 楼主| 发表于 2024-3-18 08:31:41 | 显示全部楼层
soyshell 发表于 2024-3-17 12:15
请教硬件歌,软件断点的最大用处有哪些?这些软件断点是写在源程序中的吧?

对,可以做个条件编译,各个需要地方都加入个。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|小黑屋|Archiver|手机版|硬汉嵌入式论坛

GMT+8, 2024-4-28 23:26 , Processed in 0.180235 second(s), 33 queries .

Powered by Discuz! X3.4 Licensed

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表