This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

The nRF5 SDK v16 & v17 for RF52833-DK has a bug with port mapping for the Arduino shield ports.

The nrf52833_peripherals.h file has the P1_PIN_NUM set to 10 but the pca10100.h file has ARDUINO 8-13 pins mapped to port 1, pin 17 to 23.  This cannot be correct and causes failures setting the pins.   What are the correct values?

in file pca10100.h in components/boards

#define ARDUINO_13_PIN NRF_GPIO_PIN_MAP(1, 23) // Digital pin 13
#define ARDUINO_12_PIN NRF_GPIO_PIN_MAP(1, 22) // Digital pin 12
#define ARDUINO_11_PIN NRF_GPIO_PIN_MAP(1, 21) // Digital pin 11
#define ARDUINO_10_PIN NRF_GPIO_PIN_MAP(1, 20) // Digital pin 10
#define ARDUINO_9_PIN NRF_GPIO_PIN_MAP(1, 19) // Digital pin 9
#define ARDUINO_8_PIN NRF_GPIO_PIN_MAP(1, 17) // Digital pin 8

while in modules\nrfx\mdk\nrf52833_peripherals.h

/* GPIO */
#define GPIO_PRESENT
#define GPIO_COUNT 2

#define P0_PIN_NUM 32
#define P1_PIN_NUM 10

nrf_gpio uses these numbers to allocate the gpiote_control_block_t's configured_pins.   These values cause a buffer overflow when referencing ARDUINO_8_PIN.

Related