Copying files to NuttX over serial (the slow way)

Some years ago I show it was possible to copy files to Linux over serial without using zmodem or other protocol: https://acassis.wordpress.com/2012/10/21/how-to-transfer-files-to-a-linux-embedded-system-over-serial/

Today I faced a similar issue, I need to copy a file from host computer to NuttX over serial without using zmodem support.

Then I created a simple 48 bytes file on Linux side and ran these commands on NuttX console (using minicom) :

NuttShell (NSH)                                                                                 
nsh> mount -t vfat /dev/sda /mnt                                
                                
nsh> dd if=/dev/console of=/mnt/test.txt bs=16 count=3                                         

Now on minicom type: Ctrl + A – Y to select a file to paste.

It worked fine, see:

nsh> ls -l /mnt
/mnt:
 -rw-rw-rw-      48 test.txt
nsh> 
nsh> cat /mnt/test.txt
This is a small test!
Just to prove the idea!!!

Now I decided to send a bigger file (4KiB) :

I used the COPYING file of NuttX, just cutting it to 4KiB:

$ sudo dd if=COPYING of=/COPYING bs=1 count=4096

Then on minicom:

nsh> dd if=/dev/console of=/mnt/COPYING bs=64 count=64                                          

Ctrl + A - Y

After selecting the file I noticed that the TXD LED on USB/Serial adapter was blinking at each 1 second. So after about 64 seconds it transfered the 4KiB file.

nsh> ls -l /mnt
/mnt:
 -rw-rw-rw-      48 test.txt
 -rw-rw-rw-    4096 COPYING

nsh> cat /mnt/COPYING
COPYING -- Describes the terms under which Nuttx is distributed. A
copy of the BSD-style licensing is included in this file. In my
words -- I believe that you should free to use NuttX in any
environment, private, private, commercial, open, closed, etc.
provided only that you repect the modest copyright notices as
...
uIP
^^^

Many lower-level networking components of NuttX derive from uIP which
has a similar BSD style

That is it! It is not the faster transfer solution but it proved to work.
I think this same approach should have worked on Linux at that time.

Advertisements

Using BOOST-CC2564MODA with bluez on Linux

I’m trying to get the CC2564MODA working with NuttX, then I decided to test it with Linux’s bluez first to guarantee it is working.

I used a CP2101 USB/Serial dongle, connected RXD to BUTX1, TXD to BURX1, CTS to BURT1, RTS to BUCT1.

Unfortunately the CC2564B will not work correctly if you don’t load a patch to fix its internal firmware. I download the file cc256xb_bt_sp_v1.6.zip from TI site extracted and copied it to:

$ sudo cp ~/CC2564/CC256XB_BT_SP/v1.6/initscripts-TIInit_6.7.16_ble_add-on.bts /lib/firmware/ti-connectivity/TIInit_6.7.16.bts

Next step is to use hciattach:

$ sudo hciattach -s 115200 /dev/ttyUSB0 texas 115200
Found a Texas Instruments' chip!
Firmware file : /lib/firmware/ti-connectivity/TIInit_6.7.16.bts
Loaded BTS script version 1
Device setup complete

Open a new linux terminal and run:

$  sudo btmon
Bluetooth monitor ver 5.37
= New Index: B0:B4:48:F4:A1:54 (BR/EDR,UART,hci1)               [hci1] 0.270465
= Open Index: B0:B4:48:F4:A1:54                                 [hci1] 0.270467
= Index Info: B0:B4:48:F4:A1:54 (Texas Instruments Inc.)        [hci1] 0.270467
= New Index: E0:06:E6:CF:FD:CE (BR/EDR,USB,hci0)                [hci0] 0.270468

Open another terminal and run:

$ sudo btmgmt --index 1

[hci1]# auto-power
Found controller with index 1

Note that I used “–index 1” instead “–index 0” because the BOOST-CC2564MODA was included as “hci1” (my laptop has Bluetooth internally).

Finally we can search for BLE devices:

[hci1]# find -l
Discovery started
hci1 type 6 discovering on
hci1 dev_found: BC:6A:29:AB:3F:46 type LE Public rssi -50 flags 0x0000 
AD flags 0x05 
eir_len 3
hci1 type 6 discovering off
[hci1]# 

Debugging NuttX BLE on BOOST-CC2564MODA board

I am testing the NuttX’s BLE on CC2564 but it is failing for some unknown reason:

