Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bluetooth: periodic_sync sample never executes .recv callback #42961

Closed
GatCode opened this issue Feb 18, 2022 · 6 comments
Closed

Bluetooth: periodic_sync sample never executes .recv callback #42961

GatCode opened this issue Feb 18, 2022 · 6 comments
Assignees
Labels
area: Bluetooth Host area: Bluetooth bug The issue is a bug, or the PR is fixing a bug

Comments

@GatCode
Copy link
Contributor

GatCode commented Feb 18, 2022

I've tried to execute the periodic_adv and periodic_sync samples on 5340dk's and 52840dk's but the periodic_sync board never reaches the .recv callback altough the sync gets established.

For testing purposes, I've already stripped parts of the original samples to make it more clear. Basically line 50 (printk("Hello From recv_cb\n");) on the receiver side never gets executed. Here you can find the simple example: https://gist.github.com/GatCode/ab1513545154fb53e1dd390a5ac2d30c

For the 52s, I used the correct config from the boards folder and with the 53s, I enabled the correct settings on the netcore and I'm using ncs v1.9.0 - this version is based on Zephyr 45ef0d2.

@GatCode GatCode added the bug The issue is a bug, or the PR is fixing a bug label Feb 18, 2022
@carlescufi carlescufi changed the title periodic_sync sample never executes .recv callback Bluetooth: periodic_sync sample never executes .recv callback Feb 18, 2022
@carlescufi
Copy link
Member

@GatCode could you please run your simple example with the latest upstream Zephyr (v3.0.0-rc3 right now) and see if the issue is there as well?

@ppryga-nordic
Copy link
Collaborator

ppryga-nordic commented Feb 18, 2022

I've run periodic_scync sample on nRF5340DK and periodic_adv on nRF52833 and below is console log.
It synchronizes with advertiser.
I've used code from v3.0.0-rc1.

