GPIO0_2 (P0.02) Pin Behavior Issue on nRF54L15 - Button Triggering Events Without Interaction

Hello Nordic Team!

I'm experiencing unusual issues with GPIO pins on an nRF54L15 custom board. Specifically, P0.02 and P1.03 are not behaving as expected.

Button Issues (P0.02)

I have three buttons configured in my application:
- Button K1 on GPIO2_9
- Button K2 on GPIO2_10
- Button K3 on GPIO0_2

All GPIO pins are configured with `GPIO_ACTIVE_LOW | GPIO_PULL_UP`, meaning they should read as high (1) when not pressed and low (0) when pressed.

The problem with P0.02:
1. On startup, debug logs correctly show K3 as high (not pressed): `ButtonK3 initial state: 1`
2. Shortly after initialization, the button triggers a long press event without physical interaction: `K3 long press start (MultiButton)`
3. Continuous debug logs show the pin consistently reads as state 1, yet the button's pressed state persists

Here is the code:

static const struct gpio_dt_spec ButtonK1 = { .port = GPIO2_DEV, .pin = 9, .dt_flags = GPIO_ACTIVE_LOW | GPIO_PULL_UP };
static const struct gpio_dt_spec ButtonK2 = { .port = GPIO2_DEV, .pin = 10, .dt_flags = GPIO_ACTIVE_LOW | GPIO_PULL_UP };
static const struct gpio_dt_spec ButtonK3 = { .port = GPIO0_DEV, .pin = 2, .dt_flags = GPIO_ACTIVE_LOW | GPIO_PULL_UP };
static const struct gpio_dt_spec ButtonK4 = { .port = GPIO0_DEV, .pin = 3, .dt_flags = GPIO_ACTIVE_LOW | GPIO_PULL_UP };
static const struct gpio_dt_spec ButtonK5 = { .port = GPIO0_DEV, .pin = 4, .dt_flags = GPIO_ACTIVE_LOW | GPIO_PULL_UP };


Additional testing:
- I attempted to bind an interrupt event to P0.02 but failed, while P0.03 and P0.04 worked successfully
- Using a hardware testing tool, I found that P0.02 appears to be connected to GND when the board is powered on, but disconnects when power is removed
- This suggests some internal configuration is affecting the pin

LED Issue (P1.03)

I also can't properly control P1.03 for LED output, while P1.02 works fine. I have already set `CONFIG_NFCT_PINS_AS_GPIOS=y` in my configuration.

Configuration Details

SDK version: nRF Connect SDK v3.0.0
Build arguments: `-DFILE_SUFFIX="internal"`

My overlay file contains:

chosen {
zephyr,console = &uart30;
zephyr,shell-uart = &uart30;
zephyr,uart-mcumgr = &uart30;
zephyr,bt-mon-uart = &uart30;
zephyr,bt-c2h-uart = &uart30;
};
&uart20 {
status = "disabled";
};

&uart30 {
status = "okay";
current-speed = <115200>;
/delete-property/ hw-flow-control;
};

UART is functioning properly and I can see the debug output.

## Questions

1. Is P0.02 a special pin on nRF54L15 that might have default functions affecting its GPIO behavior?
2. Even though I've disabled hardware flow control for UART, could other internal functions be affecting this pin?
3. Are there specific configurations needed to use P0.02 and P1.03 reliably as GPIO pins?
4. Could there be a conflict with another peripheral that's claiming these pins?

Thank you for your assistance!

Best regards,
Xiongwei.wang

Parents
  • Hi Nordic Team,

    I just solved the problem with the LEDs on P1.02 and P1.03. I read the how-to-config-nfc-as-gpio-on-nrf54l15 post in the forum, and I added the code:

    NRF_NFCT->PADCONFIG = 0;


    after Matter Init and before gpio init. It works now.

    However, there is still a problem: P0.02 is connected to GND after I connect the board to power. I'm not sure how to resolve this issue with the button on P0.02 pin.

    Any suggestions would be greatly appreciated!

    Best regards,
    Xiongwei Wang

  • Hello Xiongwei,

    The problem with P0.02:
    1. On startup, debug logs correctly show K3 as high (not pressed): `ButtonK3 initial state: 1`
    2. Shortly after initialization, the button triggers a long press event without physical interaction: `K3 long press start (MultiButton)`
    3. Continuous debug logs show the pin consistently reads as state 1, yet the button's pressed state persists
    Additional testing:
    - I attempted to bind an interrupt event to P0.02 but failed, while P0.03 and P0.04 worked successfully
    - Using a hardware testing tool, I found that P0.02 appears to be connected to GND when the board is powered on, but disconnects when power is removed
    - This suggests some internal configuration is affecting the pin

    Have you tried to test with a very minimal project that only has the button on P0.02 and nothing else?

    The issue is very strange. From the firmware side, I can think of only one possible cause which is accidentally wrong configuration.

    What board target are you building with?

    Could you please share these files?

    1. Compiled zephyr.dts located at <build dir>/<project name>/zephyr/zephyr.dts? I would like to see if your configuration was correctly resolved.
    2. The list of DTS input file as shown by the nRF Connect for VS Code extension.
    3. For any DTS files listed above which were not originally in the SDK and unmodified, their contents.

    The issue could also be in hardware, but let's check these first.

    Hieu

Reply
  • Hello Xiongwei,

    The problem with P0.02:
    1. On startup, debug logs correctly show K3 as high (not pressed): `ButtonK3 initial state: 1`
    2. Shortly after initialization, the button triggers a long press event without physical interaction: `K3 long press start (MultiButton)`
    3. Continuous debug logs show the pin consistently reads as state 1, yet the button's pressed state persists
    Additional testing:
    - I attempted to bind an interrupt event to P0.02 but failed, while P0.03 and P0.04 worked successfully
    - Using a hardware testing tool, I found that P0.02 appears to be connected to GND when the board is powered on, but disconnects when power is removed
    - This suggests some internal configuration is affecting the pin

    Have you tried to test with a very minimal project that only has the button on P0.02 and nothing else?

    The issue is very strange. From the firmware side, I can think of only one possible cause which is accidentally wrong configuration.

    What board target are you building with?

    Could you please share these files?

    1. Compiled zephyr.dts located at <build dir>/<project name>/zephyr/zephyr.dts? I would like to see if your configuration was correctly resolved.
    2. The list of DTS input file as shown by the nRF Connect for VS Code extension.
    3. For any DTS files listed above which were not originally in the SDK and unmodified, their contents.

    The issue could also be in hardware, but let's check these first.

    Hieu

Children
No Data
Related