ABCDF
hciuart_initialize: Initializing HCIUART3
hciuart_disableints: CR1 00000000 CR2 00000000
hciuart_instantiate: Instantiating HCIUART3
hciuart_configure: config 801d924
hciuart_line_configure: baud 115200
btuart_register: lower 801d924
bt_initialize: btdev 20007950
btuart_open: dev 20007950
hci_tx_kthread: started
hciuart_rxenable: config 801d924 enable 0 (non-DMA)
hciuart_disableints: CR1 0000200c CR2 00000300
hciuart_rxdrain: config 8013f7d
hciuart_copytorxbuffer: rxhead 0 rxtail 0 nbytes 0
hciuart_rxenable: config 801d924 enable 0 (non-DMA)
hciuart_disableints: CR1 0000200c CR2 00000300
hciuart_rxenable: config 801d924 enable 0 (non-DMA)
hciuart_disableints: CR1 0000200c CR2 00000300
hciuart_rxattach: config 801d924 callback 8013891 arg 20007950
hciuart_rxenable: config 801d924 enable 1 (non-DMA)
hciuart_enableints: CR1 0000202c CR2 00000301
bt_hci_cmd_create: opcode 0c03 param_len 0
bt_buf_alloc: buf 20002a40 type 0 reserve 1
bt_hci_cmd_create: buf 20002a40
bt_buf_extend: buf 20002a40 len 3
bt_hci_cmd_send: opcode 0c03 len 3
bt_hci_cmd_create: opcode 1003 param_len 0
hci_tx_kthread: Sending command 0c03 buf 20002a40 to driver
bt_buf_alloc: buf 20002a28 type 0 reserve 1
bt_buf_provide: buf 20002a40 len 1
bt_hci_cmd_crehciuart_interrupt: status 000000c0
hciuart_copytotxfifo: txhead 2 txtail 4 nbytes 1
hciuart_interrupt: status 000000c0
hciuart_copytotxfifo: txhead 4 txtail 4 nbytes 2
hciuart_disableints: CR1 0000202c CR2 00000301
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 0 rxtail 1 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 0 rxtail 2 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 0 rxtail 3 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 0 rxtail 4 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 0 rxtail 5 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 0 rxtail 6 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 0 rxtail 7 nbytes 1
hciuart_interrupt: status 000000c0
hciuart_interrupt: status 000000c0
ate: buf 20002a28
hciuart_write: config 801d924 buffer 20002760 buflen 4
bt_buf_extend: buf 20002a28 len 3
hciuart_disableints: CR1 0000202c CR2 00000301
bt_hci_cmd_send_sync: opcode 1003 len 3
hciuart_copytotxfifo: txhead 1 txtail 4 nbytes 1
hciuart_enableints: CR1 000020ac CR2 00000301
btuart_read: buflen 1 minread 0
hciuart_read: config 801d924 buffer 20005f2b buflen 1
hciuart_copytorxbuffer: rxhead 0 rxtail 7 nbytes 0
hciuart_rxenable: config 801d924 enable 0 (non-DMA)
hciuart_disableints: CR1 0000200c CR2 00000300
hciuart_copyfromrxbuffer: rxhead 1 rxtail 7 nbytes 1
hciuart_copytorxbuffer: rxhead 1 rxtail 7 nbytes 0
hciuart_rxenable: config 801d924 enable 1 (non-DMA)
hciuart_enableints: CR1 0000202c CR2 00000301
btuart_read: read 1 remaining 0
btuart_read: buflen 2 minread 2
hciuart_read: config 801d924 buffer 20005f2c buflen 2
hciuart_copytorxbuffer: rxhead 1 rxtail 7 nbytes 0
hciuart_rxenable: config 801d924 enable 0 (non-DMA)
hciuart_disableints: CR1 0000200c CR2 00000300
hciuart_copyfromrxbuffer: rxhead 3 rxtail 7 nbytes 2
hciuart_copytorxbuffer: rxhead 3 rxtail 7 nbytes 0
hciuart_rxenable: config 801d924 enable 1 (non-DMA)
hciuart_enableints: CR1 0000202c CR2 00000301
btuart_read: read 2 remaining 0
bt_buf_alloc: buf 20002a10 type 1 reserve 0
bt_buf_extend: buf 20002a10 len 2
btuart_evt_recv: hdrlen 4
btuart_rxwork: Need to get 4 bytes
btuart_read: buflen 4 minread 0
hciuart_read: config 801d924 buffer 2000265a buflen 4
hciuart_copytorxbuffer: rxhead 3 rxtail 7 nbytes 0
hciuart_rxenable: config 801d924 enable 0 (non-DMA)
hciuart_disableints: CR1 0000200c CR2 00000300
hciuart_copyfromrxbuffer: rxhead 7 rxtail 7 nbytes 4
hciuart_copytorxbuffer: rxhead 7 rxtail 7 nbytes 0
hciuart_rxenable: config 801d924 enable 1 (non-DMA)
hciuart_enableints: CR1 0000202c CR2 00000301
btuart_read: read 4 remaining 0
btuart_rxwork: Received 4 bytes
btuart_rxwork: Full packet received
hciuart_rxdrain: config 8013f7d
hciuart_copytorxbuffer: rxhead 7 rxtail 7 nbytes 0
hciuart_rxenable: config 801d924 enable 0 (non-DMA)
hciuart_disableints: CR1 0000200c CR2 00000300
hciuart_rxenable: config 801d924 enable 1 (non-DMA)
hciuart_enableints: CR1 0000202c CR2 00000301
bt_hci_receive: buf 20002a10 len 6
hci_rx_work: list 20002a5c
hci_rx_work: buf 20002a10 type 1 len 6
hci_event: event 14
bt_buf_consume: buf 20002a10 len 2
hci_cmd_complete: opcode 0c03
bt_buf_consume: buf 20002a10 len 3
hci_reset_complete: status 0
bt_buf_release: buf 20002a40 ref 1 type 0
bt_buf_release: Buffer freed: 20002a40
bt_buf_release: buf 20002a10 ref 1 type 1
hci_tx_kthread: Sending command 1003 buf 2hciuart_interrupt: status 000000c0
hciuart_copytotxfifo: txhead 6 txtail 8 nbytes 1
hciuart_interrupt: status 000000c0
hciuart_copytotxfifo: txhead 7 txtail 8 nbytes 1
hciuart_interrupt: status 000000c0
hciuart_copytotxfifo: txhead 8 txtail 8 nbytes 1
hciuart_disableints: CR1 0000202c CR2 00000301
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 7 rxtail 8 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 7 rxtail 9 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 7 rxtail 10 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 7 rxtail 11 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 7 rxtail 12 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 7 rxtail 13 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 7 rxtail 14 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 7 rxtail 15 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 7 rxtail 16 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 7 rxtail 17 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 7 rxtail 18 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 7 rxtail 19 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 7 rxtail 20 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 7 rxtail 21 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 7 rxtail 22 nbytes 1
hciuart_interrupt: status 000000c0
hciuart_interrupt: status 000000c0
0002a28 to driver
bt_buf_release: Buffer freed: 20002a10
bt_buf_provide: buf 20002a28 len 1
hciuart_write: config 801d924 buffer 20002708 buflen 4
hciuart_disableints: CR1 0000202c CR2 00000301
hciuart_copytotxfifo: txhead 5 txtail 8 nbytes 1
hciuart_enableints: CR1 000020ac CR2 00000301
btuart_read: buflen 1 minread 0
hciuart_read: config 801d924 buffer 20005f2b buflen 1
hciuart_copytorxbuffer: rxhead 7 rxtail 22 nbytes 0
hciuart_rxenable: config 801d924 enable 0 (non-DMA)
hciuart_disableints: CR1 0000200c CR2 00000300
hciuart_copyfromrxbuffer: rxhead 8 rxtail 22 nbytes 1
hciuart_copytorxbuffer: rxhead 8 rxtail 22 nbytes 0
hciuart_rxenable: config 801d924 enable 1 (non-DMA)
hciuart_enableints: CR1 0000202c CR2 00000301
btuart_read: read 1 remaining 0
btuart_read: buflen 2 minread 2
hciuart_read: config 801d924 buffer 20005f2c buflen 2
hciuart_copytorxbuffer: rxhead 8 rxtail 22 nbytes 0
hciuart_rxenable: config 801d924 enable 0 (non-DMA)
hciuart_disableints: CR1 0000200c CR2 00000300
hciuart_copyfromrxbuffer: rxhead 10 rxtail 22 nbytes 2
hciuart_copytorxbuffer: rxhead 10 rxtail 22 nbytes 0
hciuart_rxenable: config 801d924 enable 1 (non-DMA)
hciuart_enableints: CR1 0000202c CR2 00000301
btuart_read: read 2 remaining 0
bt_buf_alloc: buf 20002a10 type 1 reserve 0
bt_buf_extend: buf 20002a10 len 2
btuart_evt_recv: hdrlen 12
btuart_rxwork: Need to get 12 bytes
btuart_read: buflen 12 minread 0
hciuart_read: config 801d924 buffer 2000265a buflen 12
hciuart_copytorxbuffer: rxhead 10 rxtail 22 nbytes 0
hciuart_rxenable: config 801d924 enable 0 (non-DMA)
hciuart_disableints: CR1 0000200c CR2 00000300
hciuart_copyfromrxbuffer: rxhead 22 rxtail 22 nbytes 12
hciuart_copytorxbuffer: rxhead 22 rxtail 22 nbytes 0
hciuart_rxenable: config 801d924 enable 1 (non-DMA)
hciuart_enableints: CR1 0000202c CR2 00000301
btuart_read: read 12 remaining 0
btuart_rxwork: Received 12 bytes
btuart_rxwork: Full packet received
hciuart_rxdrain: config 8013f7d
hciuart_copytorxbuffer: rxhead 22 rxtail 22 nbytes 0
hciuart_rxenable: config 801d924 enable 0 (non-DMA)
hciuart_disableints: CR1 0000200c CR2 00000300
hciuart_rxenable: config 801d924 enable 1 (non-DMA)
hciuart_enableints: CR1 0000202c CR2 00000301
bt_hci_receive: buf 20002a10 len 14
hci_rx_work: list 20002a5c
hci_rx_work: buf 20002a10 type 1 len 14
hci_event: event 14
bt_buf_consume: buf 20002a10 len 2
hci_cmd_complete: opcode 1003
bt_buf_consume: buf 20002a10 len 3
hci_cmd_complete: Unhandled opcode 1003
bt_buf_addref: buf 20002a10 (old) ref 1 type 1
bt_buf_release: buf 20002a10 ref 2 type 1
bt_buf_release: buf 20002a28 ref 1 type 0
bt_buf_release: Remaining references: 1
bt_buf_release: Buffer freed: 20002a28
read_local_features_complete: status 0
bt_buf_release: buf 20002a10 ref 1 type 1
bt_buf_release: Buffer freed: 20002a10
bt_hci_cmd_create: opcode 1001 param_len 0
bt_buf_alloc: buf 20002a10 type 0 reserve 1
bt_hci_cmd_create: buf 20002a10
bt_buf_extend: buf 20002a10 len 3
bt_hci_cmd_send_sync: opcode 1001 len 3
hchciuart_interrupt: status 000000c0
hciuart_copytotxfifo: txhead 10 txtail 12 nbytes 1
hciuart_interrupt: status 000000c0
hciuart_copytotxfifo: txhead 11 txtail 12 nbytes 1
hciuart_interrupt: status 000000c0
hciuart_copytotxfifo: txhead 12 txtail 12 nbytes 1
hciuart_disableints: CR1 0000202c CR2 00000301
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 22 rxtail 23 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 22 rxtail 24 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 22 rxtail 25 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 22 rxtail 26 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 22 rxtail 27 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 22 rxtail 28 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 22 rxtail 29 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 22 rxtail 30 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 22 rxtail 31 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 22 rxtail 32 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 22 rxtail 33 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 22 rxtail 34 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 22 rxtail 35 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 22 rxtail 36 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 22 rxtail 37 nbytes 1
hciuart_interrupt: status 000000c0
hciuart_interrupt: status 000000c0
i_tx_kthread: Sending command 1001 buf 20002a10 to driver
bt_buf_provide: buf 20002a10 len 1
hciuart_write: config 801d924 buffer 20002658 buflen 4
hciuart_disableints: CR1 0000202c CR2 00000301
hciuart_copytotxfifo: txhead 9 txtail 12 nbytes 1
hciuart_enableints: CR1 000020ac CR2 00000301
btuart_read: buflen 1 minread 0
hciuart_read: config 801d924 buffer 20005f2b buflen 1
hciuart_copytorxbuffer: rxhead 22 rxtail 37 nbytes 0
hciuart_rxenable: config 801d924 enable 0 (non-DMA)
hciuart_disableints: CR1 0000200c CR2 00000300
hciuart_copyfromrxbuffer: rxhead 23 rxtail 37 nbytes 1
hciuart_copytorxbuffer: rxhead 23 rxtail 37 nbytes 0
hciuart_rxenable: config 801d924 enable 1 (non-DMA)
hciuart_enableints: CR1 0000202c CR2 00000301
btuart_read: read 1 remaining 0
btuart_read: buflen 2 minread 2
hciuart_read: config 801d924 buffer 20005f2c buflen 2
hciuart_copytorxbuffer: rxhead 23 rxtail 37 nbytes 0
hciuart_rxenable: config 801d924 enable 0 (non-DMA)
hciuart_disableints: CR1 0000200c CR2 00000300
hciuart_copyfromrxbuffer: rxhead 25 rxtail 37 nbytes 2
hciuart_copytorxbuffer: rxhead 25 rxtail 37 nbytes 0
hciuart_rxenable: config 801d924 enable 1 (non-DMA)
hciuart_enableints: CR1 0000202c CR2 00000301
btuart_read: read 2 remaining 0
bt_buf_alloc: buf 20002a28 type 1 reserve 0
bt_buf_extend: buf 20002a28 len 2
btuart_evt_recv: hdrlen 12
btuart_rxwork: Need to get 12 bytes
btuart_read: buflen 12 minread 0
hciuart_read: config 801d924 buffer 200026b2 buflen 12
hciuart_copytorxbuffer: rxhead 25 rxtail 37 nbytes 0
hciuart_rxenable: config 801d924 enable 0 (non-DMA)
hciuart_disableints: CR1 0000200c CR2 00000300
hciuart_copyfromrxbuffer: rxhead 37 rxtail 37 nbytes 12
hciuart_copytorxbuffer: rxhead 37 rxtail 37 nbytes 0
hciuart_rxenable: config 801d924 enable 1 (non-DMA)
hciuart_enableints: CR1 0000202c CR2 00000301
btuart_read: read 12 remaining 0
btuart_rxwork: Received 12 bytes
btuart_rxwork: Full packet received
hciuart_rxdrain: config 8013f7d
hciuart_copytorxbuffer: rxhead 37 rxtail 37 nbytes 0
hciuart_rxenable: config 801d924 enable 0 (non-DMA)
hciuart_disableints: CR1 0000200c CR2 00000300
hciuart_rxenable: config 801d924 enable 1 (non-DMA)
hciuart_enableints: CR1 0000202c CR2 00000301
bt_hci_receive: buf 20002a28 len 14
hci_rx_work: list 20002a5c
hci_rx_work: buf 20002a28 type 1 len 14
hci_event: event 14
bt_buf_consume: buf 20002a28 len 2
hci_cmd_complete: opcode 1001
bt_buf_consume: buf 20002a28 len 3
hci_cmd_complete: Unhandled opcode 1001
bt_buf_addref: buf 20002a28 (old) ref 1 type 1
bt_buf_release: buf 20002a28 ref 2 type 1
bt_buf_release: buf 20002a10 ref 1 type 0
bt_buf_release: Remaining references: 1
bt_buf_release: Buffer freed: 20002a10
read_local_ver_complete: status 0
bt_buf_release: buf 20002a28 ref 1 type 1
bt_buf_release: Buffer freed: 20002a28
bt_hci_cmd_create: opcode 1009 param_len 0
bt_buf_alloc: buf 20002a28 type 0 reserve 1
bt_hci_cmd_create: buf 20002a28
bt_buf_extend: buf 20002a28 len 3
bt_hci_cmd_send_sync: opcode 1009 len 3
hcihciuart_interrupt: status 000000c0
hciuart_copytotxfifo: txhead 14 txtail 16 nbytes 1
hciuart_interrupt: status 000000c0
hciuart_copytotxfifo: txhead 15 txtail 16 nbytes 1
hciuart_interrupt: status 000000c0
hciuart_copytotxfifo: txhead 16 txtail 16 nbytes 1
hciuart_disableints: CR1 0000202c CR2 00000301
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 37 rxtail 38 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 37 rxtail 39 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 37 rxtail 40 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 37 rxtail 41 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 37 rxtail 42 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 37 rxtail 43 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 37 rxtail 44 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 37 rxtail 45 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 37 rxtail 46 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 37 rxtail 47 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 37 rxtail 48 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 37 rxtail 49 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 37 rxtail 50 nbytes 1
hciuart_interrupt: status 000000c0
hciuart_interrupt: status 000000c0
_tx_kthread: Sending command 1009 buf 20002a28 to driver
bt_buf_provide: buf 20002a28 len 1
hciuart_write: config 801d924 buffer 200026b0 buflen 4
hciuart_disableints: CR1 0000202c CR2 00000301
hciuart_copytotxfifo: txhead 13 txtail 16 nbytes 1
hciuart_enableints: CR1 000020ac CR2 00000301
btuart_read: buflen 1 minread 0
hciuart_read: config 801d924 buffer 20005f2b buflen 1
hciuart_copytorxbuffer: rxhead 37 rxtail 50 nbytes 0
hciuart_rxenable: config 801d924 enable 0 (non-DMA)
hciuart_disableints: CR1 0000200c CR2 00000300
hciuart_copyfromrxbuffer: rxhead 38 rxtail 50 nbytes 1
hciuart_copytorxbuffer: rxhead 38 rxtail 50 nbytes 0
hciuart_rxenable: config 801d924 enable 1 (non-DMA)
hciuart_enableints: CR1 0000202c CR2 00000301
btuart_read: read 1 remaining 0
btuart_read: buflen 2 minread 2
hciuart_read: config 801d924 buffer 20005f2c buflen 2
hciuart_copytorxbuffer: rxhead 38 rxtail 50 nbytes 0
hciuart_rxenable: config 801d924 enable 0 (non-DMA)
hciuart_disableints: CR1 0000200c CR2 00000300
hciuart_copyfromrxbuffer: rxhead 40 rxtail 50 nbytes 2
hciuart_copytorxbuffer: rxhead 40 rxtail 50 nbytes 0
hciuart_rxenable: config 801d924 enable 1 (non-DMA)
hciuart_enableints: CR1 0000202c CR2 00000301
btuart_read: read 2 remaining 0
bt_buf_alloc: buf 20002a10 type 1 reserve 0
bt_buf_extend: buf 20002a10 len 2
btuart_evt_recv: hdrlen 10
btuart_rxwork: Need to get 10 bytes
btuart_read: buflen 10 minread 0
hciuart_read: config 801d924 buffer 2000270a buflen 10
hciuart_copytorxbuffer: rxhead 40 rxtail 50 nbytes 0
hciuart_rxenable: config 801d924 enable 0 (non-DMA)
hciuart_disableints: CR1 0000200c CR2 00000300
hciuart_copyfromrxbuffer: rxhead 50 rxtail 50 nbytes 10
hciuart_copytorxbuffer: rxhead 50 rxtail 50 nbytes 0
hciuart_rxenable: config 801d924 enable 1 (non-DMA)
hciuart_enableints: CR1 0000202c CR2 00000301
btuart_read: read 10 remaining 0
btuart_rxwork: Received 10 bytes
btuart_rxwork: Full packet received
hciuart_rxdrain: config 8013f7d
hciuart_copytorxbuffer: rxhead 50 rxtail 50 nbytes 0
hciuart_rxenable: config 801d924 enable 0 (non-DMA)
hciuart_disableints: CR1 0000200c CR2 00000300
hciuart_rxenable: config 801d924 enable 1 (non-DMA)
hciuart_enableints: CR1 0000202c CR2 00000301
bt_hci_receive: buf 20002a10 len 12
hci_rx_work: list 20002a5c
hci_rx_work: buf 20002a10 type 1 len 12
hci_event: event 14
bt_buf_consume: buf 20002a10 len 2
hci_cmd_complete: opcode 1009
bt_buf_consume: buf 20002a10 len 3
hci_cmd_complete: Unhandled opcode 1009
bt_buf_addref: buf 20002a10 (old) ref 1 type 1
bt_buf_release: buf 20002a10 ref 2 type 1
bt_buf_release: buf 20002a28 ref 1 type 0
bt_buf_release: Remaining references: 1
bt_buf_release: Buffer freed: 20002a28
read_bdaddr_complete: status 0
bt_buf_release: buf 20002a10 ref 1 type 1
bt_buf_release: Buffer freed: 20002a10
bt_hci_cmd_create: opcode 2003 param_len 0
bt_buf_alloc: buf 20002a10 type 0 reserve 1
bt_hci_cmd_create: buf 20002a10
bt_buf_extend: buf 20002a10 len 3
bt_hci_cmd_send_sync: opcode 2003 len 3
hcihciuart_interrupt: status 000000c0
hciuart_copytotxfifo: txhead 18 txtail 20 nbytes 1
hciuart_interrupt: status 000000c0
hciuart_copytotxfifo: txhead 19 txtail 20 nbytes 1
hciuart_interrupt: status 000000c0
hciuart_copytotxfifo: txhead 20 txtail 20 nbytes 1
hciuart_disableints: CR1 0000202c CR2 00000301
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 50 rxtail 51 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 50 rxtail 52 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 50 rxtail 53 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 50 rxtail 54 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 50 rxtail 55 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 50 rxtail 56 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 50 rxtail 57 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 50 rxtail 58 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 50 rxtail 59 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 50 rxtail 60 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 50 rxtail 61 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 50 rxtail 62 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 50 rxtail 63 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 50 rxtail 64 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 50 rxtail 65 nbytes 1
hciuart_interrupt: status 000000c0
hciuart_interrupt: status 000000c0
_tx_kthread: Sending command 2003 buf 20002a10 to driver
bt_buf_provide: buf 20002a10 len 1
hciuart_write: config 801d924 buffer 20002708 buflen 4
hciuart_disableints: CR1 0000202c CR2 00000301
hciuart_copytotxfifo: txhead 17 txtail 20 nbytes 1
hciuart_enableints: CR1 000020ac CR2 00000301
btuart_read: buflen 1 minread 0
hciuart_read: config 801d924 buffer 20005f2b buflen 1
hciuart_copytorxbuffer: rxhead 50 rxtail 65 nbytes 0
hciuart_rxenable: config 801d924 enable 0 (non-DMA)
hciuart_disableints: CR1 0000200c CR2 00000300
hciuart_copyfromrxbuffer: rxhead 51 rxtail 65 nbytes 1
hciuart_copytorxbuffer: rxhead 51 rxtail 65 nbytes 0
hciuart_rxenable: config 801d924 enable 1 (non-DMA)
hciuart_enableints: CR1 0000202c CR2 00000301
btuart_read: read 1 remaining 0
btuart_read: buflen 2 minread 2
hciuart_read: config 801d924 buffer 20005f2c buflen 2
hciuart_copytorxbuffer: rxhead 51 rxtail 65 nbytes 0
hciuart_rxenable: config 801d924 enable 0 (non-DMA)
hciuart_disableints: CR1 0000200c CR2 00000300
hciuart_copyfromrxbuffer: rxhead 53 rxtail 65 nbytes 2
hciuart_copytorxbuffer: rxhead 53 rxtail 65 nbytes 0
hciuart_rxenable: config 801d924 enable 1 (non-DMA)
hciuart_enableints: CR1 0000202c CR2 00000301
btuart_read: read 2 remaining 0
bt_buf_alloc: buf 20002a28 type 1 reserve 0
bt_buf_extend: buf 20002a28 len 2
btuart_evt_recv: hdrlen 12
btuart_rxwork: Need to get 12 bytes
btuart_read: buflen 12 minread 0
hciuart_read: config 801d924 buffer 2000265a buflen 12
hciuart_copytorxbuffer: rxhead 53 rxtail 65 nbytes 0
hciuart_rxenable: config 801d924 enable 0 (non-DMA)
hciuart_disableints: CR1 0000200c CR2 00000300
hciuart_copyfromrxbuffer: rxhead 65 rxtail 65 nbytes 12
hciuart_copytorxbuffer: rxhead 65 rxtail 65 nbytes 0
hciuart_rxenable: config 801d924 enable 1 (non-DMA)
hciuart_enableints: CR1 0000202c CR2 00000301
btuart_read: read 12 remaining 0
btuart_rxwork: Received 12 bytes
btuart_rxwork: Full packet received
hciuart_rxdrain: config 8013f7d
hciuart_copytorxbuffer: rxhead 65 rxtail 65 nbytes 0
hciuart_rxenable: config 801d924 enable 0 (non-DMA)
hciuart_disableints: CR1 0000200c CR2 00000300
hciuart_rxenable: config 801d924 enable 1 (non-DMA)
hciuart_enableints: CR1 0000202c CR2 00000301
bt_hci_receive: buf 20002a28 len 14
hci_rx_work: list 20002a5c
hci_rx_work: buf 20002a28 type 1 len 14
hci_event: event 14
bt_buf_consume: buf 20002a28 len 2
hci_cmd_complete: opcode 2003
bt_buf_consume: buf 20002a28 len 3
hci_cmd_complete: Unhandled opcode 2003
bt_buf_addref: buf 20002a28 (old) ref 1 type 1
bt_buf_release: buf 20002a28 ref 2 type 1
bt_buf_release: buf 20002a10 ref 1 type 0
bt_buf_release: Remaining references: 1
bt_buf_release: Buffer freed: 20002a10
read_le_features_complete: status 0
bt_buf_release: buf 20002a28 ref 1 type 1
bt_buf_release: Buffer freed: 20002a28
bt_hci_cmd_create: opcode 2002 param_len 0
bt_buf_alloc: buf 20002a28 type 0 reserve 1
bt_hci_cmd_create: buf 20002a28
bt_buf_extend: buf 20002a28 len 3
bt_hci_cmd_send_sync: opcode 2002 len 3
hcihciuart_interrupt: status 000000c0
hciuart_copytotxfifo: txhead 22 txtail 24 nbytes 1
hciuart_interrupt: status 000000c0
hciuart_copytotxfifo: txhead 23 txtail 24 nbytes 1
hciuart_interrupt: status 000000c0
hciuart_copytotxfifo: txhead 24 txtail 24 nbytes 1
hciuart_disableints: CR1 0000202c CR2 00000301
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 65 rxtail 66 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 65 rxtail 67 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 65 rxtail 68 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 65 rxtail 69 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 65 rxtail 70 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 65 rxtail 71 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 65 rxtail 72 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 65 rxtail 73 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 65 rxtail 74 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 65 rxtail 75 nbytes 1
hciuart_interrupt: status 000000c0
hciuart_interrupt: status 000000c0
_tx_kthread: Sending command 2002 buf 20002a28 to driver
bt_buf_provide: buf 20002a28 len 1
hciuart_write: config 801d924 buffer 20002658 buflen 4
hciuart_disableints: CR1 0000202c CR2 00000301
hciuart_copytotxfifo: txhead 21 txtail 24 nbytes 1
hciuart_enableints: CR1 000020ac CR2 00000301
btuart_read: buflen 1 minread 0
hciuart_read: config 801d924 buffer 20005f2b buflen 1
hciuart_copytorxbuffer: rxhead 65 rxtail 75 nbytes 0
hciuart_rxenable: config 801d924 enable 0 (non-DMA)
hciuart_disableints: CR1 0000200c CR2 00000300
hciuart_copyfromrxbuffer: rxhead 66 rxtail 75 nbytes 1
hciuart_copytorxbuffer: rxhead 66 rxtail 75 nbytes 0
hciuart_rxenable: config 801d924 enable 1 (non-DMA)
hciuart_enableints: CR1 0000202c CR2 00000301
btuart_read: read 1 remaining 0
btuart_read: buflen 2 minread 2
hciuart_read: config 801d924 buffer 20005f2c buflen 2
hciuart_copytorxbuffer: rxhead 66 rxtail 75 nbytes 0
hciuart_rxenable: config 801d924 enable 0 (non-DMA)
hciuart_disableints: CR1 0000200c CR2 00000300
hciuart_copyfromrxbuffer: rxhead 68 rxtail 75 nbytes 2
hciuart_copytorxbuffer: rxhead 68 rxtail 75 nbytes 0
hciuart_rxenable: config 801d924 enable 1 (non-DMA)
hciuart_enableints: CR1 0000202c CR2 00000301
btuart_read: read 2 remaining 0
bt_buf_alloc: buf 20002a10 type 1 reserve 0
bt_buf_extend: buf 20002a10 len 2
btuart_evt_recv: hdrlen 7
btuart_rxwork: Need to get 7 bytes
btuart_read: buflen 7 minread 0
hciuart_read: config 801d924 buffer 200026b2 buflen 7
hciuart_copytorxbuffer: rxhead 68 rxtail 75 nbytes 0
hciuart_rxenable: config 801d924 enable 0 (non-DMA)
hciuart_disableints: CR1 0000200c CR2 00000300
hciuart_copyfromrxbuffer: rxhead 75 rxtail 75 nbytes 7
hciuart_copytorxbuffer: rxhead 75 rxtail 75 nbytes 0
hciuart_rxenable: config 801d924 enable 1 (non-DMA)
hciuart_enableints: CR1 0000202c CR2 00000301
btuart_read: read 7 remaining 0
btuart_rxwork: Received 7 bytes
btuart_rxwork: Full packet received
hciuart_rxdrain: config 8013f7d
hciuart_copytorxbuffer: rxhead 75 rxtail 75 nbytes 0
hciuart_rxenable: config 801d924 enable 0 (non-DMA)
hciuart_disableints: CR1 0000200c CR2 00000300
hciuart_rxenable: config 801d924 enable 1 (non-DMA)
hciuart_enableints: CR1 0000202c CR2 00000301
bt_hci_receive: buf 20002a10 len 9
hci_rx_work: list 20002a5c
hci_rx_work: buf 20002a10 type 1 len 9
hci_event: event 14
bt_buf_consume: buf 20002a10 len 2
hci_cmd_complete: opcode 2002
bt_buf_consume: buf 20002a10 len 3
hci_cmd_complete: Unhandled opcode 2002
bt_buf_addref: buf 20002a10 (old) ref 1 type 1
bt_buf_release: buf 20002a10 ref 2 type 1
bt_buf_release: buf 20002a28 ref 1 type 0
bt_buf_release: Remaining references: 1
bt_buf_release: Buffer freed: 20002a28
le_read_buffer_size_complete: status 0
bt_buf_release: buf 20002a10 ref 1 type 1
bt_buf_release: Buffer freed: 20002a10
bt_hci_cmd_create: opcode 0c01 param_len 8
bt_buf_alloc: buf 20002a10 type 0 reserve 1
bt_hci_cmd_create: buf 20002a10
bt_buf_extend: buf 20002a10 len 3
bt_buf_extend: buf 20002a10 len 8
bt_hci_cmd_send_sync: opcode 0c01 len 11
hci_hciuart_interrupt: status 000000c0
hciuart_copytotxfifo: txhead 26 txtail 36 nbytes 1
hciuart_interrupt: status 000000c0
hciuart_copytotxfifo: txhead 27 txtail 36 nbytes 1
hciuart_interrupt: status 000000c0
hciuart_copytotxfifo: txhead 28 txtail 36 nbytes 1
hciuart_interrupt: status 000000c0
hciuart_copytotxfifo: txhead 29 txtail 36 nbytes 1
hciuart_interrupt: status 000000c0
hciuart_copytotxfifo: txhead 30 txtail 36 nbytes 1
hciuart_interrupt: status 000000c0
hciuart_copytotxfifo: txhead 31 txtail 36 nbytes 1
hciuart_interrupt: status 000000c0
hciuart_copytotxfifo: txhead 32 txtail 36 nbytes 1
hciuart_interrupt: status 000000c0
hciuart_copytotxfifo: txhead 33 txtail 36 nbytes 1
hciuart_interrupt: status 000000c0
hciuart_copytotxfifo: txhead 34 txtail 36 nbytes 1
hciuart_interrupt: status 000000c0
hciuart_copytotxfifo: txhead 35 txtail 36 nbytes 1
hciuart_interrupt: status 000000c0
hciuart_copytotxfifo: txhead 36 txtail 36 nbytes 1
hciuart_disableints: CR1 0000202c CR2 00000301
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 75 rxtail 76 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 75 rxtail 77 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 75 rxtail 78 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 75 rxtail 79 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 75 rxtail 0 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 75 rxtail 1 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 75 rxtail 2 nbytes 1
hciuart_interrupt: status 000000c0
hciuart_interrupt: status 000000c0
tx_kthread: Sending command 0c01 buf 20002a10 to driver
bt_buf_provide: buf 20002a10 len 1
hciuart_write: config 801d924 buffer 200026b0 buflen 12
hciuart_disableints: CR1 0000202c CR2 00000301
hciuart_copytotxfifo: txhead 25 txtail 36 nbytes 1
hciuart_enableints: CR1 000020ac CR2 00000301
btuart_read: buflen 1 minread 0
hciuart_read: config 801d924 buffer 20005f2b buflen 1
hciuart_copytorxbuffer: rxhead 75 rxtail 2 nbytes 0
hciuart_rxenable: config 801d924 enable 0 (non-DMA)
hciuart_disableints: CR1 0000200c CR2 00000300
hciuart_copyfromrxbuffer: rxhead 76 rxtail 2 nbytes 1
hciuart_copytorxbuffer: rxhead 76 rxtail 2 nbytes 0
hciuart_rxenable: config 801d924 enable 1 (non-DMA)
hciuart_enableints: CR1 0000202c CR2 00000301
btuart_read: read 1 remaining 0
btuart_read: buflen 2 minread 2
hciuart_read: config 801d924 buffer 20005f2c buflen 2
hciuart_copytorxbuffer: rxhead 76 rxtail 2 nbytes 0
hciuart_rxenable: config 801d924 enable 0 (non-DMA)
hciuart_disableints: CR1 0000200c CR2 00000300
hciuart_copyfromrxbuffer: rxhead 78 rxtail 2 nbytes 2
hciuart_copytorxbuffer: rxhead 78 rxtail 2 nbytes 0
hciuart_rxenable: config 801d924 enable 1 (non-DMA)
hciuart_enableints: CR1 0000202c CR2 00000301
btuart_read: read 2 remaining 0
bt_buf_alloc: buf 20002a28 type 1 reserve 0
bt_buf_extend: buf 20002a28 len 2
btuart_evt_recv: hdrlen 4
btuart_rxwork: Need to get 4 bytes
btuart_read: buflen 4 minread 0
hciuart_read: config 801d924 buffer 2000270a buflen 4
hciuart_copytorxbuffer: rxhead 78 rxtail 2 nbytes 0
hciuart_rxenable: config 801d924 enable 0 (non-DMA)
hciuart_disableints: CR1 0000200c CR2 00000300
hciuart_copyfromrxbuffer: rxhead 2 rxtail 2 nbytes 4
hciuart_copytorxbuffer: rxhead 2 rxtail 2 nbytes 0
hciuart_rxenable: config 801d924 enable 1 (non-DMA)
hciuart_enableints: CR1 0000202c CR2 00000301
btuart_read: read 4 remaining 0
btuart_rxwork: Received 4 bytes
btuart_rxwork: Full packet received
hciuart_rxdrain: config 8013f7d
hciuart_copytorxbuffer: rxhead 2 rxtail 2 nbytes 0
hciuart_rxenable: config 801d924 enable 0 (non-DMA)
hciuart_disableints: CR1 0000200c CR2 00000300
hciuart_rxenable: config 801d924 enable 1 (non-DMA)
hciuart_enableints: CR1 0000202c CR2 00000301
bt_hci_receive: buf 20002a28 len 6
hci_rx_work: list 20002a5c
hci_rx_work: buf 20002a28 type 1 len 6
hci_event: event 14
bt_buf_consume: buf 20002a28 len 2
hci_cmd_complete: opcode 0c01
bt_buf_consume: buf 20002a28 len 3
hci_cmd_complete: Unhandled opcode 0c01
bt_buf_addref: buf 20002a28 (old) ref 1 type 1
bt_buf_release: buf 20002a28 ref 2 type 1
bt_buf_release: buf 20002a28 ref 2 type 1
bt_buf_release: Remaining references: 1
bt_buf_release: Buffer freed: 20002a28
bt_buf_release: buf 20002a10 ref 1 type 0
bt_buf_release: Buffer freed: 20002a10
bt_hci_cmd_create: opcode 0c33 param_len 7
bt_buf_alloc: buf 20002a10 type 0 reserve 1
bt_hci_cmd_create: buf 20002a10
bt_buf_extend: buf 20002a10 len 3
bt_buf_extend: buf 20002a10 len 7
bt_hci_cmd_send: opcode 0c33 len 10
bt_hci_cmd_create: opcode 0c31 param_len 1
hci_tx_kthread: Sending command 0c33 buf 20002a10 to driver
bt_buf_alloc: buf 20002a28 type 0 reserve 1
bt_buf_provide: buf 20002a10 len 1
bt_hci_cmd_hciuart_interrupt: status 000000c0
hciuart_copytotxfifo: txhead 38 txtail 47 nbytes 1
hciuart_interrupt: status 000000c0
hciuart_copytotxfifo: txhead 39 txtail 47 nbytes 1
hciuart_interrupt: status 000000c0
hciuart_copytotxfifo: txhead 40 txtail 47 nbytes 1
hciuart_interrupt: status 000000c0
hciuart_copytotxfifo: txhead 41 txtail 47 nbytes 1
hciuart_interrupt: status 000000c0
hciuart_copytotxfifo: txhead 42 txtail 47 nbytes 1
hciuart_interrupt: status 000000c0
hciuart_copytotxfifo: txhead 43 txtail 47 nbytes 1
hciuart_interrupt: status 000000c0
hciuart_copytotxfifo: txhead 44 txtail 47 nbytes 1
hciuart_interrupt: status 000000c0
hciuart_copytotxfifo: txhead 45 txtail 47 nbytes 1
hciuart_interrupt: status 000000c0
hciuart_copytotxfifo: txhead 46 txtail 47 nbytes 1
hciuart_interrupt: status 000000c0
hciuart_copytotxfifo: txhead 47 txtail 47 nbytes 1
hciuart_disableints: CR1 0000202c CR2 00000301
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 2 rxtail 3 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 2 rxtail 4 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 2 rxtail 5 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 2 rxtail 6 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 2 rxtail 7 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 2 rxtail 8 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 2 rxtail 9 nbytes 1
hciuart_interrupt: status 000000c0
hciuart_interrupt: status 000000c0
create: buf 20002a28
hciuart_write: config 801d924 buffer 200026b0 buflen 11
bt_buf_extend: buf 20002a28 len 3
hciuart_disableints: CR1 0000202c CR2 00000301
bt_buf_extend: buf 20002a28 len 1
hciuart_copytotxfifo: txhead 37 txtail 47 nbytes 1
bt_hci_cmd_send_sync: opcode 0c31 len 4
btuart_read: buflen 1 minread 0
hciuart_enableints: CR1 000020ac CR2 00000301
hciuart_read: config 801d924 buffer 20005f2b buflen 1
hciuart_copytorxbuffer: rxhead 2 rxtail 9 nbytes 0
hciuart_rxenable: config 801d924 enable 0 (non-DMA)
hciuart_disableints: CR1 0000200c CR2 00000300
hciuart_copyfromrxbuffer: rxhead 3 rxtail 9 nbytes 1
hciuart_copytorxbuffer: rxhead 3 rxtail 9 nbytes 0
hciuart_rxenable: config 801d924 enable 1 (non-DMA)
hciuart_enableints: CR1 0000202c CR2 00000301
btuart_read: read 1 remaining 0
btuart_read: buflen 2 minread 2
hciuart_read: config 801d924 buffer 20005f2c buflen 2
hciuart_copytorxbuffer: rxhead 3 rxtail 9 nbytes 0
hciuart_rxenable: config 801d924 enable 0 (non-DMA)
hciuart_disableints: CR1 0000200c CR2 00000300
hciuart_copyfromrxbuffer: rxhead 5 rxtail 9 nbytes 2
hciuart_copytorxbuffer: rxhead 5 rxtail 9 nbytes 0
hciuart_rxenable: config 801d924 enable 1 (non-DMA)
hciuart_enableints: CR1 0000202c CR2 00000301
btuart_read: read 2 remaining 0
bt_buf_alloc: buf 20002a40 type 1 reserve 0
bt_buf_extend: buf 20002a40 len 2
btuart_evt_recv: hdrlen 4
btuart_rxwork: Need to get 4 bytes
btuart_read: buflen 4 minread 0
hciuart_read: config 801d924 buffer 20002602 buflen 4
hciuart_copytorxbuffer: rxhead 5 rxtail 9 nbytes 0
hciuart_rxenable: config 801d924 enable 0 (non-DMA)
hciuart_disableints: CR1 0000200c CR2 00000300
hciuart_copyfromrxbuffer: rxhead 9 rxtail 9 nbytes 4
hciuart_copytorxbuffer: rxhead 9 rxtail 9 nbytes 0
hciuart_rxenable: config 801d924 enable 1 (non-DMA)
hciuart_enableints: CR1 0000202c CR2 00000301
btuart_read: read 4 remaining 0
btuart_rxwork: Received 4 bytes
btuart_rxwork: Full packet received
hciuart_rxdrain: config 8013f7d
hciuart_copytorxbuffer: rxhead 9 rxtail 9 nbytes 0
hciuart_rxenable: config 801d924 enable 0 (non-DMA)
hciuart_disableints: CR1 0000200c CR2 00000300
hciuart_rxenable: config 801d924 enable 1 (non-DMA)
hciuart_enableints: CR1 0000202c CR2 00000301
bt_hci_receive: buf 20002a40 len 6
hci_rx_work: list 20002a5c
hci_rx_work: buf 20002a40 type 1 len 6
hci_event: event 14
bt_buf_consume: buf 20002a40 len 2
hci_cmd_complete: opcode 0c33
bt_buf_consume: buf 20002a40 len 3
hci_cmd_complete: Unhandled opcode 0c33
bt_buf_release: buf 20002a10 ref 1 type 0
bt_buf_release: Buffer freed: 20002a10
bt_buf_release: buf 20002a40 ref 1 type 1
hci_tx_kthread: Sending command 0c31 buf 200hciuart_interrupt: status 000000c0
hciuart_copytotxfifo: txhead 49 txtail 52 nbytes 1
hciuart_interrupt: status 000000c0
hciuart_copytotxfifo: txhead 50 txtail 52 nbytes 1
hciuart_interrupt: status 000000c0
hciuart_copytotxfifo: txhead 51 txtail 52 nbytes 1
hciuart_interrupt: status 000000c0
hciuart_copytotxfifo: txhead 52 txtail 52 nbytes 1
hciuart_disableints: CR1 0000202c CR2 00000301
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 9 rxtail 10 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 9 rxtail 11 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 9 rxtail 12 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 9 rxtail 13 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 9 rxtail 14 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 9 rxtail 15 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 9 rxtail 16 nbytes 1
hciuart_interrupt: status 000000c0
hciuart_interrupt: status 000000c0
02a28 to driver
bt_buf_release: Buffer freed: 20002a40
bt_buf_provide: buf 20002a28 len 1
hciuart_write: config 801d924 buffer 20002708 buflen 5
hciuart_disableints: CR1 0000202c CR2 00000301
hciuart_copytotxfifo: txhead 48 txtail 52 nbytes 1
hciuart_enableints: CR1 000020ac CR2 00000301
btuart_read: buflen 1 minread 0
hciuart_read: config 801d924 buffer 20005f2b buflen 1
hciuart_copytorxbuffer: rxhead 9 rxtail 16 nbytes 0
hciuart_rxenable: config 801d924 enable 0 (non-DMA)
hciuart_disableints: CR1 0000200c CR2 00000300
hciuart_copyfromrxbuffer: rxhead 10 rxtail 16 nbytes 1
hciuart_copytorxbuffer: rxhead 10 rxtail 16 nbytes 0
hciuart_rxenable: config 801d924 enable 1 (non-DMA)
hciuart_enableints: CR1 0000202c CR2 00000301
btuart_read: read 1 remaining 0
btuart_read: buflen 2 minread 2
hciuart_read: config 801d924 buffer 20005f2c buflen 2
hciuart_copytorxbuffer: rxhead 10 rxtail 16 nbytes 0
hciuart_rxenable: config 801d924 enable 0 (non-DMA)
hciuart_disableints: CR1 0000200c CR2 00000300
hciuart_copyfromrxbuffer: rxhead 12 rxtail 16 nbytes 2
hciuart_copytorxbuffer: rxhead 12 rxtail 16 nbytes 0
hciuart_rxenable: config 801d924 enable 1 (non-DMA)
hciuart_enableints: CR1 0000202c CR2 00000301
btuart_read: read 2 remaining 0
bt_buf_alloc: buf 20002a40 type 1 reserve 0
bt_buf_extend: buf 20002a40 len 2
btuart_evt_recv: hdrlen 4
btuart_rxwork: Need to get 4 bytes
btuart_read: buflen 4 minread 0
hciuart_read: config 801d924 buffer 20002602 buflen 4
hciuart_copytorxbuffer: rxhead 12 rxtail 16 nbytes 0
hciuart_rxenable: config 801d924 enable 0 (non-DMA)
hciuart_disableints: CR1 0000200c CR2 00000300
hciuart_copyfromrxbuffer: rxhead 16 rxtail 16 nbytes 4
hciuart_copytorxbuffer: rxhead 16 rxtail 16 nbytes 0
hciuart_rxenable: config 801d924 enable 1 (non-DMA)
hciuart_enableints: CR1 0000202c CR2 00000301
btuart_read: read 4 remaining 0
btuart_rxwork: Received 4 bytes
btuart_rxwork: Full packet received
hciuart_rxdrain: config 8013f7d
hciuart_copytorxbuffer: rxhead 16 rxtail 16 nbytes 0
hciuart_rxenable: config 801d924 enable 0 (non-DMA)
hciuart_disableints: CR1 0000200c CR2 00000300
hciuart_rxenable: config 801d924 enable 1 (non-DMA)
hciuart_enableints: CR1 0000202c CR2 00000301
bt_hci_receive: buf 20002a40 len 6
hci_rx_work: list 20002a5c
hci_rx_work: buf 20002a40 type 1 len 6
hci_event: event 14
bt_buf_consume: buf 20002a40 len 2
hci_cmd_complete: opcode 0c31
bt_buf_consume: buf 20002a40 len 3
hci_cmd_complete: Unhandled opcode 0c31
bt_buf_addref: buf 20002a40 (old) ref 1 type 1
bt_buf_release: buf 20002a40 ref 2 type 1
bt_buf_release: buf 20002a40 ref 2 type 1
bt_buf_release: Remaining references: 1
bt_buf_release: Buffer freed: 20002a40
bt_buf_release: buf 20002a28 ref 1 type 0
bt_buf_release: Buffer freed: 20002a28
bt_hci_cmd_create: opcode 0c6d param_len 2
bt_buf_alloc: buf 20002a28 type 0 reserve 1
bt_hci_cmd_create: buf 20002a28
bt_buf_extend: buf 20002a28 len 3
bt_buf_extend: buf 20002a28 len 2
bt_hci_cmd_send_sync: opcode 0c6d len 5
hcihciuart_interrupt: status 000000c0
hciuart_copytotxfifo: txhead 54 txtail 58 nbytes 1
hciuart_interrupt: status 000000c0
hciuart_copytotxfifo: txhead 55 txtail 58 nbytes 1
hciuart_interrupt: status 000000c0
hciuart_copytotxfifo: txhead 56 txtail 58 nbytes 1
hciuart_interrupt: status 000000c0
hciuart_copytotxfifo: txhead 57 txtail 58 nbytes 1
hciuart_interrupt: status 000000c0
hciuart_copytotxfifo: txhead 58 txtail 58 nbytes 1
hciuart_disableints: CR1 0000202c CR2 00000301
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 16 rxtail 17 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 16 rxtail 18 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 16 rxtail 19 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 16 rxtail 20 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 16 rxtail 21 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 16 rxtail 22 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 16 rxtail 23 nbytes 1
hciuart_interrupt: status 000000c0
hciuart_interrupt: status 000000c0
_tx_kthread: Sending command 0c6d buf 20002a28 to driver
bt_buf_provide: buf 20002a28 len 1
hciuart_write: config 801d924 buffer 20002708 buflen 6
hciuart_disableints: CR1 0000202c CR2 00000301
hciuart_copytotxfifo: txhead 53 txtail 58 nbytes 1
hciuart_enableints: CR1 000020ac CR2 00000301
btuart_read: buflen 1 minread 0
hciuart_read: config 801d924 buffer 20005f2b buflen 1
hciuart_copytorxbuffer: rxhead 16 rxtail 23 nbytes 0
hciuart_rxenable: config 801d924 enable 0 (non-DMA)
hciuart_disableints: CR1 0000200c CR2 00000300
hciuart_copyfromrxbuffer: rxhead 17 rxtail 23 nbytes 1
hciuart_copytorxbuffer: rxhead 17 rxtail 23 nbytes 0
hciuart_rxenable: config 801d924 enable 1 (non-DMA)
hciuart_enableints: CR1 0000202c CR2 00000301
btuart_read: read 1 remaining 0
btuart_read: buflen 2 minread 2
hciuart_read: config 801d924 buffer 20005f2c buflen 2
hciuart_copytorxbuffer: rxhead 17 rxtail 23 nbytes 0
hciuart_rxenable: config 801d924 enable 0 (non-DMA)
hciuart_disableints: CR1 0000200c CR2 00000300
hciuart_copyfromrxbuffer: rxhead 19 rxtail 23 nbytes 2
hciuart_copytorxbuffer: rxhead 19 rxtail 23 nbytes 0
hciuart_rxenable: config 801d924 enable 1 (non-DMA)
hciuart_enableints: CR1 0000202c CR2 00000301
btuart_read: read 2 remaining 0
bt_buf_alloc: buf 20002a40 type 1 reserve 0
bt_buf_extend: buf 20002a40 len 2
btuart_evt_recv: hdrlen 4
btuart_rxwork: Need to get 4 bytes
btuart_read: buflen 4 minread 0
hciuart_read: config 801d924 buffer 2000265a buflen 4
hciuart_copytorxbuffer: rxhead 19 rxtail 23 nbytes 0
hciuart_rxenable: config 801d924 enable 0 (non-DMA)
hciuart_disableints: CR1 0000200c CR2 00000300
hciuart_copyfromrxbuffer: rxhead 23 rxtail 23 nbytes 4
hciuart_copytorxbuffer: rxhead 23 rxtail 23 nbytes 0
hciuart_rxenable: config 801d924 enable 1 (non-DMA)
hciuart_enableints: CR1 0000202c CR2 00000301
btuart_read: read 4 remaining 0
btuart_rxwork: Received 4 bytes
btuart_rxwork: Full packet received
hciuart_rxdrain: config 8013f7d
hciuart_copytorxbuffer: rxhead 23 rxtail 23 nbytes 0
hciuart_rxenable: config 801d924 enable 0 (non-DMA)
hciuart_disableints: CR1 0000200c CR2 00000300
hciuart_rxenable: config 801d924 enable 1 (non-DMA)
hciuart_enableints: CR1 0000202c CR2 00000301
bt_hci_receive: buf 20002a40 len 6
hci_rx_work: list 20002a5c
hci_rx_work: buf 20002a40 type 1 len 6
hci_event: event 14
bt_buf_consume: buf 20002a40 len 2
hci_cmd_complete: opcode 0c6d
bt_buf_consume: buf 20002a40 len 3
hci_cmd_complete: Unhandled opcode 0c6d
hci_cmd_done: WARNING: status 17
bt_buf_release: buf 20002a40 ref 1 type 1
bt_hci_cmd_send_sync: ERROR:  Failed get return parameters
bt_buf_release: Buffer freed: 20002a40
bt_buf_release: buf 20002a28 ref 1 type 0
bt_buf_release: Buffer freed: 20002a28
hci_initialize: HCI ver 6 rev 0, manufacturer 13
hci_initialize: ACL buffers: pkts 15 mtu 27
bt_l2cap_chan_register: CID 0x0004
bt_l2cap_chan_register: CID 0x0006
bt_l2cap_chan_register: CID 0x0005

