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

I2C interface with nrf52 sdk v9.2 hardfault error

I am designing an device and i need to communicate with the device using the I2C of my nrf52.

when ever i try to initiate the transfer process using the driver function -nrf_drv_twi_tx i get a hardfault error. the exact code is below

nrf_drv_twi_tx(&i2c1_master_instance, I2C_ADDRESS, TransmitBuffer, data_size, true) != NRF_SUCCESS)

i get a hardfault error and the event handler does not get called

I am using a pca10040 development board.

I have checked on my codes and i cannot find any fault in it.

Thanks

babatola

Parents
  • Hi bors,

    some section of the codes are below

    //the line below calculates data size and also fills the buffer with the data data_size = (audiocodec_transmit_data_i2c1(Owner_id, TransmitBuffer));

    //the line below is used for the actual transmission of data and it gives me a hard fault if (nrf_drv_twi_tx(&i2c1_master_instance, I2C_ADDRESS, &TransmitBuffer[0], data_size, false) != NRF_SUCCESS) { result = 0; return result; } else return result; }

Reply
  • Hi bors,

    some section of the codes are below

    //the line below calculates data size and also fills the buffer with the data data_size = (audiocodec_transmit_data_i2c1(Owner_id, TransmitBuffer));

    //the line below is used for the actual transmission of data and it gives me a hard fault if (nrf_drv_twi_tx(&i2c1_master_instance, I2C_ADDRESS, &TransmitBuffer[0], data_size, false) != NRF_SUCCESS) { result = 0; return result; } else return result; }

Children
No Data
Related