Hi, i am using:
-nRF 52 DK
-nRF 52832
-Sensor of Maxim Integrated
-SDK 17.0.2
I have some problems in handling the I2C through the nrfx module.
This is my ReadByte function and the handler:
Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
static const nrfx_twim_t twim_instance = NRFX_TWIM_INSTANCE(0);
volatile bool twim_tx_done = false;
volatile bool twim_rx_done = false;
void twim_handler(nrfx_twim_evt_t const * p_event, void * p_context)
{
size_t primaryBufferSize = p_event->xfer_desc.primary_length;
uint8_t *bytesTransferred = p_event->xfer_desc.p_primary_buf;
size_t secondaryBufferSize = p_event->xfer_desc.secondary_length;
uint8_t *bytesRead = p_event->xfer_desc.p_secondary_buf;
switch (p_event->type)
{
case NRFX_TWIM_EVT_DONE:
NRF_LOG_INFO("STATE OF BUFFERS IN EVENT HANDLER:");
NRF_LOG_INFO("\t Size of primary buffer: %d", primaryBufferSize);
NRF_LOG_INFO("\t Size of secondary buffer: %d", secondaryBufferSize);
I am stack at the "nrfx_twim_xfer" function where i am getting this EVENT_ERROR checked in the TWIM0 viewer in debug mode, the ERRORSRC is 0x02 (ANACK).:
I was not able to retrieve information about this on the blog.
Have you an idea why this happen and i why i am not able to let my TWIM function work?
Thanks,
polimarte