NuttShell (NSH)
nsh> bt bnep0 scan start
btnet_ioctl: cmd=133f arg=536908336l
btnet_ioctl: ifname: bnep0
bt_hci_cmd_create: opcode 200b param_len 7
bt_buf_alloc: buf 20002a28 type 0 reserve 1
bt_hci_cmd_create: buf 20002a28
bt_buf_extend: buf 20002a28 len 3
bt_buf_extend: buf 20002a28 len 7
bt_hci_cmd_send: opcode 200b len 10
bt_hci_cmd_create: opcode 200c param_len 2
hci_tx_kthread: Sending command 200b buf 20002a28 to driver
bt_buf_alloc: buf 20002a40 type 0 reserve 1
bt_buf_provide: buf 20002a28 len 1
bt_hci_cmd_hciuart_interrupt: status 000000c0
hciuart_copytotxfifo: txhead 60 txtail 69 nbytes 1
hciuart_interrupt: status 000000c0
hciuart_copytotxfifo: txhead 61 txtail 69 nbytes 1
hciuart_interrupt: status 000000c0
hciuart_copytotxfifo: txhead 62 txtail 69 nbytes 1
hciuart_interrupt: status 000000c0
hciuart_copytotxfifo: txhead 63 txtail 69 nbytes 1
hciuart_interrupt: status 000000c0
hciuart_copytotxfifo: txhead 64 txtail 69 nbytes 1
hciuart_interrupt: status 000000c0
hciuart_copytotxfifo: txhead 65 txtail 69 nbytes 1
hciuart_interrupt: status 000000c0
hciuart_copytotxfifo: txhead 66 txtail 69 nbytes 1
hciuart_interrupt: status 000000c0
hciuart_copytotxfifo: txhead 67 txtail 69 nbytes 1
hciuart_interrupt: status 000000c0
hciuart_copytotxfifo: txhead 68 txtail 69 nbytes 1
hciuart_interrupt: status 000000c0
hciuart_copytotxfifo: txhead 69 txtail 69 nbytes 1
hciuart_disableints: CR1 0000202c CR2 00000301
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 23 rxtail 24 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 23 rxtail 25 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 23 rxtail 26 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 23 rxtail 27 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 23 rxtail 28 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 23 rxtail 29 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 23 rxtail 30 nbytes 1
hciuart_interrupt: status 000000c0
hciuart_interrupt: status 000000c0
create: buf 20002a40
hciuart_write: config 801d924 buffer 20002708 buflen 11
bt_buf_extend: buf 20002a40 len 3
hciuart_disableints: CR1 0000202c CR2 00000301
bt_buf_extend: buf 20002a40 len 2
hciuart_copytotxfifo: txhead 59 txtail 69 nbytes 1
bt_hci_cmd_send_sync: opcode 200c len 5
btuart_read: buflen 1 minread 0
hciuart_enableints: CR1 000020ac CR2 00000301
hciuart_read: config 801d924 buffer 20005f2b buflen 1
hciuart_copytorxbuffer: rxhead 23 rxtail 30 nbytes 0
hciuart_rxenable: config 801d924 enable 0 (non-DMA)
hciuart_disableints: CR1 0000200c CR2 00000300
hciuart_copyfromrxbuffer: rxhead 24 rxtail 30 nbytes 1
hciuart_copytorxbuffer: rxhead 24 rxtail 30 nbytes 0
hciuart_rxenable: config 801d924 enable 1 (non-DMA)
hciuart_enableints: CR1 0000202c CR2 00000301
btuart_read: read 1 remaining 0
btuart_read: buflen 2 minread 2
hciuart_read: config 801d924 buffer 20005f2c buflen 2
hciuart_copytorxbuffer: rxhead 24 rxtail 30 nbytes 0
hciuart_rxenable: config 801d924 enable 0 (non-DMA)
hciuart_disableints: CR1 0000200c CR2 00000300
hciuart_copyfromrxbuffer: rxhead 26 rxtail 30 nbytes 2
hciuart_copytorxbuffer: rxhead 26 rxtail 30 nbytes 0
hciuart_rxenable: config 801d924 enable 1 (non-DMA)
hciuart_enableints: CR1 0000202c CR2 00000301
btuart_read: read 2 remaining 0
bt_buf_alloc: buf 20002a10 type 1 reserve 0
bt_buf_extend: buf 20002a10 len 2
btuart_evt_recv: hdrlen 4
btuart_rxwork: Need to get 4 bytes
btuart_read: buflen 4 minread 0
hciuart_read: config 801d924 buffer 20002762 buflen 4
hciuart_copytorxbuffer: rxhead 26 rxtail 30 nbytes 0
hciuart_rxenable: config 801d924 enable 0 (non-DMA)
hciuart_disableints: CR1 0000200c CR2 00000300
hciuart_copyfromrxbuffer: rxhead 30 rxtail 30 nbytes 4
hciuart_copytorxbuffer: rxhead 30 rxtail 30 nbytes 0
hciuart_rxenable: config 801d924 enable 1 (non-DMA)
hciuart_enableints: CR1 0000202c CR2 00000301
btuart_read: read 4 remaining 0
btuart_rxwork: Received 4 bytes
btuart_rxwork: Full packet received
hciuart_rxdrain: config 8013f7d
hciuart_copytorxbuffer: rxhead 30 rxtail 30 nbytes 0
hciuart_rxenable: config 801d924 enable 0 (non-DMA)
hciuart_disableints: CR1 0000200c CR2 00000300
hciuart_rxenable: config 801d924 enable 1 (non-DMA)
hciuart_enableints: CR1 0000202c CR2 00000301
bt_hci_receive: buf 20002a10 len 6
hci_rx_work: list 20002a5c
hci_rx_work: buf 20002a10 type 1 len 6
hci_event: event 14
bt_buf_consume: buf 20002a10 len 2
hci_cmd_complete: opcode 200b
bt_buf_consume: buf 20002a10 len 3
hci_cmd_complete: Unhandled opcode 200b
bt_buf_release: buf 20002a28 ref 1 type 0
bt_buf_release: Buffer freed: 20002a28
bt_buf_release: buf 20002a10 ref 1 type 1
hci_tx_kthread: Sending command 200c buf 200hciuart_interrupt: status 000000c0
hciuart_copytotxfifo: txhead 71 txtail 75 nbytes 1
hciuart_interrupt: status 000000c0
hciuart_copytotxfifo: txhead 72 txtail 75 nbytes 1
hciuart_interrupt: status 000000c0
hciuart_copytotxfifo: txhead 73 txtail 75 nbytes 1
hciuart_interrupt: status 000000c0
hciuart_copytotxfifo: txhead 74 txtail 75 nbytes 1
hciuart_interrupt: status 000000c0
hciuart_copytotxfifo: txhead 75 txtail 75 nbytes 1
hciuart_disableints: CR1 0000202c CR2 00000301
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 30 rxtail 31 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 30 rxtail 32 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 30 rxtail 33 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 30 rxtail 34 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 30 rxtail 35 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 30 rxtail 36 nbytes 1
hciuart_interrupt: status 000000f0
hciuart_copytorxbuffer: rxhead 30 rxtail 37 nbytes 1
hciuart_interrupt: status 000000c0
hciuart_interrupt: status 000000c0
02a40 to driver
bt_buf_release: Buffer freed: 20002a10
bt_buf_provide: buf 20002a40 len 1
hciuart_write: config 801d924 buffer 200026b0 buflen 6
hciuart_disableints: CR1 0000202c CR2 00000301
hciuart_copytotxfifo: txhead 70 txtail 75 nbytes 1
hciuart_enableints: CR1 000020ac CR2 00000301
btuart_read: buflen 1 minread 0
hciuart_read: config 801d924 buffer 20005f2b buflen 1
hciuart_copytorxbuffer: rxhead 30 rxtail 37 nbytes 0
hciuart_rxenable: config 801d924 enable 0 (non-DMA)
hciuart_disableints: CR1 0000200c CR2 00000300
hciuart_copyfromrxbuffer: rxhead 31 rxtail 37 nbytes 1
hciuart_copytorxbuffer: rxhead 31 rxtail 37 nbytes 0
hciuart_rxenable: config 801d924 enable 1 (non-DMA)
hciuart_enableints: CR1 0000202c CR2 00000301
btuart_read: read 1 remaining 0
btuart_read: buflen 2 minread 2
hciuart_read: config 801d924 buffer 20005f2c buflen 2
hciuart_copytorxbuffer: rxhead 31 rxtail 37 nbytes 0
hciuart_rxenable: config 801d924 enable 0 (non-DMA)
hciuart_disableints: CR1 0000200c CR2 00000300
hciuart_copyfromrxbuffer: rxhead 33 rxtail 37 nbytes 2
hciuart_copytorxbuffer: rxhead 33 rxtail 37 nbytes 0
hciuart_rxenable: config 801d924 enable 1 (non-DMA)
hciuart_enableints: CR1 0000202c CR2 00000301
btuart_read: read 2 remaining 0
bt_buf_alloc: buf 20002a10 type 1 reserve 0
bt_buf_extend: buf 20002a10 len 2
btuart_evt_recv: hdrlen 4
btuart_rxwork: Need to get 4 bytes
btuart_read: buflen 4 minread 0
hciuart_read: config 801d924 buffer 20002762 buflen 4
hciuart_copytorxbuffer: rxhead 33 rxtail 37 nbytes 0
hciuart_rxenable: config 801d924 enable 0 (non-DMA)
hciuart_disableints: CR1 0000200c CR2 00000300
hciuart_copyfromrxbuffer: rxhead 37 rxtail 37 nbytes 4
hciuart_copytorxbuffer: rxhead 37 rxtail 37 nbytes 0
hciuart_rxenable: config 801d924 enable 1 (non-DMA)
hciuart_enableints: CR1 0000202c CR2 00000301
btuart_read: read 4 remaining 0
btuart_rxwork: Received 4 bytes
btuart_rxwork: Full packet received
hciuart_rxdrain: config 8013f7d
hciuart_copytorxbuffer: rxhead 37 rxtail 37 nbytes 0
hciuart_rxenable: config 801d924 enable 0 (non-DMA)
hciuart_disableints: CR1 0000200c CR2 00000300
hciuart_rxenable: config 801d924 enable 1 (non-DMA)
hciuart_enableints: CR1 0000202c CR2 00000301
bt_hci_receive: buf 20002a10 len 6
hci_rx_work: list 20002a5c
hci_rx_work: buf 20002a10 type 1 len 6
hci_event: event 14
bt_buf_consume: buf 20002a10 len 2
hci_cmd_complete: opcode 200c
bt_buf_consume: buf 20002a10 len 3
hci_cmd_complete: Unhandled opcode 200c
hci_cmd_done: WARNING: status 12
bt_buf_release: buf 20002a10 ref 1 type 1
bt_hci_cmd_send_sync: ERROR:  Failed get return parameters
bt_buf_release: Buffer freed: 20002a10
bt_buf_release: buf 20002a40 ref 1 type 0
bt_buf_release: Buffer freed: 20002a40
bt_hci_start_scanning: ERROR:  bt_hci_cmd_send_sync failed: -5
btnet_ioctl: Start scan: -5
ERROR:  ioctl(SIOCBTSCANSTART) failed: 5
nsh> 

