Hello everyone,
I'm developing an application for an nrf52840 with the nrf connect VS Code extension.
The application runs three threads. One to acquire 40 bytes of data from a sensor at a frequency of 400Hz, another to process those data, and a third to send the result through BLE notifications.
It is important to note that I shouldn't lose the synchronization with the sensor for the processing but I can send the processed data slower. Therefore I configured the BLE like this :
CONFIG_BT=y CONFIG_BT_DEBUG_LOG=y CONFIG_BT_PERIPHERAL=y CONFIG_BT_USER_DATA_LEN_UPDATE=y CONFIG_BT_ATT_PREPARE_COUNT=9 CONFIG_BT_BUF_ACL_TX_COUNT=9 CONFIG_BT_BUF_ACL_RX_SIZE=47 CONFIG_BT_CTLR_DATA_LENGTH_MAX=47 CONFIG_BT_L2CAP_TX_MTU=47 CONFIG_BT_BUF_ACL_TX_SIZE=47 CONFIG_BT_CTLR_SDC_MAX_CONN_EVENT_LEN_DEFAULT=7812
size_t size = sizeof(struct raw_tx_buf); char *raw_mem_ptr = k_malloc(size); __ASSERT_NO_MSG(raw_mem_ptr != 0); memcpy(raw_mem_ptr, &raw_tx, size); k_fifo_put(&raw_tx_fifo, raw_mem_ptr);
struct raw_tx_buf *raw_buf = k_fifo_get(&raw_tx_fifo,K_FOREVER); bt_gatt_notify(NULL,&mcd_svc.attrs[2],raw->raw_data,sizeof(raw->raw_data); k_free(raw_buf);