Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

pca10028 disconnects immediately when trying to connect using ble_app_uart

Can anyone tell me if there is a specific problem on the nFR 51 using the 12.3 DK, where a disconnect is seen when it connects? I'm using Android Lolipop 5.0 on a BLU device. I see the disconnect immediately after selecting the nordic device in the selection dropdown, so it does see the device.

I have read that the 51 had problems, and it wasn't clear if the 52 also has the same problem, or if this is similar with a timeout not being set at the start?

The project I'm working on will use the 52 and I'm thinking of just buying one, but before I do I wanted to find out if this is a common problem with 51 and 52 devices? Isolated to 51? Neither, an error in the ble_app_uart example?

I'm going to get the sniffer setup tonight and see what I see, but I'm using Linux so it requires some jumping through a couple hoops to get the nRF sniffer going...:(

Any help would be appreciated. Eventually I need to get a 52 board, but was trying to use this until the firmware iscomplete, that will be based around your 52 chipset. I'm not doing that portion, I'm on the software side.

The firmware engineer is on vacation, so I'm trying to get going in the meantime. AFAIK, I have the example built and flashed properly to the pca10028 device I'm using.

I'm attempting to use the UART profile with 32 bytes of data.

Compiler:
arm-none-eabi-gcc (GNU Tools for Arm Embedded Processors 7-2018-q2-update) 7.3.1 20180622 (release) [ARM/embedded-7-branch revision 261907]

flash:
[aland@eagle armgcc]$ pwd
/home/aland/src/nRF5_12.3.0/examples/ble_peripheral/ble_app_uart/pca10028/s130/armgcc
[aland@eagle armgcc]$ make flash
Flashing: _build/nrf51422_xxac.hex
nrfjprog --program _build/nrf51422_xxac.hex -f nrf51 --sectorerase
Parsing hex file.
Erasing page at address 0x1B000.
Erasing page at address 0x1B400.
Erasing page at address 0x1B800.
Erasing page at address 0x1BC00.
Erasing page at address 0x1C000.
Erasing page at address 0x1C400.
Erasing page at address 0x1C800.
Erasing page at address 0x1CC00.
Erasing page at address 0x1D000.
Erasing page at address 0x1D400.
Erasing page at address 0x1D800.
Erasing page at address 0x1DC00.
Erasing page at address 0x1E000.
Erasing page at address 0x1E400.
Erasing page at address 0x1E800.
Erasing page at address 0x1EC00.
Erasing page at address 0x1F000.
Erasing page at address 0x1F400.
Erasing page at address 0x1F800.
Erasing page at address 0x1FC00.
Erasing page at address 0x20000.
Erasing page at address 0x20400.
Erasing page at address 0x20800.
Applying system reset.
Checking that the area to write is not protected.
Programming device.
nrfjprog --reset -f nrf51
Applying system reset.
Run.

OS:
Ubuntu 18.04 (bionic beaver)

Alan

Parents Reply Children
  • I'm not sure what happened but I replied a couple days ago and don't see it here now...hmmm...

    Anyway, Edvin, I got the 52 but see the same thing...I suspect I should try with a different version of Android, but wanted to get your thoughts?

    I'm using Lolipop 5.0.

    I'm only using nRF Logger so far, but will get the nRF Sniffer setup.


    nRF Logger Output

    --------------------------

    nRF Connect, 2018-08-09
    No name (30:90:3F:2E:2C:67)
    V 15:36:21.248 Connecting to 30:90:3F:2E:2C:67...
    D 15:36:21.249 gatt = device.connectGatt(autoConnect = false, TRANSPORT_LE) (hidden)
    V 15:36:39.933 Cancelling connection...
    D 15:36:39.933 gatt.disconnect()
    I 15:36:39.937 Disconnected
    D 15:36:39.951 [Callback] Connection state changed with status: 0 and new state: DISCONNECTED (0)
    D 15:36:39.958 gatt.refresh() (hidden)
    D 15:36:41.286 [Callback] Connection state changed with status: 0 and new state: DISCONNECTED (0)
    D 15:36:41.289 gatt.refresh() (hidden)
    D 15:37:33.377 gatt.close()
    D 15:37:33.379 wait(200)
  • What softdevice do you use with the nRF52?

    A sniffer trace would be helpful. Now that you have 2 Developemnt Kits (I assume), you can use the nRF51 as a sniffer device with the nRF Sniffer.

    What SDK and example do you run?

    Can you try to print the disconnect reason?

    It should be in the disconnected event. Depending on what SDK you use, it would look a bit different, but something like this:

    case BLE_GAP_EVT_DISCONNECTED
        NRF_LOG_INFO("Disconnected");
        break;
        
    // change to:
    
    case BLE_GAP_EVT_DISCONNECTED
        NRF_LOG_INFO("Disconnected, reason 0x%02x", p_ble_evt->evt.gap_evt.params.disconnected.reason);
        break;

    And see if you can see the disconnect reason.

    But please specify what SDK you use with the nRF52. Can you try to run one of the unmodified examples from one of the later examples? E.g. SDK15\examples\ble_peripheral\ble_app_uart

     

    Best regards,

    Edvin

  • Edvin,

    I believe the SD is s132 per the project. I'm using the pca10056 directory and it looks like it has s132 inside of it. Is that correct?

    I do have a 51, but unfortunately the micro-usb connector came loose from the circuit board. I will have access to another 52 when my colleague gets back from vacation. I think he can fix this one also, but I don't want to try to solder it as my equipment is not nearly as good as his stuff. I think he's coming back this week.

    Trying various apps, nRF Connect is one, I think I should see it and be able to connect.

    This might be a dumb question, but how do I determine the ID on my 52 DK? Maybe I'm trying to connect to the wrong device.

    I really only need to get packets across onto the Android device. I think I might be connecting to the wrong device or not seeing it. How can I get all the info from the 52 DK?

    Alan

  • Do you know what chip is on the nRF52DK that you have? It should say on the chip. either N52832 or N52840.

    If you have the nRF52832 you should use the S132 softdevice. If you have the nRF52840 you should use the S140 softdevice.

    You should also use the correct projects for your board.

    the nRF52832 DK is PCA10040, and the nRF52840 DK is PCA10056 (It says on the white sticker on the programming chip on your DK).

    The project folder PCA10056 has a subfolder called s140, not s132. 

    You should be able to find the correct device using nRF Connect. You can see the RSSI, which is a negative number indicating the signal strength. The higher the number (closer to 0), the closer the device is. So if it is reasonably close, you should see only one device with RSSI  >-30.

     

    Some phones tend to store the device name of BLE devices. If they do, they may display an old name (from another project), so the displayed name might reflect a previous application on the chip. Other than that, it shouldn't cause any problems.

     

    I suggest that if you want to get things up and running, try the following example:

    if nRF52832:

    SDK15.0.0\examples\ble_peripheral\ble_app_uart\pca10040\s132\...

    if nRF52840:

    SDK15.0.0\examples\ble_peripheral\ble_app_uart\pca10056\s140\...

     

    Also remember to program the softdevice first, located in:

    SDK15.0.0\components\softdevice\s1[32/40]\hex

     

    Best regards,

    Edvin

  • Ok, I have the SDK 15.0.0, but my directory is different and I only have an s140, but I built that and flashed the device.

    I don't seem to see the device in nRF Connect, shouldn't I?

    I see my Apple iPhone and I see the Google device on the Blu Studio C phone.

    Not sure if I lost a reply or not. I had the 12.3 SDK loaded as you mentioned this was fixed in SD 130, and there was SD 132 on the 12.3 SDK in the ble_app_uart directory uder armgcc. Possibly you're using a different compiler.

    I upgraded to the 15.0.0 SDK and only have the s140 inside:

    examples/ble_peripheral/ble_app_uart/pca10056/s140/armgcc

    I don't see any other s140 in any of the other directories under the ble_app_uart other than pca10056, and that is the device I have.

    Do I need something other than nRF Connect to see and connect to the 52840?

    Cheers,

    Alan

Related