How to install NuttX on Nordic nRF52832

Today I tested NuttX on Nordic nRF52832 and it worked fine!!!

I used this low cost nRF52832 module:

https://www.ebay.com/itm/nRF52832-Bluetooth-4-1-BLE-Module-M4-Transparent-Transmission-CORTEX-M4-512KB-/332270581440

First you need to clone, compile and install a recent OpenOCD.

I used this mirror from github because I was facing issue with main repository:

$ git clone https://github.com/ntfreak/openocd
$ cd openocd
$ ./configure --enable-aice --enable-amtjtagaccel --enable-armjtagew --enable-cmsis-dap --enable-dummy --enable-ftdi --enable-gw16012 --enable-jlink --enable-jtag_vpi --enable-opendous --enable-openjtag_ftdi --enable-osbdm --enable-legacy-ft2232_libftdi --enable-parport --disable-parport-ppdev --enable-parport-giveio --enable-presto_libftdi --enable-remote-bitbang --enable-rlink --enable-stlink --enable-ti-icdi --enable-ulink --enable-usb-blaster-2 --enable-usb_blaster_libftdi --enable-usbprog --enable-vsllink
$ make
$ sudo make install

Now we can clone, configure and compile NuttX on nRF52832:

$ git clone https://bitbucket.org/nuttx/nuttx
$ git clone https://bitbucket.org/nuttx/apps
$ cd nuttx
$ ./tools/configure.sh nrf52-pca10040/nsh
$ make menuconfig
$ make

