No Cortex-M Device found in JTAG chain. please check the JTAG cable and the connected devices

使用stm32cube 新建工程,生成keilv5 工程,编译烧写进芯片,芯片断电后再上电烧写程序,发现不能正常烧写,keil报错,No Cortex-M Device found in JTAG chain. please check the JTAG cable and the connected devices.!!STM32cube 生成的文件中档,HAL_MspInit里,有一句__HAL_AFIO_REMAP_SWJ_DISABLE,把jtag和sw给禁用了,所以出那一堆错。把这句注释掉就好了。
Cube这点好像做的不太好,模板里就把jtag/sw禁用掉了!!

   另外,由于不小心JTAG已经被禁用的情况下,有网友总结出可以通过

  1. 找到BOOT1和BOOT0,把BOOT1拉低,把BOOT0拉高到3.3V

  2.从新下载程序,刷点FLASH

  3.把boot0 再次拉低就可以了

 STM32F103ZET6 boot启动

                              boot0   boot1

从flash     启动             0       X

从系统代码 启动            1       0

从sram     启动            1       1

 

posted @ 2017-04-17 17:19  10yunlong  阅读(3770)  评论(0编辑  收藏  举报