This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Compile examples from standalone SDK by using command line and UART traces

Hello !

I would like to evaluate few examples from standalone SDK and compile those under Linux Ubuntu.

For example : nRF5_SDK_17.1.0_ddde560/examples/crypto/nrf_cc310_bl/pca10056/blank/armgcc

I have added to my .bashrc proper definitions for compiler ( nrfjprog  and other tools are installed as usually)

export GNU_INSTALL_ROOT=/home/user/armkeil/gcc-arm-none-eabi-10.3-2021.10/bin/
export GNU_VERSION=10.3.1
export GNU_PREFIX=arm-none-eabi

and I can make and make flash from that folder without problem.

So I assume build environment is correct.

BUT

I'm not able to enable any UART debug traces to standard DK port.

make sdk_config

show that should be standart UART traces already ( not RTT )

Could you suggest what definition and where I should set for have regular UART traces ?

Regards,

Eugene

Parents
  • Hello,

    It is correct that this example enables UART logging in sdk_config.h, however, as this is an externally written example, the main.c file is not written by us, so it doesn't use the Nordic Log module.

    You can see that it uses something called INTEG_TEST_PRINT(). If you go to the definition of this function, which is implemented in integration_test_plat_defs.h, you can see that this is forwarded to SEGGER_RTT_printf(0, __VA_ARGS__)

    If you want to print the log over UART, I suggest that you add this function to your main.c file:

    /**@brief Function for initializing the nrf log module.
     */
    static void log_init(void)
    {
        ret_code_t err_code = NRF_LOG_INIT(NULL);
        APP_ERROR_CHECK(err_code);
    
        NRF_LOG_DEFAULT_BACKENDS_INIT();
    }

    And call it near the top of your main() function. Then replace all the INTEG_TEST_PRINT(""); with NRF_LOG_INFO("");

    You also need to either set #define NRF_LOG_DEFERRED 0 in sdk_config.h, or replace "while(1);" in main() with:

    for (;;)
    {
        NRF_LOG_PROCESS();
    }

    Of course, there are several approaches to get the logs printed over UART. You can also forward INTEG_TEST_PRINT() to use NRF_LOG_INFO() instead of SEGGER_RTT_printf(), but I prefer leaving the SDK files that are not specific for one example as they are.

    Best regards,

    Edvin

  • Hi !

    I have added on top of file redefinitions like this 

    #include "nrf_log_default_backends.h"

    #include "nrf_log_ctrl.h"
    #include "nrf_log.h"

    #undef INTEG_TEST_PRINT
    #define INTEG_TEST_PRINT NRF_LOG_INFO
    and call log_init() as almost first line in main()

    #define NRF_LOG_DEFERRED 0 in sdk_config.h

    UART traces are appears !

    But test failed at init phase:

    <info> app: Initializing nrf_cc310_bl

    <info> app: Failure: 0x00000006

    What I should do ?

    Create new ticket or this one can be used for handle this problem ?

    Regards,

    Eugene

    P.S. I will try other cryptotests on nRF52840 DK

  • Hi !

    I think exists some other problem with UART traces.

    Example : nRF5_SDK_17.1.0_ddde560/examples/crypto/nrf_crypto/test_app/pca10056_cc310_bl/armgcc

    examples/crypto/nrf_crypto/test_app/main.c

    Looks as fully UART trace enabled BUT traces are not visible.

    In make sdk-config visible only RTT type of traces and I have tried to disable those

    and NRF_LOG_BACKEND_UART_ENABLED 1 in sdk_config.h

    LED1 is blinking several time.

    Most probably test is executed, but no UART traces at all, even defering is disabled as before.

    Regards,

    Eugene

Reply
  • Hi !

    I think exists some other problem with UART traces.

    Example : nRF5_SDK_17.1.0_ddde560/examples/crypto/nrf_crypto/test_app/pca10056_cc310_bl/armgcc

    examples/crypto/nrf_crypto/test_app/main.c

    Looks as fully UART trace enabled BUT traces are not visible.

    In make sdk-config visible only RTT type of traces and I have tried to disable those

    and NRF_LOG_BACKEND_UART_ENABLED 1 in sdk_config.h

    LED1 is blinking several time.

    Most probably test is executed, but no UART traces at all, even defering is disabled as before.

    Regards,

    Eugene

Children
  • Hello,

    I tested with the modifications that you mentioned in your previous reply, and I got the same behavior that you did. I started looking around, and I found these two lines inside integration_tests_setup() in integration_test_plat_utils.c:

        //NVIC_EnableIRQ(CRYPTOCELL_IRQn);
    
        //NRF_CRYPTOCELL->ENABLE = 1;

    I don't know why they were commented out, but commenting them back in made all the tests succeed, and all the INTEG_TEST_PRINT() was printed via the UART.

    Perhaps you can try the same.

    Best regards,

    Edvin

  • Hi Edvin !

    Thank you !

    this test case start to work. No idea why those lines was disabled. May be they try to use noninterrupt driven framework for CC310.

    But in some tests inside test_app folder, for example :

    examples/crypto/nrf_crypto/test_app/pca10056_cc310_bl/armgcc

    UART traces enablers removed everywhere. I have try to add to sdk_config a lot if similar definitions

    but no luck.

    Regards,

    Eugene

Related