This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

in ncs1.5.0 and nrf5340board ,using nrf5340 ble send 235 bytes data to app in phone need more than 100ms time ,in these 100ms ,ecg data comes from ecg chip can not be read . i use zephyr os .how to improve nrf5340 ble send speed?

in ble send data period ,nrf 5340 CPU seem to be shared only by ble send

data ready and data read in ble not send period can equal ,this mean every data come from ecg chip can be read.

but when nrf5340 send data period ,data ready and can not be read .

i use below code read data and when data reach to 244 bytes ble send a time.

nrf5340 p0.13 falling edge mean data comes ,every 4 ms data comes a time

void ADS129XdataRdy(const struct device *dev, struct gpio_callback *cb,uint32_t pins)
{
  if(!nrf_gpio_pin_read(13))
  {
    ADS129x_CS_L;
    k_sem_give(&ADS129xdataRdy_sem);
    LOG_INF("dataRdy at %" PRIu32 "", k_cycle_get_32());
  }
}

for (;;) {

k_sem_take(&ADS129xdataRdy_sem, K_FOREVER);

ADS129x_Read_Data( ) ;
LOG_INF("read at %" PRIu32 "", k_cycle_get_32());
k_sem_reset(&ADS129xdataRdy_sem);

if(k_sem_take(&g_ble_send_ecg, K_MSEC(1))==0 )
{
  if(current_conn)
  {
      bt_nus_send(current_conn, ECGbuf->data, 235);
   }
  LOG_INF("ble send %" PRIu32 "", k_cycle_get_32());
}

Parents Reply Children
No Data
Related