I'm experimenting with multiprotocol support on a PCA10056 (nRF52840) and the S340 softdevice. I need to use BLE and ANT+ at the same time, sending data to either ANT+ or BLE sport receivers.
I'm using SDK15.3 and the S340 6.1.1 softdevice
I have successfully tested the ANT+ Bike Speed and Cadence Tx example (and adapted it to my needs), as well as the equivalent BLE example. I also tested the multiprotocol hrm relay example (receive ANT+ heart rate monitor data and relay it via BLE).
I'm now trying to combine the ANT+ speed and cadence sensor example with the BLE one. I have managed to have a project I can successfully compile and use either ANT+ or BLE independently. If I try to enable them at the same time, the ANT+ portion starts sending data as soon as the SDK board is powered/debug started. But as soon as I try to connect via BLE, I get an error:
[00:00:10.164,154] <debug> nrf_ble_gatt: Peer on connection 0x0 requested a data length of 27 bytes. [00:00:10.164,184] <debug> nrf_ble_gatt: Updating data length to 27 on connection 0x0. [00:00:10.209,075] <debug> nrf_ble_gatt: Data length updated to 27 on connection 0x0. [00:00:10.209,106] <debug> nrf_ble_gatt: max_rx_octets: 27 [00:00:10.209,106] <debug> nrf_ble_gatt: max_tx_octets: 27 [00:00:10.209,106] <debug> nrf_ble_gatt: max_rx_time: 328 [00:00:10.209,136] <debug> nrf_ble_gatt: max_tx_time: 2120 [00:00:10.344,146] <debug> app: PHY update request. [00:00:10.344,177] <debug> app: PHY update request. [00:00:10.344,573] <error> app: ERROR 17 [NRF_ERROR_BUSY] at C:\Nordic\Projects\AntBLE_CSC\core\main.c:851 PC at: 0x0003AAA5 [00:00:10.344,909] <error> app: End of error report
I tried reading the SoftDevice Specification S332 SoftDevice (can't find an equivalent for S340) and the S140 Concurrent multiprotocol implementation using the Radio Timeslot API (once agian, can't find the S340 equivalent), but I'm not sure I understand how to use it
The HRM relay multiprotocol example seems to be able to open both a ANT and BLE radio at the same time with no error, but I can't find anything different in the softdevice calls compared to what I'm doing.
I did add the following, but doesn't seem to help
// <o> APP_ANT_OBSERVER_PRIO - Application ANT event observer priority. #ifndef APP_ANT_OBSERVER_PRIO #define APP_ANT_OBSERVER_PRIO 1 #endif // <o> APP_BLE_OBSERVER_PRIO - Application BLE event observer priority. #ifndef APP_BLE_OBSERVER_PRIO #define APP_BLE_OBSERVER_PRIO 0 #endif // <o> APP_SHUTDOWN_HANDLER_PRIORITY - Application shutdown observer priority. #ifndef APP_SHUTDOWN_HANDLER_PRIORITY #define APP_SHUTDOWN_HANDLER_PRIORITY 1 #endif
Can anyone help with pointers on how to troubleshoot or handle BLE and ANT+ sending data in sequence (the timing of the data packet is not as time-critical, since each packet carries its own timing information, so the receiver will always be able to correctly interpret the packets)