Hi,

I've spent some time trying to get nRF52832 DK running the 'blehci' code 
communicating with Xubuntu 16.10 (under VMware) with not much luck. 

I'm currently running the following development setup:

$ git status
On branch develop
Your branch is up-to-date with 'origin/develop'.

$ go version
go version go1.6.3 linux/amd64

$ newt version
Apache Newt (incubating) version: 1.0.0-dev

$ newt target show
targets/blink_nordic
    app=apps/blinky
    bsp=@apache-mynewt-core/hw/bsp/nrf52dk
    build_profile=debug
targets/my_blinky_sim
    app=apps/blinky
    bsp=@apache-mynewt-core/hw/bsp/native
    build_profile=debug
targets/nina_blinky
    app=apps/blinky
    bsp=@apache-mynewt-core/hw/bsp/nina-b1
    build_profile=optimized
targets/nina_hci
    app=@apache-mynewt-core/apps/blehci
    bsp=@apache-mynewt-core/hw/bsp/nina-b1
    build_profile=optimized
targets/nrf52_boot
    app=@apache-mynewt-core/apps/boot
    bsp=@apache-mynewt-core/hw/bsp/nrf52dk
    build_profile=optimized

The 'hw/bsp/nina-b1' is a custom nRF52832 board port based on the ublox 
NINA-B112 module and has following pin usage:

Function        Pin      NINA-B1    Schematic   Comment
=========  ====  =======  ========  ==================
UART_RXD   P0.05  GPIO_23   BT-RXD
UART_TXD   P0.06  GPIO_22   BT-TXD
UART_RTS    P0.31  GPIO_20  n/c                  Not connected!
UART_CTS    P0.07  GPIO_21  GND               Not recommended!
RED_STS       P0.08  GPIO_1     TP2                 bsp.h: LED_BLINK_PIN
GRN_STS      P0.11  GPIO_2     TP3                 bsp.h: LED_2

NOTE I've also done these test on the nRF52832 DK and get the same results.

When I run the target 'nina_hci' the board transmits a packet on reset power up 
as follows:
04 0E 03 01 00 00
According to the Core_V4.0 spec I think this decodes into HCI event code = 0x0E 
which is "Command Complete"

For debugging I have a Logic Pro 8 setup for capturing serial communications 
and have determined that the baud rate is at 1000000.

With the Linux host I get the following terminal results:

Terminal #1 shows that the BlueZ stack managed to decode the same HCI event 
(NOP) that I did manually:
$ sudo btmon
[sudo] password for alan: 
Bluetooth monitor ver 5.41
= Note: Linux version 4.8.0-34-generic (x86_64)                        0.977791
= Note: Bluetooth subsystem version 2.21                               0.977792
= New Index: 00:00:00:00:00:00 (Primary,UART,hci0)            [hci0] 121.060311
= Open Index: 00:00:00:00:00:00                               [hci0] 121.066478
< HCI Command: Reset (0x03|0x0003) plen 0                     [hci0] 121.070996
= bluetoothd: Bluetooth daemon 5.41                                  121.092783
= bluetoothd: Starting SDP server                                    121.104354
= bluetoothd: Bluetooth management interface 1.13 initialized        121.112600
> HCI Event: Command Complete (0x0e) plen 3                   [hci0] 126.168513
      NOP (0x00|0x0000) ncmd 1
= Close Index: 00:00:00:00:00:00                              [hci0] 131.246188

Terminal #2 shows that the ttyUSB0 device was attached and using the baud rate 
the LP8 decoded:
$ sudo btattach -B /dev/ttyUSB0 -S 1000000
[sudo] password for alan: 
Attaching BR/EDR controller to /dev/ttyUSB0
Switched line discipline from 0 to 15
Device index 0 attached

Terminal #3 shows that the hci0 connection index gets closed too quickly for me 
to assign a static address:
$ sudo btmgmt --index 0
[sudo] password for alan: 
[hci0]# static-addr cc:11:11:11:11:11
Set static address failed with status 0x11 (Invalid Index)

It seems like the timing between these user actions is very important, so has 
anyone been able to get this HCI example to operate manually like the tutorial 
indicates? 
Any suggestions on how I can get this test to work?

ALan

Reply via email to