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
  • 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)
  • 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

  • Edvin,

    I'm trying this one also:

    nRF5-15/examples/connectivity/ble_connectivity/pca10056/ser_s140_uart/armgcc

    Shouldn't I see the device in nRF Connect?

    Alan

  • Edvin,

    I should also add, I flashed the ble_app_blinky to the 52840 and nRF Blinky doesn't see the device either. Is there some setting on the device I need to change?

    Alan

Reply Children
  • Hello Alan.

    If there is no pca10040 folder then you must have deleted it. It is included in the SDK. But if you have the nRF52840 DK, then it shouldn't be a problem.

    If you want to test whether your DK is working, just erase everything on it, using either nrfjprog or nRFgo Studio. Then try to flash the file found in:

    SDK15.0.0\examples\ble_peripheral\ble_app_hrs\hex\ble_app_hrs_pca10056_s140.hex

    Only this one, no softdevice. The softdevice is also included in this .hex-file.

     

    Do you then see that LED1 starts blinking`and do you see the device in nRF Connect?

     

    BR,

    Edvin

  • Edvin,

    I did not delete anything. I am using the command line on linux and I thinik I would know if I used the rm -f command...:-/

    I just flashed again, I see 4 LED lights blinking in progression. This appears to erase the sectors on the device. Am I required to erase that separately? See nrfjprog command when it programs, it passes in --sectorerase. Wouldn't that ensure the device is clean? I have nrfjprog in my environment.

    The LEDs were blinking property when I flashed the device.

    Flash:

    [aland@eagle armgcc]$ pwd
    /home/aland/src/nRF5-15/examples/connectivity/ble_connectivity/pca10056/ser_s140_uart/armgcc
    [aland@eagle armgcc]$ make flash
    Flashing: _build/nrf52840_xxaa.hex
    nrfjprog -f nrf52 --program _build/nrf52840_xxaa.hex --sectorerase
    Parsing hex file.
    Erasing page at address 0x26000.
    Erasing page at address 0x27000.
    Erasing page at address 0x28000.
    Erasing page at address 0x29000.
    Erasing page at address 0x2A000.
    Erasing page at address 0x2B000.
    Erasing page at address 0x2C000.
    Erasing page at address 0x2D000.
    Erasing page at address 0x2E000.
    Erasing page at address 0x2F000.
    Erasing page at address 0x30000.
    Erasing page at address 0x31000.
    Applying system reset.
    Checking that the area to write is not protected.
    Programming device.
    nrfjprog -f nrf52 --reset
    Applying system reset.
    Run.
    [aland@eagle armgcc]$

    Why don't I see the device in the nRF Blinky app? I installed that from the Google Play.

    Why do I see both the iPhone and BLU phone, but not the nRF52840??? I get the "CAN'T SEE YOUR BLINKY?" dialog.

    EDIT: I erased the device with nrfjprog -e and then it seemed dead, so I went into the following directory:

    /home/aland/src/nRF5-15/examples/peripheral/blinky/pca10056/blank

    This got the LEDs to blink, then I once again flashed the ble_app_uart:

    /home/aland/src/nRF5-15/examples/ble_peripheral/ble_app_uart/pca10056/s140/armgcc

    I saw the LEDs go out and then after it reset they started again, so it seemed it flashed.

    Why don't I see the device in any of the nRF apps? There must be something wrong on the board??? It doesn't seem to be broadcasting it's bluetooth...

    I need to get some sleep, will check back after I wake up.

    Alan

  • Did you try the .hex file that I told you to test? 

    The reason that the file that you are trying to flash doesn't work is because it is a serialization application. It is not what you are looking for.

  • Edvin,

    [aland@eagle hex]$ pwd
    /home/aland/src/nRF5-15/examples/ble_peripheral/ble_app_hrs/hex
    [aland@eagle hex]$ nrfjprog -f nrf52 --program ./ble_app_hrs_pca10056_s140.hex --sectorerase
    Parsing hex file.
    Erasing page at address 0x0.
    Erasing page at address 0x1000.
    Erasing page at address 0x2000.
    Erasing page at address 0x3000.
    Erasing page at address 0x4000.
    Erasing page at address 0x5000.
    Erasing page at address 0x6000.
    Erasing page at address 0x7000.
    Erasing page at address 0x8000.
    Erasing page at address 0x9000.
    Erasing page at address 0xA000.
    Erasing page at address 0xB000.
    Erasing page at address 0xC000.
    Erasing page at address 0xD000.
    Erasing page at address 0xE000.
    Erasing page at address 0xF000.
    Erasing page at address 0x10000.
    Erasing page at address 0x11000.
    Erasing page at address 0x12000.
    Erasing page at address 0x13000.
    Erasing page at address 0x14000.
    Erasing page at address 0x15000.
    Erasing page at address 0x16000.
    Erasing page at address 0x17000.
    Erasing page at address 0x18000.
    Erasing page at address 0x19000.
    Erasing page at address 0x1A000.
    Erasing page at address 0x1B000.
    Erasing page at address 0x1C000.
    Erasing page at address 0x1D000.
    Erasing page at address 0x1E000.
    Erasing page at address 0x1F000.
    Erasing page at address 0x20000.
    Erasing page at address 0x21000.
    Erasing page at address 0x22000.
    Erasing page at address 0x23000.
    Erasing page at address 0x24000.
    Erasing page at address 0x25000.
    Erasing page at address 0x26000.
    Erasing page at address 0x27000.
    Erasing page at address 0x28000.
    Erasing page at address 0x29000.
    Erasing page at address 0x2A000.
    Erasing page at address 0x2B000.
    Erasing page at address 0x2C000.
    Erasing page at address 0x2D000.
    Erasing page at address 0x2E000.
    Erasing page at address 0x2F000.
    Erasing page at address 0x30000.
    Applying system reset.
    Checking that the area to write is not protected.
    Programming device.
    [aland@eagle hex]$

    Still I get nothing in any of the nRF Apps...nRF Connect nRF...Blinky nRF Logger

    Why don't I see my bluetooth?

    After I flashed the above I have only one LED, to the bottom left of the PCA10056 chip, none of the other 4 LEDs light up, but still I see no bluetooth on my Android BLU device. hmmm...???

    EDIT: I think that flash is working correctly in that Button 1 turns the single flashing LED off, and pressing it again will turn the single flashing LED back on. By default it gets power from VDD. I also tried the USB and plugged another cable into the micro USB for the nRF.

    There are 2 sets of VDD nRF pins on the header next to the nRF Power Source switch. Do those have any effect? I will try to look up the reference, I didn't get much with my DK, I know you have the info online. I want to look at what Li-Pro is for the Power Source. This was on VDD by default. The VDD is typically the Video Display Device, AFAIK I'm not sure how that relates to the power source but guess that comes from the ARM Cortex.

    Also there's a covered switch next to the power switch that says VEXT->nRF. I'm curious what this switch does, but probably nothing I need.

    Still the $64k question, err...that would be 64,000 Euros to you, why don't I see the bluetooth device, but see both my iPhone and BLU phone? My BLU phone sees itself and 2 Apple device. Nothing else. Something is fundamentally wrong.

    Alan

  • Edvin,

    I should add that I tried to get the sniffer setup. Unfortunately I'm using Ubuntu 18.04 and the document here was written for 14.04. I run into a problem compiling the wireshark tarball I downloaded along with the plugin. Eventually it tells me that I get an error because the code is not compiled for PIC. I've seen this on my last job and resorted to recompiling all of QT with PIC to resolve it. I would hate to have to do that here because this 52840 is only being used to prototype this project, my colleague will be using the nRF 52 in the device.

    This will not be an easy resolve on 18.04, which I have on my desktop and laptop at the moment. I could probably install 14.04 if all this could compile and work with the sniffer. Please let me know if this is the case, as far as Nordic knows?

    Has anyone else seen the issue on PIC code, where the default QT libs are using PIE?

    The other piece that seems to be tripping me up, and this could be why is that by default 18.04 uses qt5, yet it seems the wireshark needs qt4. I tried to set that as the default on my system, but compiling wireshark is still trying to use qt5 when it is configured for qt4. This might related to PIC/PIE, not sure. I just know that the system QT libs do not have PIC on them and it's needed for most embedded devices.

    Alan

Related