$ ls -l nuttx.bin 
-rwxrwxr-x 1 alan alan 61016 Abr  3 20:07 nuttx.bin

$ arm-none-eabi-size nuttx
   text	   data	    bss	    dec	    hex	filename
  60793	    220	   1972	  62985	   f609	nuttx

Now we can flash nuttx.bin in the board.

To program this board I used a stlink-v2 clone. I connected the SWDIO (board pin 33), SWDCLK (board pin 32), GND (pin 9) and VCC (pin 10) to respective pins of ST-LINK V2 programmer. Note: I connected VCC to 3.3V.

$ sudo openocd -f interface/stlink-v2.cfg -f target/nrf52.cfg -c init -c "reset init" -c halt -c "nrf5 mass_erase" -c "program nuttx.bin verify" -c reset -c exit
Open On-Chip Debugger 0.10.0+dev-00376-g3d3b45a (2018-04-03-20:18)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
WARNING: interface/stlink-v2.cfg is deprecated, please switch to interface/stlink.cfg
Info : auto-selecting first available session transport "hla_swd". To override use 'transport select '.
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
adapter speed: 1000 kHz
Info : Unable to match requested speed 1000 kHz, using 950 kHz
Info : Unable to match requested speed 1000 kHz, using 950 kHz
Info : clock speed 950 kHz
Info : STLINK v2 JTAG v17 API v2 SWIM v4 VID 0x0483 PID 0x3748
Info : using stlink api v2
Info : Target voltage: 3.225739
Info : nrf52.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : Listening on port 3333 for gdb connections
target halted due to debug-request, current mode: Thread 
xPSR: 0x01000000 pc: 0x000009f4 msp: 0x20000400
Info : nRF52832-QFAA(build code: B0) 512kB Flash
target halted due to debug-request, current mode: Thread 
xPSR: 0x01000000 pc: 0xfffffffe msp: 0xfffffffc
** Programming Started **
auto erase enabled
Warn : using fast async flash loader. This is currently supported
Warn : only with ST-Link and CMSIS-DAP. If you have issues, add
Warn : "set WORKAREASIZE 0" before sourcing nrf51.cfg/nrf52.cfg to disable it
target halted due to breakpoint, current mode: Thread 
xPSR: 0x61000000 pc: 0x2000001e msp: 0xfffffffc
wrote 61440 bytes from file nuttx.bin in 1.536207s (39.057 KiB/s)
** Programming Finished **
** Verify Started **
target halted due to breakpoint, current mode: Thread 
xPSR: 0x61000000 pc: 0x2000002e msp: 0xfffffffc
verified 61016 bytes in 0.165886s (359.198 KiB/s)
** Verified OK **
Warn : Flash driver of nrf52.flash does not support free_driver_priv()
Warn : Flash driver of nrf52.uicr does not support free_driver_priv()

