Hi,
I want to create 2 softdevice tasks, 1 for advertising and 1 for scanning. I have ported the dependencies and some code from the ble_app_freertos_pca10040_s132 into the ble_app_hrs_rscs_relay_pca10040_s132 example. When I call nrf_sdh_freertos_init(adv_scan_start, &erase_bonds) the board works as intended, and does both advertising and scanning correctly, as far as I can tell. When I have two calls to nrf_sdh_freertos_init, however, I get an ERROR 8 (Invalid State) on the advertising side. Why does this occur when I try to run them as 2 separate threads?
Advertising and Scanning code:
Calls to create threads in Main:
Serial Output:
Where the error line is line 19 in the advertising_start function.