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

ble uart example won't run when built from source

Hi,

I'm working on getting the ble UART example running. I flashed the softdevice (s140), then programmed the board (pca10056) with the provided hex file, and encountered the exact same issue as in this question: devzone.nordicsemi.com/.../, where the board will advertise but my phone won't connect to it (iphone 7, iOS 11)

I added the code from the response to that question, but once I built the project the board did not even enter advertising mode or output anything over the serial port. I went back and verified that the code still does not work even without the changes recommended in the question linked above. I tried with the pca10040 board and its corresponding softdevice, and using an older version of the SDK on both boards, and any program that I built had the same issue. The provided hex file for the pca10040 is completely functional. Update: the same behavior is observed with a pca10028 board.

I also tried adding another log to the main routine as follows to see if it was hanging during the ble initialization, but I still get nothing at all over the serial port. I also did a similar test with attempting to turn on an LED instead of logging and that did not work either.

// Initialize.
err_code = app_timer_init();
APP_ERROR_CHECK(err_code);

uart_init();
log_init();

NRF_LOG_INFO("test\r\n"); //added this line

buttons_leds_init(&erase_bonds);
ble_stack_init();
gap_params_init();
gatt_init();
services_init();
advertising_init();
conn_params_init();

printf("\r\nUART Start!\r\n");
NRF_LOG_INFO("UART Start!");
err_code = ble_advertising_start(&m_advertising, BLE_ADV_MODE_FAST);
APP_ERROR_CHECK(err_code);

Does anyone have any insight as to why it's not working or further suggestions for debugging?

Related