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

TWI Driver and SVC Handler Missing Error

Hello,

I seem to be having some errors with my current project. I am using SoftDevice S310 Version 3.0 and SDK 9.0. When i try to communicate with one of my I2C sensors I get an SVC Handler Missing Error (0x01). This doesn't appear to be a valid error code for the TWI functions.

Here is my initialization and transfer:

uint32_t err_code;

static const nrf_drv_twi_config_t twi_config = {
                                                .frequency = NRF_TWI_FREQ_400K,
					                            .scl = I2C_SCL,
					                            .sda = I2C_SDA,
				                                .interrupt_priority = APP_IRQ_PRIORITY_LOW
                                               };
err_code = nrf_drv_twi_init(&twi, &twi_config, NULL);
APP_ERROR_CHECK(err_code);
																							 
nrf_drv_twi_enable(&twi);

err_code = nrf_drv_twi_tx(&twi, 0x68, rtc_data_reg, sizeof(rtc_data_reg), true);
APP_ERROR_CHECK(err_code);

err_code = nrf_drv_twi_rx(&twi, 0x68, rtc_data, sizeof(rtc_data), false);
APP_ERROR_CHECK(err_code);

Does anyone have any explanation for what could cause the nrf_drv_twi_tx and nrf_drv_twi_rx functions to return with the SVC Handler Missing Error?

Thanks for any solutions you can help me reach,

Cory

Parents
  • This is because nrd_drv_twi.c uses CRITICAL_REGION_ENTER and CRITICAL_REGION_EXIT macros. You should include components\libraries\util\app_util_platform.h file for this

    These two macros have softdevice specific implementation if the softdevice is present. Seems like you have used some project template example which has SOFTDEVICE_PRESENT set in keil-> Target options->C/C++ ->Define, remove it if you are not using softdevice

Reply
  • This is because nrd_drv_twi.c uses CRITICAL_REGION_ENTER and CRITICAL_REGION_EXIT macros. You should include components\libraries\util\app_util_platform.h file for this

    These two macros have softdevice specific implementation if the softdevice is present. Seems like you have used some project template example which has SOFTDEVICE_PRESENT set in keil-> Target options->C/C++ ->Define, remove it if you are not using softdevice

Children
No Data
Related