Mbed-os: NRF52840 GPIOTE randomly fails to configure input

Created on 18 Dec 2019  路  6Comments  路  Source: ARMmbed/mbed-os

Description of defect

gpio_api.c does not initialize the skip_gpio_setup flag so sometimes the setup is skipped. gpio_api.c ought to always explicitly set skip_gpio_setup to false.

nrfx_gpiote_in_config_t is the struct with the skip_gpio_setup field.
All usages of nrfx_gpiote_in_config_t and nrfx_gpiote_in_init() should be reviewed for correct initialization of skip_gpio_setup. There are several other defines meant to be used with nrfx_gpiote_in_init() that are also missing initialization of this field.

Including:
NRFX_GPIOTE_CONFIG_IN_SENSE_LOTOHI
NRFX_GPIOTE_CONFIG_IN_SENSE_HITOLO
NRFX_GPIOTE_CONFIG_IN_SENSE_TOGGLE

So I see a total of 4 bugs here:
1 in gpio.api.c and 3 in nrfx_gpiote.h
targets\TARGET_NORDIC\TARGET_NRF5x\TARGET_NRF52\gpio_api.c
targets\TARGET_NORDIC\TARGET_NRF5x\TARGET_SDK_15_0\modules\nrfx\drivers\include\nrfx_gpiote.h

Target(s) affected by this defect ?

Nordic NRF52840 and likely other Nordic MCU devices

Toolchain(s) (name and version) displaying this defect ?

GCC_ARM

What version of Mbed-os are you using (tag or sha) ?

b6e5a0a8afa34dec9dae8963778aebce0c82a54b

What version(s) of tools are you using. List all that apply (E.g. mbed-cli)

mbed-cli 1.10.1

How is this defect reproduced ?

Use an InterruptIn with a PullUp. You'll see that sometimes the PullUp does not get configured because skip_gpio_setup gets randomly assigned to true sometimes (based on stack contents).

IOTOSM-2325 OPEN nordic mirrored bug

Most helpful comment

This could potentially be causing a lot of frustration for people trying to reduce power consumption for these parts...

All 6 comments

@thendrickson Can you send a pull request with a fix?

cc @desmond-blue

@ARMmbed/team-embeddedplanet

This could potentially be causing a lot of frustration for people trying to reduce power consumption for these parts...

Thank you for raising this detailed GitHub issue. I am now notifying our internal issue triagers.
Internal Jira reference: https://jira.arm.com/browse/IOTOSM-2325

Is this still valid?

@AGlass0fMilk

Was this page helpful?
0 / 5 - 0 ratings

Related issues

DuyTrandeLion picture DuyTrandeLion  路  3Comments

bulislaw picture bulislaw  路  3Comments

sarahmarshy picture sarahmarshy  路  4Comments

bcostm picture bcostm  路  4Comments

rbonghi picture rbonghi  路  3Comments