Author: acassis

Running NuttX on LPCXpresso54628 OM13098

Today I tested NuttX running the LVGL demo on LPCXpresso54628.

Here you can find the steps needed to get it working.

First compile the firmware to create the nuttx.bin:

$ ./tools/configure.sh lpcxpresso-lpc54628/lvgl
$ make menuconfig
$ make

Now you can flash the firmware using JLinkExe on Linux.

You can use the LPC54608J512 even to flash the LPC54628:

$ sudo JLinkExe -if SWD -device LPC54608J512
SEGGER J-Link Commander V6.32h (Compiled Jul  5 2018 18:15:02)
DLL version V6.32h, compiled Jul  5 2018 18:14:58

Connecting to J-Link via USB...O.K.
Firmware: J-Link ARM V8 compiled Nov 28 2014 13:44:46
Hardware version: V8.00
S/N: 268006167
License(s): FlashBP, GDB
OEM: SEGGER-EDU
VTref=3.293V

Type "connect" to establish a target connection, '?' for help

Run “connect” command:

J-Link> connect
Specify target interface speed [kHz]. : 4000 kHz
Speed>
Device "LPC54608J512" selected.
Connecting to target via SWD
Found SW-DP with ID 0x2BA01477
Found SW-DP with ID 0x2BA01477
Scanning AP map to find all available APs
AP[1]: Stopped AP scan as end of AP map has been reached
AP[0]: AHB-AP (IDR: 0x24770011)
Iterating through AP map to find AHB-AP to use
AP[0]: Core found
AP[0]: AHB-AP ROM base: 0xE00FF000
CPUID register: 0x410FC241. Implementer code: 0x41 (ARM)
Found Cortex-M4 r0p1, Little endian.
FPUnit: 6 code (BP) slots and 2 literal slots
CoreSight components:
ROMTbl[0] @ E00FF000
ROMTbl[0][0]: E000E000, CID: B105E00D, PID: 000BB00C SCS-M7
ROMTbl[0][1]: E0001000, CID: B105E00D, PID: 003BB002 DWT
ROMTbl[0][2]: E0002000, CID: B105E00D, PID: 002BB003 FPB
ROMTbl[0][3]: E0000000, CID: B105E00D, PID: 003BB001 ITM
ROMTbl[0][4]: E0040000, CID: B105900D, PID: 000BB9A1 TPIU
ROMTbl[0][5]: E0041000, CID: B105900D, PID: 000BB925 ETM
Cortex-M4 identified.

Finally flash nuttx.bin using the loadbin command:

J-Link>loadbin ./nuttx.bin 0
Halting CPU for downloading file.
Downloading file [./nuttx.bin]...
Comparing flash   [100%] Done.
Erasing flash     [100%] Done.
Programming flash [100%] Done.
Verifying flash   [100%] Done.
J-Link: Flash download: Bank 0 @ 0x00000000: 1 range affected (360448 bytes)
J-Link: Flash download: Total time needed: 3.314s (Prepare: 0.058s, Compare: 0.009s, Erase: 0.991s, Program: 2.245s, Verify: 0.005s, Restore: 0.003s)
O.K.
J-Link> exit

Reset the board and you should see the touchscreen calibration screen.

And then:

Advertisements

Running external application on NuttX

Normally NuttX supports internal (Built-In) applications embedded on its firmware. When you run: “nsh> hello” or your application, NuttX look for the application inside the internal flash of the microcontroller and run it.

But NuttX also supports running external applications. These external applications are ELF files. The ELF format is the default executable format used on Linux and almost all Unix OS.

Normally the OS needs to create a Global Symbol Table (AKA: symtab) where the ELF look at to translate the used functions of the ELF binary to memory addresses where these functions exist in the OS.

The “drawback” of this symtab is because it will waste a lot of space inside the flash (firmware) of the OS.

Fortunately NuttX also supports an alternative solution where this symtab is not needed. The ELF binary is created with the fixed memory position of each function address position. The drawback of this solution is the ELF binary is not relocatable, in other words: if you compile a new firmware for your board the existent external ELF binary could to fail because these functions positions are located at a different position now.

You can find the instructions for both options here:

http://www.nuttx.org/doku.php?id=wiki:nshhowtos:elf-addon

I tested the “no-symtab” option loading an external “hello” from a USB Flash Drive:

NuttShell (NSH)
nsh> ls /dev
/dev:
 console
 null
 sda
 ttyS0
nsh> ?
help usage:  help [-v] []

  [           dirname     help        mh          set         unset       
  ?           dd          hexdump     mount       sh          usleep      
  basename    df          kill        mv          sleep       xd          
  break       echo        ls          mw          test        
  cat         exec        mb          ps          time        
  cd          exit        mkdir       pwd         true        
  cp          false       mkfatfs     rm          uname       
  cmp         free        mkrd        rmdir       umount      

Builtin Apps:
  hello
nsh> hello
Hello, World!!

nsh> mount -t vfat /dev/sda /bin
nsh> hello
Hello world from external binary!
nsh>

As you can see initially the internal “hello” program was executed, but after I mounted the USB Flash Drive to /bin the external “hello” takes precedence over the internal.

These are the options I need to get it working:

CONFIG_STM32_OTGFS=y
CONFIG_STM32_CCMEXCLUDE=y
CONFIG_SCHED_WORKQUEUE=y
CONFIG_SCHED_HPWORK=y
CONFIG_USBHOST=y
CONFIG_USBHOST_ISOC_DISABLE=y
CONFIG_USBHOST_MSC=y
CONFIG_FS_FAT=y
CONFIG_BINFMT_EXEPATH=y
CONFIG_PATH_INITIAL="/bin"
CONFIG_ELF=y
CONFIG_LIBC_ARCH_ELF=y
CONFIG_LIBC_EXECFUNCS=y
# CONFIG_EXECFUNCS_HAVE_SYMTAB is not set
CONFIG_EXAMPLES_HELLO=y
CONFIG_NSH_FILE_APPS=y
CONFIG_NSH_ARCHINIT=y

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.

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.