pkarashchenko commented on issue #12685:
URL: https://github.com/apache/nuttx/issues/12685#issuecomment-2409152143
@maxikrie you didn't. I had too many things flying around, so didn't managed
to update on time. Here is my configuration
```
#
# This file is autogenerated: PLEASE DO NOT EDIT IT.
#
# You can use "make menuconfig" to make any modifications to the installed
.config file.
# You can then do "make savedefconfig" to generate a new defconfig file that
includes your
# modifications.
#
# CONFIG_ARCH_LEDS is not set
# CONFIG_NIMBLE_PORTING_EXAMPLE is not set
# CONFIG_NSH_ARGCAT is not set
# CONFIG_NSH_CMDOPT_HEXDUMP is not set
# CONFIG_WIRELESS_BLUETOOTH_HOST is not set
CONFIG_ALLOW_BSD_COMPONENTS=y
CONFIG_ARCH="xtensa"
CONFIG_ARCH_BOARD="esp32s3-devkit"
CONFIG_ARCH_BOARD_COMMON=y
CONFIG_ARCH_BOARD_ESP32S3_DEVKIT=y
CONFIG_ARCH_CHIP="esp32s3"
CONFIG_ARCH_CHIP_ESP32S3=y
CONFIG_ARCH_CHIP_ESP32S3WROOM1=y
CONFIG_ARCH_INTERRUPTSTACK=2048
CONFIG_ARCH_STACKDUMP=y
CONFIG_ARCH_XTENSA=y
CONFIG_BLUETOOTH_TXCMD_STACKSIZE=4096
CONFIG_BLUETOOTH_TXCONN_STACKSIZE=4096
CONFIG_BOARDCTL_RESET=y
CONFIG_BOARD_LOOPSPERMSEC=16717
CONFIG_BUILTIN=y
CONFIG_DEBUG_ASSERTIONS=y
CONFIG_DEBUG_ERROR=y
CONFIG_DEBUG_FEATURES=y
CONFIG_DEBUG_INFO=y
CONFIG_DEBUG_WARN=y
CONFIG_DEFAULT_TASK_STACKSIZE=4096
CONFIG_DRIVERS_BLUETOOTH=y
CONFIG_DRIVERS_IEEE80211=y
CONFIG_DRIVERS_WIRELESS=y
CONFIG_ESP32S3_BLE=y
CONFIG_ESP32S3_RT_TIMER_TASK_STACK_SIZE=4096
CONFIG_ESP32S3_UART0=y
CONFIG_FS_LARGEFILE=y
CONFIG_FS_PROCFS=y
CONFIG_HAVE_CXX=y
CONFIG_HAVE_CXXINITIALIZE=y
CONFIG_HOST_MACOS=y
CONFIG_IDLETHREAD_STACKSIZE=3072
CONFIG_INIT_ENTRYPOINT="nsh_main"
CONFIG_INIT_STACKSIZE=8192
CONFIG_INTELHEX_BINARY=y
CONFIG_NAME_MAX=48
CONFIG_NDEBUG=y
CONFIG_NETDEV_LATEINIT=y
CONFIG_NET_BLUETOOTH=y
CONFIG_NET_ETH_PKTSIZE=1514
CONFIG_NET_SOCKOPTS=y
CONFIG_NET_TCP=y
CONFIG_NIMBLE=y
CONFIG_NIMBLE_BLE_SM_SC_ONLY=y
CONFIG_NIMBLE_BLE_WHITELIST=y
CONFIG_NIMBLE_DEBUG_ERROR=y
CONFIG_NIMBLE_DEBUG_INFO=y
CONFIG_NIMBLE_DEBUG_WARN=y
CONFIG_NIMBLE_HS_FLOW_CTRL=y
CONFIG_NIMBLE_ROLE_CENTRAL=y
CONFIG_NSH_ARCHINIT=y
CONFIG_NSH_BUILTIN_APPS=y
CONFIG_NSH_FILEIOSIZE=512
CONFIG_NSH_LINELEN=64
CONFIG_NSH_READLINE=y
CONFIG_POSIX_SPAWN_DEFAULT_STACKSIZE=4096
CONFIG_PREALLOC_MQ_MSGS=32
CONFIG_PREALLOC_TIMERS=4
CONFIG_PTHREAD_MUTEX_TYPES=y
CONFIG_RAM_SIZE=114688
CONFIG_RAM_START=0x20000000
CONFIG_RR_INTERVAL=200
CONFIG_SCHED_HPWORKSTACKSIZE=4096
CONFIG_SCHED_LPWORKSTACKSIZE=4096
CONFIG_SCHED_WAITPID=y
CONFIG_SIG_EVTHREAD=y
CONFIG_SPINLOCK=y
CONFIG_START_DAY=6
CONFIG_START_MONTH=12
CONFIG_START_YEAR=2011
CONFIG_SYSLOG_BUFFER=y
CONFIG_SYSTEM_ARGTABLE3=y
CONFIG_SYSTEM_NSH=y
CONFIG_SYSTEM_NSH_STACKSIZE=4096
CONFIG_TIMER=y
CONFIG_TLS_TASK_NELEM=4
CONFIG_UART0_SERIAL_CONSOLE=y
CONFIG_WIRELESS=y
CONFIG_WIRELESS_BLUETOOTH=y
```
I'm having an app that implements nimBLE central device with the `main` that
looks like:
```
/****************************************************************************
* External Functions Prototypes
****************************************************************************/
void ble_hci_sock_ack_handler(FAR void *param);
void ble_hci_sock_init(void);
void ble_hci_sock_set_device(int dev);
void ble_store_ram_init(void);
/****************************************************************************
* Private Functions Prototypes
****************************************************************************/
static FAR void *ble_hci_sock_task(FAR void *param);
static FAR void *ble_host_task(FAR void *param);
/****************************************************************************
* Private Functions
****************************************************************************/
/****************************************************************************
* Name: ble_hci_sock_task
****************************************************************************/
static FAR void *ble_hci_sock_task(FAR void *param)
{
ble_hci_sock_ack_handler(param);
return NULL;
}
/****************************************************************************
* Name: ble_host_task
****************************************************************************/
static FAR void *ble_host_task(FAR void *param)
{
nimble_host_task(param);
return NULL;
}
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: nimble_main
****************************************************************************/
int main(int argc, FAR char *argv[])
{
struct ble_npl_task s_task_hci;
int ret = 0;
/* allow to specify custom hci */
if (argc > 1)
{
ble_hci_sock_set_device(atoi(argv[1]));
}
#ifndef CONFIG_NSH_ARCHINIT
/* Perform architecture-specific initialization */
boardctl(BOARDIOC_INIT, 0);
#endif
#ifndef CONFIG_NSH_NETINIT
/* Bring up the network */
netinit_bringup();
#endif
nimble_port_init();
ble_hci_sock_init();
/* Initialize services */
ble_svc_gap_init();
ble_svc_gatt_init();
ble_svc_ans_init();
ble_svc_ias_init();
ble_svc_lls_init();
ble_svc_tps_init();
/* XXX Need to have template for store */
ble_store_ram_init();
/* Create task which handles HCI socket */
ret = ble_npl_task_init(&s_task_hci, "hci_sock", ble_hci_sock_task,
NULL, TASK_DEFAULT_PRIORITY, BLE_NPL_TIME_FOREVER,
TASK_DEFAULT_STACK, TASK_DEFAULT_STACK_SIZE);
if (ret != 0)
{
printf("ERROR: starting hci task: %i\n", ret);
}
ble_host_task(NULL);
return 0;
}
```
and
```
static void
app_ble_sync_cb(void)
{
int rc;
ble_addr_t addr;
/* generate new non-resolvable private address */
rc = ble_hs_id_gen_rnd(0, &addr);
assert(rc == 0);
/* set generated address */
rc = ble_hs_id_set_rnd(addr.val);
assert(rc == 0);
rc = ble_hs_util_ensure_addr(0);
assert(rc == 0);
rc = ble_hs_id_infer_auto(0, &g_own_addr_type);
assert(rc == 0);
scan();
}
void nimble_host_task(void *param)
{
int rc;
ble_hs_cfg.sync_cb = app_ble_sync_cb;
/* Initialize data structures to track connected peers. */
rc = peer_init(MYNEWT_VAL(BLE_MAX_CONNECTIONS), 64, 64, 64);
assert(rc == 0);
rc = ble_svc_gap_device_name_set(gap_name);
assert(rc == 0);
nimble_port_run();
}
```
I'm not sure if I can share more parts of the application here, but I hope
that this should be enough for you to move forward.
Also I haven't tried my defconfig with the latest nuttx master, so I'm not
sure of defconfig can be used "as is".
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]