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

nrf52 DK: UART problems

Hello,

I integrated the relevant code from the "uart" example into the "ble_app_uart" example(this is all the code in the main routine):

uint8_t cr;        
uart_init();
	printf("\r\nUART Start!\r\n");

  while (true){
		        
    while (app_uart_get(&cr) != NRF_SUCCESS);
    while (app_uart_put(cr) != NRF_SUCCESS);

    if (cr == 'q' || cr == 'Q')
    {
        printf(" \r\nExit!\r\n");

        while (true)
        {
            // Do nothing.
        }
    }
}

Now have the problem that the program is stuck in this line:

while (app_uart_get(&cr) != NRF_SUCCESS);

The return value of the function is not "NRF_SUCCESS".

The echo function in the "uart" example was working fine.

The only difference between the uart_inits of both is uart_error_handle and uart_event_handle and the Flow Control. But even if I set this to enable it won't work:

UART: UART example

BLE_APP_UART: BLE_APP_UART example

Also if I flash the code, I can't download the softdevice to the board. Maybe there are conflicts but I have no clue.

Thanks in advance Hannes

Parents
  • FormerMember
    0 FormerMember

    Could you double check that you have connected the boards correctly together?

    TX <--> RX
    RX <--> TX
    

    Update 20.03.2017: I have tested similar code here, based on ble_app_uart (SDK 13), and in that case app_uart_get(..) will receive characters from the terminal. Could you test my code, and check if it work on your side? The project should be used with S132 v.4.0.2.

    ble_app_uart_UART_only.zip

    Update 22.03.2017: APP_TIMER_CONFIG_RTC_FREQUENCY should have the following definition in sdk_config.h.

    image description

  • Do you know what the UART example is doing? It's establishing a connection from the board to the PC using the virtual COM port over USB and echoing UART communication that's coming from the PC. So there's no need to check any connection. Also I wrote that the UART example itself is working fine. Maybe you didn't see that I'm using your Development Kit (PCA10040).

Reply Children
No Data
Related