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

strange behavior of certain central/peripheral combination

Hi everyone, I have some strange behavior with a central peripheral combination. My central subscribes notification on the peripheral. This has a limited TX-Buffer for just one notification to prevent buffering old sensor data. The sensor data are read in a ratio notification handler before every radio activity and sent via notification. The expected behavior is:

  1. first connection event -> notification is sent
  2. second connection event -> LLacknowledge produces TX complete, new notification can be send

Then everything starts form the beginning. This works fine, as long as I use my smartphone or master control panel as Central. When I connect with my own central (nrf51822, S120_V1.0.1) the behavior is:

  1. first connection event -> notification is sent
  2. second connection event -> LLacknowledge produces TX complete.
  3. third connection event -> central establishes connection, but peripheral doesn’t answer.
  4. fourth connection event -> central RETRYs last packet, peripheral send next notification

Then it goes on with 2.. Every time the central has to do a retry, before next notification. I tried different things to fix this. For example I choose a longer value for NRF_RADIO_NOTIFICATION_DISTANCES when notification is created. By surprise, the error disappears, when I choose the shortest distance of 800us! I don’t get, why this behavior is just with this central/peripheral combination and why it works, when you shorten the distance before radio activity.

Has anyone an idea?

Edit: Format

Parents
  • Which code example for the S120 are you basing this on? Have you enabled anything else in the code example that what was already there? Timers? SPI? I2C? What's the connection interval between the peripheral and central?

  • Hi, My original code is based on the multilink example from SDK 5.2.0, because I already developed some multilink applications. But this one is just a single link central. So I shortened my own application again. I use S120 version 1.0.1 All serial communication is disabled. “app_timer” module with a 5ms repeated timer is in use. Central and peripheral are initialized with intern RC LFCLK. The central scans, connects, discovers and then subscribes for notification. The same procedure worked well for many times in other applications (multilink). But there my peripherals always used 800us radio notification distance.

Reply
  • Hi, My original code is based on the multilink example from SDK 5.2.0, because I already developed some multilink applications. But this one is just a single link central. So I shortened my own application again. I use S120 version 1.0.1 All serial communication is disabled. “app_timer” module with a 5ms repeated timer is in use. Central and peripheral are initialized with intern RC LFCLK. The central scans, connects, discovers and then subscribes for notification. The same procedure worked well for many times in other applications (multilink). But there my peripherals always used 800us radio notification distance.

Children
No Data
Related