Clone the repositories:

$ git clone https://www.github.com/apache/incubator-nuttx nuttx
$ git clone https://www.github.com/apache/incubator-nuttx-apps apps

Configure and compile:

$ cd nuttx/
$ ./tools/configure.sh esp32-devkitc:ble
$ make download ESPTOOL_PORT=/dev/ttyUSB0

Configure minicom or other serial console terminal to /dev/ttyUSB0 115200 8n1 and access the terminal and scan the Bluetooth devices:

NuttShell (NSH) NuttX-10.1.0
nsh> ifconfig
bnep0 Link encap:UNSPEC at DOWN
inet addr:0.0.0.0 DRaddr:0.0.0.0 Mask:0.0.0.0

wlan0 Link encap:Ethernet HWaddr ac:67:b2:53:8b:ec at UP
inet addr:10.0.0.2 DRaddr:10.0.0.1 Mask:255.255.255.0

nsh> bt bnep0 scan start
nsh> bt bnep0 scan stop
nsh> bt bnep0 scan get
Scan result:

addr: 4b:5f:17:5d:6c:a9 type: 1
rssi: -89
response type: 2
advertiser data: 02 01 1a 09 ff c4 00 02 33 14 12 16 80 02 0a d4
03 03 b9 fe 08 1b 00 2d 97 67 12 dd 78

addr: 4b:5f:17:5d:6c:a9 type: 1
rssi: -90
response type: 4
advertiser data: 18 09 5b 4c 47 5d 20 77 65 62 4f 53 20 54 56 20
55 4d 37 32 37 30 50 53 41 02 0a d4

addr: 60:23:38:f9:6b:0e type: 1
rssi: -94
response type: 3
advertiser data: 1e ff 06 00 01 09 20 02 67 7c 14 68 d5 b4 38 9f
bc 0d 22 02 b0 c2 ed a7 df bc 02 2e 61 d8 5c

addr: 2c:de:fa:4d:b3:3d type: 1
rssi: -92
response type: 3
advertiser data: 1c ff 06 00 01 09 21 0a bb 0a 75 5b cd 5c 44 45
53 4b 54 4f 50 2d 30 33 4c 31 4a 38 4e

addr: 58:16:55:01:ee:e9 type: 1
rssi: -70
response type: 3
advertiser data: 1e ff 06 00 01 09 20 02 0f c7 70 a0 d1 25 7f fb
3f 2f 04 2c 42 48 ec fa a8 2b 91 4e 1a 43 2f
nsh>