You can see the NuttX starting in the serial console configured to 115200 8n1, just use a USB/Serial of 3.3V connecting P0.24 (board pin 36) to RXD, the P0.23 (pin 35) to TXD and the GND (pin 9) to USB/Serial’s GND.

A huddle of electronic modules

I decided to list all the modules on my pile of modules:

3 – Relay module
2 – Analog Microphone module with ampliflier
2 – ADXL345 Accelerometer module (GY-291)
2 – Zero cross detector module
3 – GP2Y0AH01K0F distance sensor
4 – LDR sensor module
1 – MPU9250 module
3 – 4×4 telephone keypad module
2 – PS2 joystick module
1 – VEML6070 UV sensor module
1 – W25Q32FVZPIG SPI NOR Flash module
1 – VS1053 Audio MP3 module
8 – nRF24 2.4GHz module
5 – MicroSD Card module
1 – WS2812 Breakout module
1 – OV7660 (CF7670C-V2) camera module
2 – HMC5883L 3-axis compass (GY-273)
2 – HMC5983 3-axis compass module (GY-282)
2 – Si1145 UV IR light sensor module (GY1145)
1 – BMP280 pressure module
3 – MAX485 RS485 module from LC Technology
1 – ML8511 Analog UV sensor module (GYML8511)
2 – ACS712 Current sensor module
2 – Hall sensor analog module with amplifier
1 – Tilt module (mercury bulb)
1 – Tilt module with 2 brass capsule/tube
2 – GY-86 10DOF MS5611 HMC5883L MPU6050 module (GY-86)
2 – LM75 temperature sensor module (CJMCU-75)
2 – APDS-9960 Gesture sensor module
1 – RDA5807M FM module (RRD-102)
1 – SX1509 keypad controller module
3 – Laser pointer module
3 – Reed-switch module with amplifier
2 – MQ2 butane sensor module (FC-22)
1 – Hall sensor module without amplifier (Keyes without number)
2 – MCP4725 DAC module
2 – ADCL335 Analog Accelerometer module (GY-61)
2 – Ra-01 LoRa module 433MHz
1 – TCS34725FN Color Light sensor module
1 – BH1750FVI light sensor module
1 – MAX30100 Pulse Oximeter and Heart-Rate Sensor module
2 – Buzzer module (RobotDyn)
1 – LSM6DS3 3-axis accelometer gyroscope
1 – MLX90614 Infrared Thermometer module (GY-906)
2 – BME-280 pressure module
1 – VL53L0X laser ranging sensor module (GYVL53L0X)
5 – TXB0108 level-shifter module (HW-0108)
1 – HTU21 humidity sensor module (GY-21)
2 – TEA5767 FM radio module (PL102BC-N)
1 – DHT11 humidity and temperature sensor module
2 – Thyristor AC switch 5V logic AC 220V/5A module
1 – DS18B20 1-wire temperature probe
1 – USB Audio IN/OUT module
1 – AT24C02B EEPROM module
5 – HX711 24-bit ADC Load Cell amplifier module
1 – BMP180 barometer sensor module (GY-68)
2 – ??? module with a small QFN chip with this code: 2222 C3H 9L8GS
5 – mini joysticks 5-way
3 – slide potentiometer
3 – photodetectors similar used on mouse
1 – voltage regulator module LM2596 DC-DC
1 – RTC module DS1302
1 – SIM800 modem module
3 – MAX6675 thermocoupler module
1 – SI4703 FM Radio Module
1 – CDM324 Radar Module
1 – ILI9486 LCD Module
3 – SN65HVD230 CAN Transceiver

