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

how to enable 2mbps

Hello everybody.

I have two boards. I have been trying to build a communication between my boards for a time. I could not manage to have 2mbps data transfer rate. 

Boards                    : nRF52832 DK(PCA10040) and nRF52840 Dongle(PCA10059)
SDK version           : 15.3.0
SoftDevice Version : 6.1.1
SoftDevices            : s132 for PCA10040 and s140 for PCA10059
Examples               : ble_app_uart and ble_app_uart_c

1-) How can I enable 2mbps data transfer rate ? I have tried various methods like sending PHY updating requests etc. But I guess I am doing something wrong. What is the correct way to do it?
2-) Let's say I managed to have 2mbps data transfer rate. How can I test it ? How to verify that I am having 2mbps data transfer rate ?

Sincerely.

Parents
  • Hi

    Can you upload the full advertising_init() and advertising_start() functions in your application so I can have a look?

    error code 7 does indeed mean that you have an invalid parameter somewhere, so one or more of your m_adv_params. are not set correctly. For example, what is your interval set to? This must be between 0x0020 and 0x4000 to be valid.

    Best regards,

    Simon

  • I decided to use the most current SDK (16.0.0). I wrote a function that works to test throughput. It works in peripheral side. Please tell me if I am doing something uncorrect.

    uint16_t data_point_to_transmit = 244;
    uint8_t data_to_transmit[244]   = {0};
    
    void throughput_test() {
      static int payload_per_second = 0;
      ret_code_t my_err_code = 0;
      ret_code_t err_code;
        
      if (isConnected) 
      {
        do 
        {
          err_code = ble_nus_data_send(&m_nus, data_to_transmit, &data_point_to_transmit, m_conn_handle);
          if(err_code != NRF_SUCCESS){
            printf("err_code: %d\r\n",err_code);
          }
        } while ((err_code != NRF_ERROR_INVALID_STATE) && (err_code != NRF_ERROR_BUSY) && (err_code == NRF_SUCCESS));
        if (timer_flag == false) 
        {
          payload_per_second = payload_per_second + data_point_to_transmit;
        } 
        else 
        {
          timer_flag         = false;
          printf("Throughput: %d KB - %d Bytes - %d bits per second\r\n",
              payload_per_second / 1024,
              payload_per_second,
              payload_per_second * 8);
          
          payload_per_second = 0;
        }
      } 
      else 
      {
        payload_per_second = 0;
      }
    }
    

    for (;;)
        {
            throughput_test();
            idle_state_handle();
        }

    I am getting an error (19). What is wrong with this ?

    Best regards.

Reply
  • I decided to use the most current SDK (16.0.0). I wrote a function that works to test throughput. It works in peripheral side. Please tell me if I am doing something uncorrect.

    uint16_t data_point_to_transmit = 244;
    uint8_t data_to_transmit[244]   = {0};
    
    void throughput_test() {
      static int payload_per_second = 0;
      ret_code_t my_err_code = 0;
      ret_code_t err_code;
        
      if (isConnected) 
      {
        do 
        {
          err_code = ble_nus_data_send(&m_nus, data_to_transmit, &data_point_to_transmit, m_conn_handle);
          if(err_code != NRF_SUCCESS){
            printf("err_code: %d\r\n",err_code);
          }
        } while ((err_code != NRF_ERROR_INVALID_STATE) && (err_code != NRF_ERROR_BUSY) && (err_code == NRF_SUCCESS));
        if (timer_flag == false) 
        {
          payload_per_second = payload_per_second + data_point_to_transmit;
        } 
        else 
        {
          timer_flag         = false;
          printf("Throughput: %d KB - %d Bytes - %d bits per second\r\n",
              payload_per_second / 1024,
              payload_per_second,
              payload_per_second * 8);
          
          payload_per_second = 0;
        }
      } 
      else 
      {
        payload_per_second = 0;
      }
    }
    

    for (;;)
        {
            throughput_test();
            idle_state_handle();
        }

    I am getting an error (19). What is wrong with this ?

    Best regards.

Children
No Data
Related