Debug UART with SDK 7.1

I just switched over from SDK v6 to SDK v7.1 (installed via those Keil Packs). The UART has suddenly stopped working (via Segger USB COM port) and I can no longer see any debug console output. It's just giving me garbage characters.

I'm using the NRF51822 on the PCA10001 reference design.

Is this a known issue? If I wanted to 'start over' in providing a console output, how would I go about enabling UART debug console output over the Segger COM port? I've already searched the forum and have been unable to resolve this.

I also tried following the SDK instructions for Debug, but that didn't work either. developer.nordicsemi.com/.../a00074.html

38400 bps, 8N1, no parity, no flow control. Changed the bps to 115200, same settings, no change. No matter what settings I change I still get garbage characters.

Thanks.

  • Hi,

    I am also using SDK7.1 with the new nRF6824 (nRF51 Development kit), When I try to use app_trace_init and app_trace_log via Segger USB COM I get the first character of each app_trace_log call. app_trace_log("Test\r\n") will print T. I am using PuTTY 115200bps 8 bits no parity no HWFC. Thanks

  • What do you mean with "switched over"? Are you trying to port your existing application over to SDK 7.1, or did you just start with a fresh example from SDK 7.1?

  • Found a solution for the UART problem.

    Stop using app_trace_init and app_trace_log (deselect app_trace in pack routine selection) import from ble_app_hrs_printf the routine retarget.c

    #include <stdio.h>
    #include <stdint.h>
    #include "simple_uart.h"
    #include "nordic_common.h"
    #include "nrf51.h"
    #include "nrf51_bitfields.h"
    #include "boards.h"**
    
    struct __FILE { int handle; /* Add whatever you need here */ };
    FILE __stdout;
    FILE __stdin;
    
    void retarget_init(void)
    {
        simple_uart_config(RTS_PIN_NUMBER, TX_PIN_NUMBER, CTS_PIN_NUMBER, RX_PIN_NUMBER, HWFC);
    }
    
    int fputc(int ch, FILE * p_file) 
    {
        simple_uart_put((uint8_t)ch);
        return 0;
    }
    
    /**
     *@}
    
     **/
    

    Then use retarget_init(); to initialize the UART and printf to output message. With this setup the baudrate is 38400 no parity no flow control.

    This works with PCA10001 (COM3) and PCA10028 (COM6).

    Claude

  • Hello, You have to check which kind of app_uart you have linked to your project. App_trace requires app_uart_fifo.c.