DA14531 cannot reuse JTAG SWDIO or SCLK pins as GPIO with pull-up/pull-down ? (blinky demo)


I am using a DA14531 with SDK version

I am using a custom PCB, but I have also confirmed this behaviour on a dev board kit.

I have confirmed the behaviour using the blinky demo in both cases.

I have modified the blinky demo (main.c:blinky_test() function) like so: 

void blinky_test(void)
    volatile int i=0;

    // printf_string(UART, "\n\r\n\r");
    // printf_string(UART, "***************\n\r");
    // printf_string(UART, "* BLINKY DEMO *\n\r");
    // printf_string(UART, "***************\n\r");


        if (LED_OFF_THRESHOLD == i)
            GPIO_ConfigurePin(LED_PORT, LED_PIN, INPUT_PULLDOWN, PID_GPIO, false);
            // GPIO_SetActive(LED_PORT, LED_PIN);
            // printf_string(UART, "\n\r *LED ON* ");

        if (LED_ON_THRESHOLD == i)
            GPIO_ConfigurePin(LED_PORT, LED_PIN, INPUT_PULLUP, PID_GPIO, true);
            // GPIO_SetInactive(LED_PORT, LED_PIN);
            // printf_string(UART, "\n\r *LED OFF* ");

        if (i == 2 * LED_ON_THRESHOLD)
            i = 0;

I change the pin via \blinky\include\user_periph_setup.h

/* LED configuration                                                                    */
// Define LED Pad
#if defined (__DA14531__)
    #define LED_PORT                GPIO_PORT_0
    #define LED_PIN                 GPIO_PIN_3
    // #define LED_PIN                 GPIO_PIN_5
    // #define LED_PIN                 GPIO_PIN_2
    #define LED_PORT                GPIO_PORT_1
    #define LED_PIN                 GPIO_PIN_0

I have tested the behaviour with:

Pin Observation
P0_03 Line toggles between VBAT_HIGH and 0V as expected
P0_02 Line remains low (but doesn't appear to be pulled down)
P0_05 Line remains low (but doesn't appear to be pulled down)

Reproduction steps

To test the behaviour I program the dev daughter board with the J1 jumpers on SWCLK and SWDIO and RST enabled. I then disconnect the jumpers and probe the headers (on the daughterboard connection side). I can probe the MISO point on J1 for P0_03 and that is where I confirm I get the correct blinky behaviour.

Similarly when testing my target PCB I am using the Dev motherboard as a J-Link and after programming the PCB I disconnect the SWCLK, SWDIO and RST headers and then probe the test points on the target PCB. I have the grounds linked between my target PCB and the dev motherboard when using this configuration.

In both cases, when I do not disconnect the J1 jumpers for SWD I can see activity on the lines while debugging as expected, hence why they are disconnected to properly measure the signal.


I need to use P0_02 and P0_05 for my target application, am I missing a configuration in order to use those pins?

  • Hi There,

    Thank you for posting your question online.
    Let me check on this and I will get back to you as soon as possible.

    Kind Regards,

  • Hi There,

    Apologies for the delay.
    According to your private ticket (#367309) you stated that you have configured the SWD pins and you have disabled the HW Reset.
    If I have misunderstood something, please correct me.
    If you have configured the SWD Pins then you will have to use the new SWD pins in order to program your board.
    Please refer on the DA14531 Datasheet.
    If you have the DA14531 WLCSP17 chip then check on page:23

    If you have the DA14531 FCGQFN24 chip then check on page 26:

    Please refer here on how you can re-map the SWD pins:4. Software — getting_started (renesas.com)
    On 4.1 Can I Remap SWD Pins to GPIOs:

    And from DA14531 Datasheet on 26.2.3 Fixed Assignment Functionality, on page: 145

    When your device resets or reboots you should be able to access the default SWD pins again. Are you able to connect to the board via SmartSnippets Toolbox?
    Can you kindly share which pins you have configured for SWD and which DA14531 package you are working with?

    Kind Regards,

  • Thanks!

    For completeness I implemented this function to enable me to toggle between having the pins enabled and disabled.

    void set_swd_pins_usage(bool use_swd) {
        // http://lpccs-docs.renesas.com/DA14531_FAQs/Software.html#can-i-remap-swd-pins-to-gpios
        if (use_swd) {
            SetBits16(SYS_CTRL_REG, DEBUGGER_ENABLE, 0x01);
        else {
            SetBits16(SYS_CTRL_REG, DEBUGGER_ENABLE, 0x0);