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

nrf51-ble-driver_win_0.3.0 question

Hi!

I realize that the paint on this is still drying, but I'm wondering if anyone is seeing the following behavior?

I can run an program based on this API once. When I try to run it again, sd_ble_gap_scan_start() never returns. If I control-c the program, unplug the device and plug it back in, then the program runs -- once.

I've tried this with both a program that I have written and the S120 Multi-Link example. I've also tried a nRF51822 dongle (PCA10000) and a nRF51422 dongle (PCA10031).

The firmware I have loaded is

 s120_nrf51822_1.0.1_softdevice.hex

and

 connectivity_1M.hex

I have also tried connectivity_115k2.hex and changed the program code to match.

When using s120_nrf51_2.0.0_softdevice.hex I can't load either connectivity app since the newer software device appears to be bigger.

Any ideas?

Thanks!

Parents
  • First of all, thank you for the feedback. I have handed this over to our developers so and they are aware of the issue you are reporting with regard to only be able to run the application once.

    For now, the recommendation would be to ensure that sd_rpc_close() runs at closing and that you might also be able to reset the application by using nrfjprog->pinreset.

    We suspect that the issue you are seeing is due to data left in the Segger chips buffers. This should be possible to handle by using sd_rpc_close().

  • Hi!

    I wanted to let you know that in my code the only path out of the program has an sd_rpc_close() in it. I basically have this

              bool                    interfaceIsOpen = false;
    
              /*
               * Initialize the interface between this program and the Nordic device
               */
              if ((status=sd_rpc_open()) != NRF_SUCCESS)
              {
                  fprintf_s(stderr, "sd_rpc_open() failed with status %d.\n", status);
                  goto EXIT;
              }
    
              interfaceIsOpen = true;
    
              ... 
    
          EXIT:
              if (interfaceIsOpen)
              {
                  int tStatus;
                  if ((tStatus = sd_rpc_close()) != NRF_SUCCESS)
                  {
                      fprintf_s(stderr, "sd_rpc_close() failed with status %d.\n", status);
                  }
              }
    

    There are no intermediate return statements. So unless the program faults, or you stop it somewhere in the middle while running the debugger, the " if (interfaceIsOpen)" is always executed.

    It didn't help the problem.

    I ended up crafting a function to fire off an "nrfjprog --pinreset" that I call right before the program ends.

    --- tom

Reply
  • Hi!

    I wanted to let you know that in my code the only path out of the program has an sd_rpc_close() in it. I basically have this

              bool                    interfaceIsOpen = false;
    
              /*
               * Initialize the interface between this program and the Nordic device
               */
              if ((status=sd_rpc_open()) != NRF_SUCCESS)
              {
                  fprintf_s(stderr, "sd_rpc_open() failed with status %d.\n", status);
                  goto EXIT;
              }
    
              interfaceIsOpen = true;
    
              ... 
    
          EXIT:
              if (interfaceIsOpen)
              {
                  int tStatus;
                  if ((tStatus = sd_rpc_close()) != NRF_SUCCESS)
                  {
                      fprintf_s(stderr, "sd_rpc_close() failed with status %d.\n", status);
                  }
              }
    

    There are no intermediate return statements. So unless the program faults, or you stop it somewhere in the middle while running the debugger, the " if (interfaceIsOpen)" is always executed.

    It didn't help the problem.

    I ended up crafting a function to fire off an "nrfjprog --pinreset" that I call right before the program ends.

    --- tom

Children
No Data
Related