My board is nrf51822. Simple_uart works fine in uart_example, but once I copy it to my ble project which can work, it stuck. Part of my code :
advertising_init();
services_init();
conn_params_init();
sec_params_init();
simple_uart_config(RTS_PIN_NUMBER, TX_PIN_NUMBER, CTS_PIN_NUMBER, RX_PIN_NUMBER, HWFC);
simple_uart_putstring((const uint8_t *)" \n\rStart: ");
while(true)
{
uint8_t cr = simple_uart_get();
simple_uart_put(cr);
if(cr == 'q' || cr == 'Q')
{
while(true)
{
// Do nothing.
}
}
}
// Enter main loop.
for (;;)
{
power_manage();
}
Problem in a while loop for waiting uart ready:
while (NRF_UART0->EVENTS_TXDRDY!=1)
Same code in uart_example, it works fine, but in my ble project or a ble example, none of rx and tx can be done.