I am trying to make a custom BLE service and be able to do debug it with UART at the same time.
Just trying to print some UART messages at some points in the code.
However, whenever I insert even on 'printf' lines, the BLE fail to work. To be specific, even with one printf line, my nRF51-DK will not show up when scanned from external device.
On the other hand, even with including all header files needed for UART(app_uart, to be specific), when there are no 'printf' lines, my BLE service will be recognized from outside.
Could anyone point out some reason on why this might happen?
I'm guessing somehow the UART operation is interfering with BLE stack operation but still it doesn't make sense because my printf codeline come out before the BLE stack initialization code is executed. (snippet of my main.c code shown below)
int main(void)
{
uint32_t err_code;
bool erase_bonds;
// uart addition
uart_init();
printf("uart init complete\n");
leds_init();
timers_init();
buttons_leds_init(&erase_bonds);
ble_stack_init();
device_manager_init(erase_bonds);
gap_params_init();
advertising_init();
services_init();
conn_params_init();