nrf52840: unexpected PHY behavior?
- Dominant language
- C
- Stars
- 893
- Forks
- 512
- Avg merge
- 13d 31m
- Merged PRs (30d)
- 7
Description
While doing a sequence of energy measurements, I noticed some strange behavior on the `nrf52840dk` (`nrf52840`). While running a simple application that sends out legacy advertisements every 500ms, I can see CPU activity between two advertisement events where there should be none. This happens in non-deterministic intervals.
Trace A (ADV interval: 500ms, payload 3 byte, non-connectable, non-discoverable):

Trace B (ADV interval: 500ms, payload 3 byte, undirected-connectable, general discoverable)

Running the exact same application on the `nrf52dk` (`nrf52832`) does not show this behavior, on that board the trace looks as expected. So from that I think this might be a PHY related issue on the `nrf52840`?!
I also wonder if this could be related to #767?
Background infos:
- running NimBLE (dba097972d28701c10b9af2a48af7d924c9cfca3) @ RIOT (35b6ccedf31f10a5f8e4f97609ad5b10c28bdc34)
- the application simply calls `ble_gap_adv_start()` with the following params:
```
struct ble_gap_adv_params adv_params = {
.conn_mode = BLE_GAP_CONN_MODE_NON, // or BLE_GAP_CONN_MODE_UND for trace B
.disc_mode = BLE_GAP_DISC_MODE_NON, // or BLE_GAP_DISC_MODE_GEN for trace B
.itvl_min = BLE_GAP_ADV_ITVL_MS(500),
.itvl_max = BLE_GAP_ADV_ITVL_MS(500),
};
```
- No additional (user) threads
- NimBLE is configured as stated in `porting/targets/riot/syscfg.yml` with the following changes:
```
CFLAGS += -DMYNEWT_VAL_BLE_LL_TX_PWR_DBM=0
CFLAGS += -DMYNEWT_VAL_BLE_LL_MAX_PKT_SIZE=251
CFLAGS += -DMYNEWT_VAL_BLE_LL_CFG_FEAT_DATA_LEN_EXT=1
CFLAGS += -DMYNEWT_VAL_BLE_L2CAP_COC_MPS=200
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Reproduce the two 500 ms advertising configurations on the nrf52840dk and compare them with the nrf52dk using the application and settings in the report. Start at ble_gap_adv_start() and porting/targets/riot/syscfg.yml, then compare the behavior with issue #767; done means identifying the source of the extra CPU activity or documenting whether it is PHY-specific.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- embedded-iot
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100