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

Problem in Init. ESB service

Hi Bro

I have a project need to use BLE + ESB Concurrently, actually I have did it in my previous project

but seems it has problem in new SDK

In my old project: SDK11, S132 , nrf52832, its work sucessfully

Now, I use SDK15.3.0, S132, nrf52832, it has problem in basic setup. Same as before, I setup a UART and a service for ESB by code below

I think its standard code, and its build success, and then download and run

2 function also get error code in " APP_ERROR_CHECK(err_code);" and program reset.

did anyone have idea about it?

Best Regards

Dannis

//==========================================================

static void uart_init(void)
{
    uint32_t                     err_code;
    app_uart_comm_params_t const comm_params =
    {
        .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_ENABLED,
        .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_params,
                       UART_RX_BUF_SIZE,
                       UART_TX_BUF_SIZE,
                       uart_event_handle,
                       APP_IRQ_PRIORITY_LOWEST,
                       err_code);
   APP_ERROR_CHECK(err_code);
}

//==========================================================

static void esb_Service_init(void)
{
    ret_code_t         err_code;
    ble_nus_init_t     nus_init;
    // Initialize NUS.
    memset(&nus_init, 0, sizeof(nus_init));

    nus_init.data_handler = nus_data_handler;

    err_code = ble_nus_init(&m_nus, &nus_init);
    APP_ERROR_CHECK(err_code);
}

Parents
  • Hi,

    2 function also get error code in " APP_ERROR_CHECK(err_code);" and program reset.

    What is the value of err_code? What function returned the error code ?

    If the preprocessor symbol DEBUG is defined, the device will not reset when it encounters an error, and the error code will instead be printed with nrf_log (with either UART or RTT as backend). If you use SES IDE, just change the project configuration from release to debug. If you are on Keil, you need add DEBUG as a preprocessor symbol.

Reply
  • Hi,

    2 function also get error code in " APP_ERROR_CHECK(err_code);" and program reset.

    What is the value of err_code? What function returned the error code ?

    If the preprocessor symbol DEBUG is defined, the device will not reset when it encounters an error, and the error code will instead be printed with nrf_log (with either UART or RTT as backend). If you use SES IDE, just change the project configuration from release to debug. If you are on Keil, you need add DEBUG as a preprocessor symbol.

Children
No Data
Related