I already created drivers for some of these sensors in the NuttX (i.e.: ADXL345, APDS-9960, BH1750FVI, BMP180, VEML6070, ZeroCross, etc). But there are many more to be added.

How to build NuttX on Windows 10

First let me to make things clear: I stopped using Windows operating system about 18 years ago, when in 2000 Chernobyl virus erased the BIOS Flash and the Hard Disk of my computer that was running Windows 98 at that time.

But since many people are asking me to show how to compile NuttX on Windows, I will show how you can do it using Windows 10 (sorry Windows 7, Windows Vista, Windows XP, Windows 2000, Windows Millennium, Windows 98, Windows 95, Windows 3.1, … and DOS users, but it only works on Windows 10).

You need to enable to “Developer Mode” of Windows: click on Window icon at bottom left corner of your screen and then click on “Windows Settings” (gear icon).

Settings:

In the “Windows Settings” click on “Update & Security”.

Update & Security:

Inside it click in “For Developers”.

For developers:

And enable the option “Developer Mode”.

Developer mode:

After that you need to enable the Windows Subsystem for Linux. Open the “Control Panel”.

Control Panel:

Enter inside “Programs”.

Programs:

Click on “Turn Windows features on or off”.

Turn Windows features on or off:

Then it will open the “Windows Features” window, scroll down until you find “Windows Subsystem for Linux”.

