I’ve struggled all day to read all the information about the PC test application. This app, called “advertise” runs on the PC, and talk to the Nordic dongle over the serial line.
My understanding is that Nordic have made a Windows library that is a stub for the soft-machine. It accepts calls from a PC BLE-speaking application, and translates them into commands that it sends down the serial (USB) line to the dongle. A corresponding stub in the dongle unpacks the serial commands and calls the appropriate procedure in the soft-machine. I assume the return values are sent back to the PC using a similar mechanism. I think it looks like this.
In principal this is a pretty neat bit of software that let’s you develop new ideas on the PC where it’s easy to bang out code, and then migrate key bits over to the Nordic when they are working.
My problem
Yesterday I slogged away trying to get the serial comms to work, and partially succeeded by recompiling code for the V1.0 dongle, which was the only kind of dongle I thought I had. Today I discovered by accident that the replacement kit I got from Nordic, while in the UK, actually has a V2.2 dongle so everything ought to work just peachy.
I have burned the dongle with:
- …/nrf51-ble-driver_win_0.2.0-alpha/nrf51-ble-driver_win_0.2.0-alpha/hex/connectivity_devdongle_115k2.hex
- …/s110_nrf51822_6.0.0/s110_nrf51822_6.0.0_softdevice.hex
I have also tried the 7.0.0 release!
I have successfully compiled the advertising program, and made sure that:
- It is talking to the right com port, in my case COM8
- It is successfully launching the dynamic link library.
But alas no. I appear to be able to get in touch with the dongle, but at the first attempt to do something it hangs. So I don’t know if this is really a comms problem, or some configuration issue with the dongle.
I have debugged the program, and for double measure, added some print statements, and run it from the command line to make sure nobody is getting their fingers in the way.
sd_rpc_serial_port_name_set(UART_PORT_NAME); //error_code = sd_rpc_serial_baud_rate_set(57600); printf(“Using %sn”, UART_PORT_NAME);
sd_rpc_log_handler_set(log_handler); printf(“Log handler setn”);
sd_rpc_evt_handler_set(ble_evt_dispatch); printf(“Event handler setn”);
error_code = sd_rpc_open(); printf(“Serial port open (%d)n”, error_code);
if (error_code != NRF_SUCCESS) { printf(“Failed to open the nRF51 ble driver”); return error_code; }
memset(&ble_enable_params, 0, sizeof(ble_enable_params));
printf(“Enable the bluetooth stackn”); error_code = sd_ble_enable(&ble_enable_params);
if (error_code != NRF_SUCCESS) { return error_code; } printf(“Enabledn”);
What I get is this:
Searching the developer zone is not revealing anything helpful. Maybe I am asking the wrong questions?
Exhausted.