Dear ,
When i use the demo of ".\SDK\nRF5_SDK_17.0.2_d674dde\examples\peripheral\twi_scanner\pca10040\blank\arm5_no_packs", Some exception occured . The sdk enters dead lock. The function of "twim_xfer" can't exit the loop of "transmission_finished".
.
The code like this :
int main(void)
{
ret_code_t err_code;
uint8_t address;
uint8_t sample_data;
bool detected_device = false;
nrf_gpio_cfg_output(5);
nrf_gpio_pin_set(5);
nrf_delay_ms(5);
nrf_gpio_cfg_output(31);
nrf_gpio_pin_set(31);
APP_ERROR_CHECK(NRF_LOG_INIT(NULL));
NRF_LOG_DEFAULT_BACKENDS_INIT();
NRF_LOG_INFO("TWI scanner started.");
NRF_LOG_FLUSH();
twi_init();
address=0x00;
nrf_drv_twi_tx(&m_twi, 0x5a, &address, 1, true);
nrf_drv_twi_rx(&m_twi, 0x5a, &sample_data, 1);
NRF_LOG_INFO("Id:%d",sample_data);
while(1)
;
}
Are there some cases caused the function of "twim_xfer" enters the infinitely loop?
Best regards