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

app_ble_uart example not initializing BLE on nRF52DK PCA10040 SDKv16 and S132 soft device

Hi

I am trying to get the ble_app_uart to run on my nRF52DK with the nRF52832 on board. I am using SDK version 16 and SoftDevice version 132.

When compile and download the program, i do not see it advertising as it is not visible in the scanned device list on the nRF Connect app on my iPad.

Upon debugging, I find that during initialization in main(), the program seems to run into an error and goes to the app_error_weak() function and stays there.

The call stack shows that it arrived there from the following function - APP_ERROR_CHECK(err_code) after bsp_init() funct

<code>

static void buttons_leds_init(bool * p_erase_bonds)
{
    bsp_event_t startup_event;

    uint32_t err_code = bsp_init(BSP_INIT_LEDS | BSP_INIT_BUTTONS, bsp_event_handler);
    APP_ERROR_CHECK(err_code);

    err_code = bsp_btn_ble_init(NULL, &startup_event);
    APP_ERROR_CHECK(err_code);

    *p_erase_bonds = (startup_event == BSP_EVENT_CLEAR_BONDING_DATA);
}
</code>

Since there were no logging calls in place in the code until this point, there was no information on the Debug terminal.  I will put in some logging calls to indicate the status of the execution and post it here soon.

PS: To confirm if the hardware is ok, I downloaded the LED_blinky example and it works fine - i am able to see the blinky device on the nRF LED_Blinky app on my iPad and communicate with it.

So it appears the problem is happening only with this example, which sounds strange. I haven't made any changes yet, just using the default example code. 

Regards

Sreenivasa Chary

Parents Reply Children
  • Hi Sreenivasa, 

    After loading images, did you press   again to run? What is the log you see in the Debug Terminal window? Did you see LED1 blinking  (BSP_INDICATE_CONNECTED)? If not, Could you flash the image with nRF Connect Programmer or Command Line Tools with the following commands:

    nrfjprog --family NRF52 --program s132_nrf52_7.0.1_softdevice.hex --chiperase --verify
    C:\Users\amhs\Downloads\nRF5_SDK_16.0.0_98a08e2\examples\ble_peripheral\ble_app_uart\hex
    nrfjprog --family NRF52 --program ble_app_uart_pca10040_s132.hex --sectorerase --verify
    nrfjprog -r

    Did you see LED1 blinking (BSP_INDICATE_CONNECTED)?

    -Amanda H.

  • Yes Amanda, I did press the Play button to start the target running, but as i mentioned, there are no NRF_LOG() statements in the code prior to the hanging point. So the debug terminal was empty. I will try to program as you said , from the nrfConnect tool and check again, will revert to you asap......

    REgards

    Chary BS

  • Hi Sreenivasa, 

    SChary said:
    Yes Amanda, I did press the Play button to start the target running, but as i mentioned, there are no NRF_LOG() statements in the code prior to the hanging point.

     That's strange. The default setting of NRF_LOG_BACKEND_RTT_ENABLED is 1. Could you check the sdk_config.h as

    //==========================================================
    // <e> NRF_LOG_BACKEND_RTT_ENABLED - nrf_log_backend_rtt - Log RTT backend
    //==========================================================
    #ifndef NRF_LOG_BACKEND_RTT_ENABLED
    #define NRF_LOG_BACKEND_RTT_ENABLED 1
    #endif

    Could you also try to reset the board by turning off and on the power switch? 

    -Amanda H. 

  • Yes, I configured the RTT backend and NRF_LOGGING settings using the CMSIS configuration tool. I also tried power cycling the board. Slight smile

    i am trying to find out where exactly it is getting stuck -will share the details shortly...

    Regards

    Sreenivasa Chary

  • Hi Amanda,

    I found the cause of the issue, in app_button.c, in function app_button_init(),

    there is this call ,

     err_code = nrf_drv_gpiote_in_init(p_btn->pin_no, &config, gpiote_event_handler);

    which is in file nrfx_gpiote.c

    There, in the pin/channel allocation logic, for Pin number = 13 (0x0d) the code hits line 557:

    err_code = NRFX_ERROR_NO_MEM;

    Therefore, when it returns with this error (code 0x04), the next line in app_button_init() 

    line 298 :

    VERIFY_SUCCESS(err_code);

    is failing. And the system is going to NRF_BREAKPOINT_CND in app_error_weak.c

    I saw in another post, a similar report by some one else, but he was able to get the debug log where it suggested the solution - to modify the memory allocation. However, in my case i do not see any such log.

    What should i modify to overcome this condition?

    Regards

    Chary BS

Related