STM32
超强工具——STM32CubeMX 你会用吗?
集结出发! STM32全国研讨会系列之一:ST智能门铃中国首秀
关于STM32启动文件的几个小问题
【银杏科技ARM+FPGA双核心应用】STM32H7系列35——USB_VCP_FS
【银杏科技ARM+FPGA双核心应用】STM32H7系列28——USB_HID
粉丝分享 | 图说CRC原理应用及STM32硬件CRC外设
STM32L151进入低功耗,并由RTC唤醒的故事
[转]stm32控制NFC模块(PN532)源码(P2P,模拟卡,读写卡等
STM32G070RB+LVGL移植
微信公众号
手机版
改动的代码:
DAP_Config.h:
#define SWO_UART 0
#define USART_CDC_CLOCK(state) RCC_APB2PeriphClockCmd(RCC_APB2Periph_USART1, state)
#define USART_CDC_GPIO_CLOCK(state) RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA, state)
#define USART_CDC_REMAP() /* GPIO_PinRemapConfig(..., ENABLE) */
#define USART_CDC_PORT 1 //USART1
#define USART_CDC_GPIO GPIOA
#define USART_CDC_TX_PIN_MASK GPIO_Pin_9
#define USART_CDC_RX_PIN_MASK GPIO_Pin_10
#define USART_CDC_IRQn USART1_IRQn
#define USART_CDC_IRQHandler USART1_IRQHandler
#define USART_CDC_BUFFER_SIZE (1024) /* Size of Receive and Transmit buffers MUST BE 2^n */
#define PIN_USB_CONNECT_RCC RCC_APB2ENR_IOPAEN
#define PIN_USB_CONNECT_PORT GPIOA
#define PIN_USB_CONNECT_PIN 8
// TDI Pin (output)
#define PIN_TDI_PORT GPIOA
#define PIN_TDI_PIN 7
// SWDIO/TMS Pin
#define PIN_SWDIO_TMS_PORT GPIOA
#define PIN_SWDIO_TMS_PIN 1
// SWCLK/TCK Pin
#define PIN_SWCLK_TCK_PORT GPIOA
#define PIN_SWCLK_TCK_PIN 5
// TDO/SWO Pin (input) //remap USART1_Rx_Pin to PB7 for SWO
#define PIN_TDO_PORT GPIOB
#define PIN_TDO_PIN 7
// nRESET Pin
#define PIN_nRESET_PORT GPIOB
#define PIN_nRESET_PIN 0
因为串口1的Rx线被SWO/TDO占用了。
这个,我只能给一点提示,因为没有试过,没有办法具体说出正确的改动方法。
由于SWO/TDO的引脚PB7,使用了USART1的Rx线的功能,您要改动VCP使用USART1,就要把SWO/TDO搬到USART2的Rx线去,或者禁止SWO和JTAG功能。 需要改动的地方比较多。
如果,不想麻烦,建议另买一块Bluepill小板(研究源码),或者STLINKv2的山寨仿真器刷DAP(这个实用),都是十多元钱事儿。
好的,我再研究下,谢谢回复,主要是想废物利用下
linking...
.\CMSIS-DAP\CMSIS_DAP.axf: Error: L9937E: RL-ARM is not allowed with this license
.\CMSIS-DAP\CMSIS_DAP.axf: Error: L9937E: RL-ARM is not allowed with this license
.\CMSIS-DAP\CMSIS_DAP.axf: Error: L9937E: RL-ARM is not allowed with this license
.\CMSIS-DAP\CMSIS_DAP.axf: Error: L9937E: RL-ARM is not allowed with this license
.\CMSIS-DAP\CMSIS_DAP.axf: Error: L9937E: RL-ARM is not allowed with this license
用MDKv5.xx试一试,安装MDKv4兼容包。
已搞定,原来是 Real-Time OS没有许可。感谢!!!