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

nRF8001 advertising issue

Hi,

We are currently developing a new product using nRF8001 IC and it is pretty much stable (not 100%) until now.

My algorithm is straight forward: When the MCU is in idle mode I issue a connect command to the nRF8001 so it can start advertising and It responds back with a response command event with success, I put the MCU to sleep (deep sleep) and only wake it up after I receive a low level in the "RDYN" pin.

The critical issue is that sometimes (seldom) the nRF8001 doesn't advertise at all, it is like its radio is turned off and, as you can imagine, my MCU stays sleeping forever.

I've separated two log snippets, one that the nRF8001 is actually advertising (after sending the response command event with success) and another that is not.

log 1 - nRF8001 is advertising after connect command

MCU wakes up
[16:56:26:926] C1 :01, 0B,
[16:56:26:927] E15 :0F, 85, 01, 37, 49, 8C, 6A, 78, 40, 27, 00, 00, 00, D0, 07, 05,
[16:56:26:927] 1 :01, 09, ed
[16:56:26:929] E17 :11, 88, FD, 66, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00,
[16:56:26:929] Evt Pipe Status
[16:56:26:930] E5 :05, 84, 0B, 00, FB, 02,
[16:56:26:930] E12 :0C, 84, 09, 00, 41, 00, 02, 03, 00, 00, 00, 00, 00,
[16:56:26:931] C11 :0B, 0D, 02, 41, 00, 02, 03, 00, 00, 00, 00, 00,
[16:56:26:931] E3 :03, 84, 0D, 00,
[16:56:27:001] E17 :11, 88, FD, 6E, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00,
[16:56:27:001] Evt Pipe Status
[16:56:27:001] C1 :01, 13,
[16:56:27:001] E3 :03, 84, 13, 00,
[16:56:31:295] E7 :07, 89, 27, 00, 00, 00, 14, 00,
[16:56:31:295] Evt link connection interval changed
[16:56:31:296] C8 :08, 0D, 0E, 27, 00, 00, 00, 14, 00,
[16:56:31:296] E3 :03, 84, 0D, 00,
[16:56:33:684] E3 :03, 86, 03, 08,
[16:56:33:684] Evt Disconnected/Advertising timed out
[16:56:33:685] C5 :05, 0F, 00, 00, 50, 00,
[16:56:33:685] E3 :03, 84, 0F, 00,
[16:56:33:686] Advertising started. Tap Connect on the Access Controller UART app
[16:56:34:052] SLEEP MODE.
[16:56:34:052] WWDT Disabled

log 2 - nRF8001 is NOT advertising after connect command

[16:56:42:954] C1 :01, 0B,
[16:56:42:955] E15 :0F, 85, 01, 37, 49, 8C, 6A, 78, 40, 27, 00, 00, 00, D0, 07, 05,
[16:56:42:955] 1 :01, 09, ed
[16:56:42:956] E17 :11, 88, FD, 66, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00,
[16:56:42:957] Evt Pipe Status
[16:56:42:957] E5 :05, 84, 0B, 00, FB, 02,
[16:56:42:958] E12 :0C, 84, 09, 00, 41, 00, 02, 03, 00, 00, 00, 00, 00,
[16:56:42:958] C11 :0B, 0D, 02, 41, 00, 02, 03, 00, 00, 00, 00, 00,
[16:56:42:958] E3 :03, 84, 0D, 00,
[16:56:42:997] E17 :11, 88, FD, 6E, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00,
[16:56:42:998] Evt Pipe Status
[16:56:42:998] C1 :01, 13,
[16:56:42:998] E3 :03, 84, 13, 00,
[16:56:46:555] E3 :03, 86, 03, 13,
[16:56:46:556] Evt Disconnected/Advertising timed out
[16:56:46:556] C5 :05, 0F, 00, 00, 50, 00,
[16:56:46:556] E3 :03, 84, 0F, 00,
[16:56:46:557] Advertising started. Tap Connect on the Access Controller UART app
[16:56:46:908] SLEEP MODE.
[16:56:46:910] WWDT Disabled

The difference between them are only a few commands/events changed by the ACI and nRF8001 (shown below for reference):
[16:56:31:295] E7 :07, 89, 27, 00, 00, 00, 14, 00,
[16:56:31:295] Evt link connection interval changed
[16:56:31:296] C8 :08, 0D, 0E, 27, 00, 00, 00, 14, 00,
[16:56:31:296] E3 :03, 84, 0D, 00,

Just a Connection interval event and a set local data command after that (with the respective response).

Apart from that the only thing different is the disconnection reason:

0x08 timeout for the first one 
0x13 - Remote User Terminated Connection for the second one

This is critical for us, do you guys have any clue about that or is nRF8001 just not reliable enough?

Best Regards,


  • The nRF8001 is reliable in what it is specified to do within the operating spec. This appears within what the nRF8001 is specified to do.

    1. Can you post an SPI trace in addition to see if the RDYN line is behaving as expected.

    2. I assume that you are not setting up the GATT table to be encrypted in the nRFgo studio settings file. Can you confirm this ?

    3. Can you provide the IC markings on the nRF8001 ?

    The only known issue is, after a wakeup of the nRF8001, the nRF8001 needs to wait ~300ms (worst case) to send the connect command, otherwise the start of advertising can get delayed. However you do not seem to be having the same issue.

    1. Can you test by adding a similar delay (~300 ms) from the previous command/event before the "ACI Connect" command is sent

    2. Do you have a sniffer or similar infrastructure to verify that the nRF8001 is indeed advertising or not.

  • Hi David, Please check the answers below:

    1. I don't have a SPI trace but the RDYN line is behaving as expected, since during the problem it stayed HIGH (no incoming events).
    2. I actually doesn't know how to encrypt the GATT table, so I guess I am not doing it. Actually i just changed (slight ones) based on the nordic UART example.
    3. NRF D 8001 1408PW

    Regarding the sleep issue. Your assumption is correct, since I didn't put nRF8001 into sleep mode when or before the issue happened.

    1. I'll test, but the problem is that the issue is not easy to replicate, it happened only three times during 3 months of developing/testing.
    2. I'm using my android cellphone (nordic apps), but it's pretty much accurate since after a reset the nRF8001 I was able to scan it once again.
  • I think the 300ms delay is the closest to what you may be seeing. An SPI trace is essential to help you, so we have a more controlled environment as compared to the android phone.

    You should have a bit of control of the testing, the SPI trace will help you automate this.

    Suggestion: Keep the REQN line low for 300ms every time the ACI connect is sent and see if the issue occurs.

    Additional suggestion to see if the advertising is running: Turn on the ACTIVE line using the nRF8001 settings so if the advertising is successfully running you will see the ACTIVE line changing state.

    However you definitely need to get control of the test to progress the case.

  • Thanks David, We are still finishing our test cases and the only way to try to replicate this issue is with several connects and disconnects from the peer device. A SPI trace would be tracking the SPI data, clock, REQN and RDYN pin? Regarding the suggestions we will proceed with the reading of the ACTIVE pin, since keeping the REQN line low would create some unexpected behavior from nRF8001, since it will also lower RDYN pin and expect a change of data in the SPI lines.

Related