在程序中加入GPIO_PinRemapConfig(GPIO_Remap_SWJ_JTAGDisable,ENABLE);
按下复位键,debug界面,选择setting,在connect选项选择with pre-reset,然后点击下载,搞定。