Hi,
Eventhough I am able to communicate with my I2C slave, this message appear for every transmision.
[00:00:00.709,350]
[1;31m<err> i2c_nrfx_twim: Error 195952641 occurred for message 0
[0m
I am aware that 195952641 code refers to address not acknowledged. On the forums this problem always come together with the impossibility to communicate with the slave device, but it's not my case. What I am doing is simply write a command and read the result. I use the following functions:
struct device* i2c2 = device_get_binding("I2C_2"); (...) cmd = 0x1000; (...) static uint8_t aTxBuf[2] = {0}; aTxBuf[0] = (cmd & 0xFF00)>>8 ; aTxBuf[1] = cmd & 0x00FF ; const uint8_t* buf = aTxBuf; //I don't think there's need to do this err_code = i2c_write(i2c2, buf, (uint32_t)2, (uint16_t)0x80); (...) static uint8_t data[3] = {0}; err_code = i2c_read(i2c2, (uint8_t *)data, 3, (uint16_t)0x81);
My prj.conf looks like this (I think there's many unnecessary things but most of the related problems get solved by modifying the prj.conf file):
CONFIG_SERIAL=y CONFIG_UART_0_NRF_UARTE=y CONFIG_NEWLIB_LIBC=y # General config CONFIG_ASSERT=y # Network CONFIG_NETWORKING=y CONFIG_NET_NATIVE=n CONFIG_NET_SOCKETS=y CONFIG_NET_SOCKETS_OFFLOAD=y # BSD library CONFIG_BSD_LIBRARY=y # AT host library CONFIG_AT_HOST_LIBRARY=y CONFIG_UART_INTERRUPT_DRIVEN=y # Stacks and heaps CONFIG_MAIN_STACK_SIZE=3072 CONFIG_HEAP_MEM_POOL_SIZE=16384 # i2c CONFIG_LOG=y CONFIG_I2C_LOG_LEVEL_DBG=y CONFIG_LOG_BACKEND_UART=y CONFIG_I2C=y CONFIG_I2C_NRFX=y CONFIG_I2C_2=y CONFIG_I2C_2_NRF_TWIM=y CONFIG_NEWLIB_LIBC=y
I am using the default overlay for i2c2 so I don't think I need to show that.
Any help is welcome!
Thanks,
Aleix.