Skip to content

Using 4 pin front header on Blue Pill  #12

@verjus

Description

@verjus

Hi,

This is not really an issue but I am trying to use dap42 on an Blue Pill board with no side headers. Therefore, I would like to use the 4 pin front header (labeled swdio and swclk). I tried to redefine the GPIO PINs to use them instead of PB13/14 by modifying the file src/stm32f103/bluepill/DAP/CMSIS_DAP_config.h as follows:

From:

#define SWCLK_GPIO_PORT         GPIOB
#define SWCLK_GPIO_PIN          GPIO13
#define SWDIO_GPIO_PORT         GPIOB
#define SWDIO_GPIO_PIN          GPIO14
#define nRESET_GPIO_PORT        GPIOB
#define nRESET_GPIO_PIN         GPIO0

#define LED_CON_GPIO_PORT       GPIOC
#define LED_CON_GPIO_PIN        GPIO13
#define LED_RUN_GPIO_PORT       GPIOC
#define LED_RUN_GPIO_PIN        GPIO13
#define LED_ACT_GPIO_PORT       GPIOC
#define LED_ACT_GPIO_PIN        GPIO13

#define SWDIO_GPIO_PIN_NUM      14

TO:

#define SWCLK_GPIO_PORT         GPIOA
#define SWCLK_GPIO_PIN          GPIO14
#define SWDIO_GPIO_PORT         GPIOA
#define SWDIO_GPIO_PIN          GPIO13
#define nRESET_GPIO_PORT        GPIOB
#define nRESET_GPIO_PIN         GPIO0

#define LED_CON_GPIO_PORT       GPIOC
#define LED_CON_GPIO_PIN        GPIO13
#define LED_RUN_GPIO_PORT       GPIOC
#define LED_RUN_GPIO_PIN        GPIO13
#define LED_ACT_GPIO_PORT       GPIOC
#define LED_ACT_GPIO_PIN        GPIO13

#define SWDIO_GPIO_PIN_NUM      13

But it's not working. When I try, I get:

openocd -f /data2/dap42/openocd/interface-dap42.cfg -c 'transport select swd' -f target/nrf52.cfg
Open On-Chip Debugger 0.11.0-rc2+dev-00002-g427552c-dirty (2021-01-31-10:09)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
DEPRECATED! use 'adapter driver' not 'interface'
swd
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : CMSIS-DAP: SWD  Supported
Info : CMSIS-DAP: FW Version = 1.0
Info : CMSIS-DAP: Interface Initialised (SWD)
Info : SWCLK/TCK = 0 SWDIO/TMS = 1 TDI = 0 TDO = 0 nTRST = 0 nRESET = 1
Info : CMSIS-DAP: Interface ready
Info : clock speed 1000 kHz
Error: Error connecting DP: cannot read IDR

What am I missing?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions