搜索
查看: 1590|回复: 1

[原创] CubeMX 4.22.1 remap导致sw掉线bug

[复制链接]

该用户从未签到

1

主题

2

帖子

0

蝴蝶豆

初级会员

最后登录
2021-2-9
发表于 2017-10-13 10:41:34 | 显示全部楼层 |阅读模式
#define __HAL_AFIO_REMAP_TIM2_PARTIAL_1() do{ CLEAR_BIT(AFIO->MAPR, AFIO_MAPR_TIM2_REMAP); \
SET_BIT(AFIO->MAPR, AFIO_MAPR_TIM2_REMAP_PARTIALREMAP1); \
}while(0U)
CUBEMX version4.22.1
used stm32f103vct6
调试模式是sw MAPR寄存器不能直接读   直接读写回去导致sw掉线
Bits 26:24 SWJ_CFG[2:0]: Serial wire JTAG configuration
These bits are write-only (when read, the value is undefined
). They are used to configure the
SWJ and trace alternate function I/Os. The SWJ (Serial Wire JTAG) supports JTAG or SWD
access to the Cortex debug port. The default state after reset is SWJ ON without trace. This
allows JTAG or SW mode to be enabled by sending a specific sequence on the JTMS /
JTCK pin.
000: Full SWJ (JTAG-DP + SW-DP): Reset State
001: Full SWJ (JTAG-DP + SW-DP) but without NJTRST
010: JTAG-DP Disabled and SW-DP Enabled
100: JTAG-DP Disabled and SW-DP Disabled
Other combinations: no effect

回复

使用道具 举报

该用户从未签到

29

主题

1285

帖子

59

蝴蝶豆

论坛元老

最后登录
2021-6-27
发表于 2017-10-13 11:00:04 | 显示全部楼层
帮顶      
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 注册/登录

本版积分规则

关闭

站长推荐上一条 /3 下一条

Archiver|手机版|小黑屋|论坛-意法半导体STM32/STM8技术社区

GMT+8, 2024-4-26 06:41 , Processed in 0.153274 second(s), 34 queries .

Powered by Discuz! X3.4

Copyright © 2001-2024, Tencent Cloud.

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