The SDK version is 15.0.0, SD 132, single peripheral conection.
the configuration:
#define APP_BLE_CONN_CFG_TAG 1 /**< A tag identifying the SoftDevice BLE configuration. */ #define DEVICE_NAME "GC" /**< Name of device. Will be included in the advertising data. */ #define NUS_SERVICE_UUID_TYPE BLE_UUID_TYPE_VENDOR_BEGIN /**< UUID type for the Nordic UART Service (vendor specific). */ #define APP_BLE_OBSERVER_PRIO 3 /**< Application's BLE observer priority. You shouldn't need to modify this value. */ #define APP_ADV_INTERVAL 64 /**< The advertising interval (in units of 0.625 ms. This value corresponds to 40 ms). */ #define APP_ADV_DURATION 18000 /**< The advertising duration (180 seconds) in units of 10 milliseconds. */ #define MIN_CONN_INTERVAL MSEC_TO_UNITS(20, UNIT_1_25_MS) /**< Minimum acceptable connection interval (20 ms), Connection interval uses 1.25 ms units. */ #define MAX_CONN_INTERVAL MSEC_TO_UNITS(75, UNIT_1_25_MS) /**< Maximum acceptable connection interval (75 ms), Connection interval uses 1.25 ms units. */ #define SLAVE_LATENCY 0 /**< Slave latency. */ #define CONN_SUP_TIMEOUT MSEC_TO_UNITS(4000, UNIT_10_MS) /**< Connection supervisory timeout (4 seconds), Supervision Timeout uses 10 ms units. */ #define FIRST_CONN_PARAMS_UPDATE_DELAY APP_TIMER_TICKS(5000) /**< Time from initiating event (connect or start of notification) to first time sd_ble_gap_conn_param_update is called (5 seconds). */ #define NEXT_CONN_PARAMS_UPDATE_DELAY APP_TIMER_TICKS(30000) /**< Time between each call to sd_ble_gap_conn_param_update after the first call (30 seconds). */ #define MAX_CONN_PARAMS_UPDATE_COUNT 3 /**< Number of attempts before giving up the connection parameter negotiation. */ #define DEAD_BEEF 0xDEADBEEF /**< Value used as error code on stack dump, can be used to identify stack location on stack unwind. */ #define UART_TX_BUF_SIZE 256 /**< UART TX buffer size. */ #define UART_RX_BUF_SIZE 256 /**< UART RX buffer size. */ #define SEC_PARAM_BOND 1 /**< Perform bonding. */ #define SEC_PARAM_MITM 0 /**< Man In The Middle protection not required. */ #define SEC_PARAM_LESC 0 /**< LE Secure Connections not enabled. */ #define SEC_PARAM_KEYPRESS 0 /**< Keypress notifications not enabled. */ #define SEC_PARAM_IO_CAPABILITIES BLE_GAP_IO_CAPS_NONE /**< No I/O capabilities. */ #define SEC_PARAM_OOB 0 /**< Out Of Band data not available. */ #define SEC_PARAM_MIN_KEY_SIZE 7 /**< Minimum encryption key size. */ #define SEC_PARAM_MAX_KEY_SIZE 16 /**< Maximum encryption key size. */
this is how i request the timeouts:
#define TIMESLOT_TIMEOUT 60000 /**@brief Request next timeslot event in earliest configuration */ uint32_t request_next_event_earliest(void) { m_slot_length = 1500; m_timeslot_request.request_type = NRF_RADIO_REQ_TYPE_EARLIEST; m_timeslot_request.params.earliest.hfclk = NRF_RADIO_HFCLK_CFG_XTAL_GUARANTEED; m_timeslot_request.params.earliest.priority = NRF_RADIO_PRIORITY_NORMAL; m_timeslot_request.params.earliest.length_us = m_slot_length; m_timeslot_request.params.earliest.timeout_us = TIMESLOT_TIMEOUT; return sd_radio_request(&m_timeslot_request); } /**@brief Configure next timeslot event in earliest configuration */ void configure_next_event_earliest(void) { m_slot_length = 1500; m_timeslot_request.request_type = NRF_RADIO_REQ_TYPE_EARLIEST; m_timeslot_request.params.earliest.hfclk = NRF_RADIO_HFCLK_CFG_XTAL_GUARANTEED; m_timeslot_request.params.earliest.priority = NRF_RADIO_PRIORITY_NORMAL; m_timeslot_request.params.earliest.length_us = m_slot_length; m_timeslot_request.params.earliest.timeout_us = TIMESLOT_TIMEOUT; } /**@brief Configure next timeslot event in normal configuration */ void configure_next_event_normal(void) { m_slot_length = 1500; m_timeslot_request.request_type = NRF_RADIO_REQ_TYPE_NORMAL; m_timeslot_request.params.normal.hfclk = NRF_RADIO_HFCLK_CFG_XTAL_GUARANTEED; m_timeslot_request.params.normal.priority = NRF_RADIO_PRIORITY_HIGH; m_timeslot_request.params.normal.distance_us = TIMESLOT_TIMEOUT; m_timeslot_request.params.normal.length_us = m_slot_length; }
With the timeouts of about 50ms and less, the application is not granted with the timeslot at all, no matter how short the timeslot length is requested.
My target is to get about 3ms long timeslots each 6ms, in a cycle. And of course i understand that from time to time there will be "BLOCKED" and "CANCELED" states.
Currently i am configuring the Timer0 like this: NRF_TIMER0->CC[0] = m_slot_length - 100. Is 100us enough for the SD to perform gracefull shutdown?
Please help.
Ivan.