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

TWI don't work when erase_all flash

Hi all,

I am working on nRF52832, nRF5_SDK_15.2.0, nrf5SDKforMeshv300src, softdevice_6.1.0 and communicate with CAP1214 device.

When I erase all flash on nRF52832 and download firmware by Segger Embedded Studio, the using TWI to read CAP1214, it return error code is NRF_ERROR_INTERNAL.

static void twi_init (void)
{
ret_code_t err_code;

const nrf_drv_twi_config_t twi_config = {
.scl = ARDUINO_SCL_PIN,
.sda = ARDUINO_SDA_PIN,
.frequency = NRF_DRV_TWI_FREQ_100K,
.interrupt_priority = APP_IRQ_PRIORITY_LOWEST,
.clear_bus_init = false
};

err_code = nrf_drv_twi_init(&m_twi, &twi_config, NULL, NULL);
APP_ERROR_CHECK(err_code);

nrf_drv_twi_enable(&m_twi);
}

static uint8_t cap12xx_read(uint8_t reg) {
ret_code_t err_code;
uint8_t rs;
err_code = nrf_drv_twi_tx(&m_twi, CAP1214_ADDR, &reg, 1, true);
err_code = nrf_drv_twi_rx(&m_twi, CAP1214_ADDR, &rs, 1);
APP_ERROR_CHECK(err_code);
return rs;
}

When I erase all and  run example twi_scanner, I also meet this error?

How do I fix it?

Thank you!

Parents Reply Children
No Data
Related