apache / apache/mynewt-nimble

nrf52840: unexpected PHY behavior?

Open
#879 4 comments 0 reactions 0 assignees View on GitHub
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):
![ppk_nrf52840_adv500ms_NON](https://user-images.githubusercontent.com/620834/97680258-b6d8a500-1a96-11eb-8f2d-c57793d6168c.png)

Trace B (ADV interval: 500ms, payload 3 byte, undirected-connectable, general discoverable)
![ppk_nrf42840_adv500ms_UND](https://user-images.githubusercontent.com/620834/97680583-35354700-1a97-11eb-85ff-3e6541c98143.png)

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.