how to soft reset nrf51 in ble application??
Yes. Correct.
hello i am interfacing i2c sensor mma8452 with nrf51 dk. my function is
void mma_read(uint8_t *x, uint8_t *y, uint8_t *z)
{
uint32_t err_code;
uint8_t rx_buffer[6];
err_code = mma8452_I2C_register_read(MMA_ADDR, DATAX0, rx_buffer, sizeof(rx_buffer));
if(err_code != NRF_SUCCESS)
{
sd_nvic_SystemReset();
}
*x = (rx_buffer[0]);
*y = (rx_buffer[2]);
*z = (rx_buffer[4]);
}
but when i put break point on *x = (rx_buffer[0]) it goes into infinite loop
ret_code_t mma8452_I2C_register_read(uint8_t slave_addr, uint8_t reg_addr, uint8_t * pdata, uint32_t bytes)
{
ret_code_t ret_code;
ret_code = nrf_drv_twi_tx(p_twi_master,slave_addr, ®_addr,1,true);
if(ret_code != NRF_SUCCESS)
{
return ret_code;
}
ret_code = nrf_drv_twi_rx(p_twi_master,slave_addr, pdata, bytes, false);
return ret_code;
}
Please add this a new question.