nRF52840 Dongle and Blinky example using GPIO 0.31 draws 8mA

I added two extra buttons to ble_app_blinky (SDK 17.1.0) - port 1.10 and 0.31 I am running the code on an nRF52840 Dongle.The additional buttons are configured exactly like the existing button example, uses pullups are active low and the code works well.... however....if I measure the current draw on the 52840 dongle the normally low current (20-50uA) increases to 8mA if I use pin 0.31 (active low = ground).

I changed to the pin next to it (0.29) and it works as expected like the other button and the tactile switch, but pin 0.31 seems to pull massive current.

I went through the config and changed the default PWM output from 31 to 11 just in case that was effecting it but there is no change to the current draw.

The code works and functions as expected even using pin 0.31, but the current draw when using pin 0.31 is way outside spec.

Can you assist?

Is there something else I should be switching off, on, or configuring so I can use this pin.

It is just that pin 0.31 is very convenient as it is next to the gnd pin so easy to activate.

  • Thanks for the explanation. I tried compiling for the PCA10059 target, and yes I see the same thing. The reason is that P0.31 is configured as the UART TX pin for the logging module. If you are not using UART logging, the easiest way to fix this is to turn it off by setting the NRF_LOG_ENABLED in sdk_config.h to 0. Or you can change NRF_LOG_BACKEND_UART_TX_PIN to something else.

    I thought we were looking at  an hardware issue on the nRF52840 rather than a software configuration, so I didn't think about checking if the pin was used for something else. So I'm sorry that it took a while to figure it out.

    A tips on how to debug pin configuration issues is to read out the configuration using nrfjprog.The following command will read out P0.00 to P0.31 and P1.00 to P1.15:

    $nrfjprog --memrd 0x50000700 --n 0x80 && nrfjprog --memrd 0x50000A00 --n 0x40

    0x50000700: 00000002 00000002 00000002 00000002   |................|
    0x50000710: 00000002 00000002 00000003 00000002   |................|
    0x50000720: 00000003 00000002 00000002 00000002   |................|
    0x50000730: 00000003 00000002 00000002 00000002   |................|
    0x50000740: 00000002 00000002 00000002 00000002   |................|
    0x50000750: 00000002 00000002 00000002 00000002   |................|
    0x50000760: 00000002 00000002 00000002 00000002   |................|
    0x50000770: 00000002 00000002 00000002 00000003   |................|

    0x50000A00: 00000002 00000002 00000002 00000002   |................|
    0x50000A10: 00000002 00000002 0000000C 00000002   |................|
    0x50000A20: 00000002 00000003 00000002 00000002   |................|
    0x50000A30: 00000002 00000002 00000002 00000002   |................|

    The values can be correlated with the PIN_CNF[n] register description.

    P0.31 (marked in red) shows that the pin is an output.

    2 means disconnected input (default state), 3 (or 1) means output, C means input with pullup, etc.

  • I cannot thank you enough and I am very grateful for the time you have spent getting to the bottom of the issue. I was starting to question what had I done wrong. It now makes total sense as the DK has a J-Link and the Dongle does not so the debug data is sent to an external pin.

    I expect that this pin use detail for the Dongle is buried somewhere in documentation but can I ask that this configuration point is highlighted in some way. As a newbie to Nordic SDK, details about configuration are complex and distributed over a vast range of documents.

    The tip on reading the port configuration is extremely helpful.

    Again, many thanks.

Related