Enable the Windows Subsystem for Linux:

Then click to enable it:

At this moment the Windows will ask to restart, click in the Restart button.

When the system restarted you can run the “bash” command:

It will show the message explaining the a Linux distribution is not installed:

Open the browser and go to: https://aka.ms/wslstore

The the Microsoft Store will open automatically:

Click in the Ubuntu distribution, and the click on Get button:

When it finishes the download click on Launch button:

It will run the installation script, when it finishes you can close it and run the Ubuntu command:

Then the Linux terminal will open:

Now you can follow these steps to compile NuttX:

$ sudo apt-get update

$ sudo apt-get install automake bison build-essential flex gcc-arm-none-eabi gperf git libncurses5-dev libtool libusb-dev libusb-1.0.0-dev pkg-config

Create the nuttx workspace:

mkdir ~/nuttxspace

cd ~/nuttxspace

The Windows Subsystem for Linux doesn’t support USB devices (except USB Pendrive), then we don’t need to install OpenOCD. We will use the JLink too on Windows itself.

Clone the NuttX repositories:

$ cd ~/nuttxspace

$ git clone https://bitbucket.org/nuttx/nuttx

$ git clone https://bitbucket.org/nuttx/apps

$ git clone https://bitbucket.org/nuttx/tools

Configure, compile and install the Kconfig-Frontends (needed by NuttX’s menuconfig)

$ cd ~/nuttxspace

$ cd tools/kconfig-frontends/

$ ./configure

$ make

$ sudo make install

$ sudo ldconfig

Now we can compile NuttX for XMC4-Relax board!

Run the configure script:

$ cd ~/nuttxspace

$ cd nuttx

$ ./tools/configure.sh xmc4500-relax/nsh

Run menuconfig and change the build to Linux and UART3 as serial console:

$ make menuconfig

Build Setup  --->
    Build Host Platform (Linux)

System Type  --->
    XMC4xxx Peripheral Support  --->
        [ ] USIC0
        [*] USIC1  (press SPACE to select)
        [ ] USIC2

    XMC4xxx USIC Configuration  --->
        USIC1 Channel 0 Configuration (Not used)  --->
        USIC1 Channel 1 Configuration (UART3)  --->

Device Drivers  --->
    [*] Serial Driver Support  --->
        Serial console (UART3)  --->

Time to compile it:

$ make

If everything compiled correctly you get a nuttx.bin:

$ ls -l nuttx.bin
-rwxrwxr-x 1 alan alan 79804 Jan  8 12:25 nuttx.bin

Just copy this nuttx.bin binary to Windows side:

$ cp nuttx.bin /mnt/c/ProgramData/

You will need to configure Windows Explorer to show Hidden files, this way you could see the nuttx.bin at C:\ProgramData