Unable to configure pins 8 & 9 as SCL and SDA on BMD300 (nrf52832)

I am using pin 8 (NFC pin) as SCL and pin 9 as SDA of nrf52832 on my custom board. Basically I have connected MPU9250 with these pins and I know that MPU9250 is NRFND, for testing I guess its OK to use. I have used 4.7k resistor for pull-up. For firmware part I am using nrfx library. When I use this library to configure other pins it works but not for these pins. 

#include <zephyr/kernel.h>
#include <stdio.h>
#include "twi.h"
#include "mpu9250.h"

int main(void)
{
    int err;

    err = twi_init(8U, 9U);
    if (err != 0)
    {
        printk("\rcould not initialize i2c\n");
    }

    err = twi_enable();
    if (err != 0)
    {
        printk("\rcould not enable i2c\n");
    }

    uint8_t dummy[] = { 1, 2, 3, 4, 5 };
    if (err == 0)
    {
        while (true)
        {
            err = twi_write(0xAA, 0xBB, dummy, sizeof(dummy));
            if (err != 0)
            {
                printk("\rcould not enable i2c\n");
            }
        }
    }
    printk("Hello World! %s\n", CONFIG_BOARD);
    return 0;
}

Parents Reply Children
Related