*** Booting Zephyr OS build v3.0.0-rc1  ***
Starting Periodic Advertising Synchronization Demo
Checking LED device...done.
Configuring GPIO pin...done.
Scan callbacks register...success.
Periodic Advertising callbacks register...Success.
Start scanning...success.
Start blinking LED...
Waiting for periodic advertising...
[DEVICE]: 07:E8:86:CF:8A:88 (random), AD evt type 3, Tx Pwr: 127, RSSI -41  C:0 S:0 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms)TPwr: 127, RSSI -88  C:0 S:0 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 255
[DEVICE]: 4F:EB:D1:3E:CB:3D (random), AD evt type 3, Tx Pwr: 127, RSSI -82  C:0 S:0 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), S type 5, Tx Pwr: 127, RSSI -69 Test Periodic Advertising C:0 S:0 D:0 SR:0 E:1 Prim: LE 1M, Secn: LE 2M, Interval: 0x03c0 (1200 ms), SID: 0
Fouodic Advertising Sync...success.
Waiting for periodic sync...
[DEVICE]: 76:27:9B:B3:A4:89 (random), AD evt type 0, Tx Pwr: 127, RSSI -96  C:1 S:1 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 ([DEVICE]: 1C:31:83:BC:4C:9A (random), AD evt type 3, Tx Pwr: 127, RSSI -99  C:0 S:0 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 [DEVICE]: BC:14:85:D0:EF:EF (public), AD evt type 3, Tx Pwr: 127, RSSI -76  C:0 S:0 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000PER_ADV_SYNC[0]: [DEVICE]: 3C:5F:27:41:F4:A0 (random) synced, Interval 0x03c0 (1200 ms), PHY LE 2M
PER_ADV_SYNC[0]: [DEVICE]: 3C:5F:27:41:F4:A0 (Periodic sync established.
Stop blinking LED.
Waiting for periodic sync lost...
[DEVICE]: B8:8E:82:3F:FA:E6 (public), AD evt type 0, Tx Pwr: 127, RSSI -97  C:1 S:1 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 m,SID: 255
[DEVICE]: 6D:53:B1:D7:03:15 (random), AD evt type 0, Tx Pwr: 127, RSSI -101  C:1 S:1 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 mandom), AD evt type 0, Tx Pwr: 127, RSSI -98  C:1 S:1 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 255
[DEVICE]: E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 255
PER_ADV_SYNC[0]: [DEVICE]: 3C:5F:27:41:F4:A0 (random), tx_power 127, RSSI -58, CTE 0, data length 5, data: 04ffffff08
PER_ADV_SYNC[0]: [DEVICE]: 3C:5F:27:41:F4:A0 (random), tx_power 127, RSSI -60, CTE 0, data length 5, data: 04ffffff08
PER_ADV_SYNC[0]: [DEVICE]: 3C:5F:27:41:F4:A0 (random), tx_power 127, RSSI -54, CTE 0, data length 5, data: 04ffffff08
PER_ADV_SYNC[0]: [DEVICE]: 3C:5F:27:41:F4:A0 (random), tx_power 127, RSSI -56, CTE 0, data length 5, data: 04ffffff08
PER_ADV_SYNC[0]: [DEVICE]: 3C:5F:27:41:F4:A0 (random), tx_power 127, RSSI -58, CTE 0, data length 5, data: 04ffffff08
[DEVICE]: 40:16:3B:08:E7:AB (public), AD evt type 0, Tx Pwr: 127, RSSI -102  C:1 S:1 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms)PER_ADV_SYNC[0]: [DEVICE]: 3C:5F:27:41:F4:A0 (random), tx_power 127, RSSI -53, CTE 0, data length 5, data: 04ffffff09
PER_ADV_SYNC[0]: [DEVICE]: 3C:5F:27:41:F4:A0 (random), tx_power 127, RSSI -57, CTE 0, data length 5, data: 04ffffff09
[DEVICE]: 04:21:44:BD:14:F9 (public), AD evt type 0, Tx Pwr: 127, RSSI -90 JBL Charge 4 C:1 S:1 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 255
[DEVICE]: 04:21:44:BD:14:F9 (public), AD evt type 4, Tx Pwr: 127, RSSI -90  C:1 S:1 D:0 SR:1 E:0 Prim: LE 1M, Secl: 0x0000 (0 ms), SID: 255
PER_ADV_SYNC[0]: [DEVICE]: 3C:5F:27:41:F4:A0 (random), tx_power 127, RSSI -59, CTE 0, data length 5, data: 04ffffff09
PER_ADV_SYNC[0]: [DEVICE]: 3C:5F:27:41:F4:A0 (random), tx_power 127, RSSI -64, CTE 0, data length 5, data: 04ffffff09
[DEVICE]: 3C:BD:3E:56:7E:CD (public), AD evt type 0, Tx Pwr: 127, RSSI -100  C:1 S:1 D:0 SR:0 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (06:7E:CD (public), AD evt type 4, Tx Pwr: 127, RSSI -99  C:1 S:1 D:0 SR:1 E:0 Prim: LE 1M, Secn: No packets, Interval: 0x0000 (0 ms), SID: 255

,,,

@GatCode
Copy link
Contributor Author

GatCode commented Feb 18, 2022

@carlescufi can you please tell me how I can checkout this revision inside the ncs v1.9.0? I thought this is easily possible with a west update ... command but this seems not to be the case?

@ppryga-nordic
Copy link
Collaborator

ppryga-nordic commented Feb 18, 2022

@GatCode go to Zephyr repository and call git checkout v3.0.0-rc2.

BTW. Could you provide logs from your test runs?

@GatCode
Copy link
Contributor Author

GatCode commented Feb 18, 2022

Thanks @ppryga but that's exactly how I get the following build error:

CMake Error at /opt/nordic/ncs/v1.9.0/zephyr/cmake/kconfig.cmake:272 (message):
  command failed with return code: 1
Call Stack (most recent call first):
  /opt/nordic/ncs/v1.9.0/zephyr/cmake/app/boilerplate.cmake:543 (include)
  /opt/nordic/ncs/v1.9.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:24 (include)
  /opt/nordic/ncs/v1.9.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:35 (include_boilerplate)
  /Users/abcde/test/periodic_adv/build/CMakeLists.txt:4 (find_package)


-- Configuring incomplete, errors occurred!
FATAL ERROR: command exited with status 1: /opt/nordic/ncs/v1.9.0/toolchain/bin/cmake -DWEST_PYTHON=/opt/nordic/ncs/v1.9.0/toolchain/opt/python@3.9/bin/python3.9 -B/Users/abcde/test/periodic_adv/build -S/Users/abcde/test/periodic_adv -GNinja -DBOARD=nrf52840dk_nrf52840 -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=On -DNCS_TOOLCHAIN_VERSION:STRING=NONE -DBOARD_ROOT:STRING=/Users/abcde/test/periodic_adv '-DCONF_FILE:STRING=/Users/abcde/test/periodic_adv/prj.conf;/Users/abcde/test/periodic_adv/boards/nrf52840dk_nrf52840.conf'```

@GatCode
Copy link
Contributor Author

GatCode commented Feb 19, 2022

Thanks to both of you! Yes the issue is resolved in v3.0.0-rc3 and for all the future readers who struggle like me - these links might be helpful:

@GatCode GatCode closed this as completed Feb 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Bluetooth Host area: Bluetooth bug The issue is a bug, or the PR is fixing a bug
Projects
None yet
Development

No branches or pull requests

4 participants