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

How to get RSSI asynchronously & independent of any connection or events.

Hello,

I have an application in which I need to get RSSI before, during and after any BLE connection has been made.  The RSSI measurements are being used to quantify the co-channel interference generated by a WIFI radio.  I need to make this measurement independent of BLE connection state.  For example, I am not interested in the RSSI while the last packet was received.

In my application, I need to measure RSSI, then control a 3rd-party "custom" RF frontend based on the measurement, then repeat.  It is important that I can make these measurements asynchronously and independently of a BLE connection.

The problem I am seeing is when I call the get_rssi() function below.  The system hangs or prints "<error> app: Fatal error" to the serial console.

uint8_t get_rssi(void)
{
    NRF_RADIO->EVENTS_RSSIEND = 0;
    NRF_RADIO->TASKS_RSSISTART = 1;
    while (NRF_RADIO->EVENTS_RSSIEND == 0);
    uint8_t rssi = NRF_RADIO->RSSISAMPLE;
    return rssi;
}

It would seem that the Line "NRF_RADIO->TASKS_RSSISTART = 1;" is the problem.  If I omit this line, then RSSI measurements are stale (do not updated frequently enough).

Till now, my work has been on top of the "ble_app_att_mtu_throughput" example using S140 SoftDevice.  I am using the "nRF5 v16.0.0" SDK.

My hardware is the pca10056 nRF52840 evaluation board and a custom platform.  I see the same issue on both platforms.

My Questions are:

(1) Can I use the RSSI registers directly while using a SoftDevice?

(2) Is there an API method to get instantaneous RSSI?

Thanks

Parents Reply Children
No Data
Related