Device reset happening and i can't able to upload the code

Hello,

In my project i am using  nrf52840 with my custom board and to upload the code through NRF_CONNECT application with soft device its uploading properly but with  segger emmbedded its giving some error like this .please have look and let me know what is the problem.

after this i have add DEBUG in preprocessor definition and i got this

thank you.

Parents
  • Hi

    I'm guessing you haven't enabled the RTT backend for debug logging in the sdk_config.h file of your project (it might try to use UART by default). Make sure that the following configs are set to these values in your sdk_config.h file:

    NRF_LOG_BACKEND_RTT_ENABLED 1
    NRF_LOG_BACKEND_UART_ENABLED 0
    NRF_LOG_ENABLED 1
    NRF_LOG_DEFERRED 0  //(try both 0 and 1)
    NRF_FPRINTF_FLAG_AUTOMATIC_CR_ON_LF_ENABLED 0 //(try both 0 and 1)

    If you'd like I can take a look at your project, but it is a good learning process as well.

    Best regards,

    Simon

Reply
  • Hi

    I'm guessing you haven't enabled the RTT backend for debug logging in the sdk_config.h file of your project (it might try to use UART by default). Make sure that the following configs are set to these values in your sdk_config.h file:

    NRF_LOG_BACKEND_RTT_ENABLED 1
    NRF_LOG_BACKEND_UART_ENABLED 0
    NRF_LOG_ENABLED 1
    NRF_LOG_DEFERRED 0  //(try both 0 and 1)
    NRF_FPRINTF_FLAG_AUTOMATIC_CR_ON_LF_ENABLED 0 //(try both 0 and 1)

    If you'd like I can take a look at your project, but it is a good learning process as well.

    Best regards,

    Simon

Children
  • Hello,

    NO, still same problem i have checked with LOG function configurations also, when comment out the uart_init then it advertising properly and when i uncomment it its not working. so i think in the uart_init() declaration for two UART is not correct so can you please have a look once on uart_init() and let me know any issue with declaration.

    static void uart_init(void)
    {
        uint32_t                     err_code1;
        app_uart_comm_params_t const comm_params1 =
        {
            .rx_pin_no    = RX_PIN_NUMBER,
            .tx_pin_no    = TX_PIN_NUMBER,
            .rts_pin_no   = RTS_PIN_NUMBER,
            .cts_pin_no   = CTS_PIN_NUMBER,
            .flow_control = APP_UART_FLOW_CONTROL_DISABLED,
            .use_parity   = false,
    #if defined (UART_PRESENT)
            .baud_rate    = NRF_UART_BAUDRATE_115200
    #else
            .baud_rate    = NRF_UARTE_BAUDRATE_115200
    #endif
        };
    
         uint32_t                     err_code2;
       app_uart_comm_params_t const comm_params2 =
        {
            .rx_pin_no    = RX_PIN1,
            .tx_pin_no    = TX_PIN1,
            .rts_pin_no   = RTS_PIN_NUMBER,
            .cts_pin_no   = CTS_PIN_NUMBER,
            .flow_control = APP_UART_FLOW_CONTROL_DISABLED,
            .use_parity   = false,
    #if defined (UART_PRESENT)
            .baud_rate    = NRF_UART_BAUDRATE_115200
    #else
            .baud_rate    = NRF_UARTE_BAUDRATE_115200
    #endif
        };
    
        APP_UART_FIFO_INIT(&comm_params1,
                           UART_RX_BUF_SIZE,
                           UART_TX_BUF_SIZE,
                           uart_event_handle,
                           APP_IRQ_PRIORITY_LOWEST,
                           err_code1);
        APP_ERROR_CHECK(err_code1);
    
         APP_UART_FIFO_INIT(&comm_params2,
                           UART_RX_BUF_SIZE,
                           UART_TX_BUF_SIZE,
                           uart_event_handle,
                           APP_IRQ_PRIORITY_LOWEST,
                           err_code2);
        APP_ERROR_CHECK(err_code2);
    }

    thank you.

Related