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

UART example does not work.

Hello.

What do I need to run this example called uart?

As far as I understand this should be simple echo program meaning what comes in goes out but I can not see anything on terminal. I tried to enable NRF_LOG_ENABLED with CMSIS but after that I got bunch of linkage errors:

1> "C:/tools/SEGGER/SEGGER Embedded Studio for ARM 3.50/gcc/arm-none-eabi/bin/ld" -X --omagic -eReset_Handler --defsym=__vfprintf=__vfprintf_long --defsym=__vfscanf=__vfscanf_int -EL --gc-sections "-TC:/nordic/nRF5_SDK_15.0.0_a53641a/examples/peripheral/uart/pca10040/blank/ses/Output/uart_pca10040 Release/Obj/uart_pca10040.ld" -Map Output/Release/Exe/uart_pca10040.map -u_vectors -o Output/Release/Exe/uart_pca10040.elf --emit-relocs "@C:/nordic/nRF5_SDK_15.0.0_a53641a/examples/peripheral/uart/pca10040/blank/ses/Output/uart_pca10040 Release/Obj/uart_pca10040.ind"
1> Output/uart_pca10040 Release/Obj/app_error_weak.o: In function `app_error_fault_handler':
1> C:\nordic\nRF5_SDK_15.0.0_a53641a\components\libraries\util/app_error_weak.c:58: undefined reference to `nrf_log_panic'
1> C:\nordic\nRF5_SDK_15.0.0_a53641a\components\libraries\util/app_error_weak.c:58: undefined reference to `nrf_log_frontend_dequeue'
1> C:\nordic\nRF5_SDK_15.0.0_a53641a\components\libraries\util/app_error_weak.c:61: undefined reference to `nrf_log_frontend_std_0'
1> C:\nordic\nRF5_SDK_15.0.0_a53641a\components\libraries\util/app_error_weak.c:103: undefined reference to `nrf_log_frontend_std_0'
1> Output/uart_pca10040 Release/Obj/app_error_weak.o: In function `__NOP':
1> C:\nordic\nRF5_SDK_15.0.0_a53641a\examples\peripheral\uart\pca10040\blank\ses/../../../../../../components/toolchain/cmsis/include/cmsis_gcc.h:375: undefined reference to `m_nrf_log_app_logs_data_dynamic'
Build failed

When I tried to add source file containing those definition (nrf_log_frontend.c) to the project I got another missing references. Is there any simple solution to fix this?

btw I've built this project with SES.

Best regards.

Parents Reply Children
  • Hi.

    It should work, I suspect you might have wrong configurations in TeraTerm.

    These are the configurations I used in Termite 3.4:

    As you can see, it gave me a echo output:

    - Andreas

  • Above are my settings and I can type as long as I want but there's no any output.

    Yet another observation from my side, when I start debugging it works it echo every character I type until q or Q but in "normal  mode" (without debugging) I can not see anything.

  • Hi.

    Have you check for "Local echo", "Receive: AUTO", and "Transmit: LF" under Setup --> Terminal..., like this:

    When you type either "q" or "Q" the program terminates into a while-loop, as shown at the bottom of the main-loop in the code:

            uint8_t cr;
            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.
                }
            }

    Here you can see I typed "q":

    - Andreas

  • Yeah, just checked those options and nothing has changed, I even change program logic to this:

    while (true)
    {
    uint8_t cr='t';
    while (app_uart_put(cr) != NRF_SUCCESS);
    nrf_delay_ms(100);
    }

    so it sends lower case letter t every 100ms but I can not see anything on my terminal unless I start debugging.

    when I flash the board in "normal" way nothing shows up on terminal.

    Yet another edit:

    It turned out that there is something wrong with terminal configuration on my pc, on other computer it works fine.

    Thank you for help and best regards.

  • Hi.

    It should work as intended with these configurations. I suggest you start from scratch with an unmodified version of this example.

    Download and unzip the nRF5_SDK_15.0.0_a53641a\examples\peripheral\uart example, compile it without doing any modfications and without any debugging, and use the configurations I suggested for Tera Term, and see if this works.

    If this doesn't work, could you please attach this project in a .zip file so I can have a look at it?

    - Andreas

Related