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

Merging nRF52 blinky into uart for peripheral as well as central role.

I'm merging nRF5_SDK_17.0.2_d674dde\examples\ble_peripheral\ble_app_blinky\pca10040\s132\ses to nRF5_SDK_17.0.2_d674dde\examples\ble_peripheral\ble_app_uart\pca10040\s132\ses, but getting error. Also, I want to merge nRF5_SDK_17.0.2_d674dde\examples\ble_central\ble_app_blinky_c\pca10056\s140\ses to nRF5_SDK_17.0.2_d674dde\examples\ble_central\ble_app_uart_c\pca10056\s140\ses. Can anybody help me? or If their already merged then it will be benefit.

Please find below error screenshot,

Parents
  • Hi,

    I don't think we have any ready examples that merges ble_app_blinky and ble_app_uart.

    If you can upload your project here, then I will take a look at what's missing.

  • Hi,

    Please find below link to download the project:

    https://smetgroup-my.sharepoint.com/:u:/g/personal/megha_choudhari_mysmindia_com/ESMV-B9MJLdEvC0eyhJ2ghgBXCsVIT4OQg3A2CFfrWDq9w?e=lYWprR

    Added comments with //03/05/21 for easy understanding of changes, I have merged - 

    1. ble_peripheral - ble_app_blinky into ble_app_uart

    2. ble_central -  ble_app_blinky_c into ble_app_uart_c 

    Now both project builds successfully but enable to connect ble_app_uart to ble_app_uart_c. Also, the advertising, connection LED status not visible.

    Checked in debug mode both goes to NRF_BREAKPOINT_COND; in app_error_weak.c file

    Looking forward for your reply.

    Regards,

    Megha Choudhari

  • Hi,

    Checked by doing this changes in peripheral code. Now able discover on nRF tool box. But not connects with Central ble_app_uart_c(nRF52840)

    What will be the changes required in central side. Can you just check in same sdk & let me know.

    Regards,

  • MeghaC said:

    What will be the changes required in central side. Can you just check in same sdk & let me know.

     For the central, the first steps to get it to connect is:
    in sdk_config.h set these:

    NRF_BLE_SCAN_NAME_CNT to 1
    NRF_SDH_BLE_VS_UUID_COUNT to 2

    You then will get this in the log:
    <warning> nrf_sdh_ble: Change the RAM start location from 0x20002A38 to 0x20002A48.
    <warning> nrf_sdh_ble: Maximum RAM size for application is 0x3D5B8.

    So you need to set these values for the linker:

    RAM_START=0x20002A48
    RAM_SIZE=0x3D5B8

  • Hi,

    Done changes suggested on central side also, now peripheral getting connected with central device. Please find below screenshot for your reference.

    But when I'm pressing button from peripheral the LED from central should turn ON. This is not happening.

    I have added all necessary logic from ble_app_blinky to ble_app_uart & from ble_app_blinky_c to ble_app_uart_c.

    If I missed out anything, kindly suggest me. My sdk is already with you. I have maked peripheral as nRF52832 DK & central as nRF52840 DK.

    Waiting for your reply.

    Thanks for your valuable guidance.

    Regards,

    Megha Choudhari

  • Hi, 

    Also I have observed while debugging that the when switch pressed from peripheral it again goes to NRF_BREAKPOINT_COND;

    Why it so?

    Regards,

    Megha Choudhari

  • MeghaC said:

    But when I'm pressing button from peripheral the LED from central should turn ON. This is not happening.

     I took a look at the code, in db_disc_handler() you need to add ble_lbs_on_db_disc_evt(&m_ble_lbs_c, p_evt); , so that the function looks like this:

    /**@brief Function for handling database discovery events.
     *
     * @details This function is a callback function to handle events from the database discovery module.
     *          Depending on the UUIDs that are discovered, this function forwards the events
     *          to their respective services.
     *
     * @param[in] p_event  Pointer to the database discovery event.
     */
    static void db_disc_handler(ble_db_discovery_evt_t * p_evt)
    {
        ble_nus_c_on_db_disc_evt(&m_ble_nus_c, p_evt);
        ble_lbs_on_db_disc_evt(&m_ble_lbs_c, p_evt);
    }

     

    MeghaC said:

    Also I have observed while debugging that the when switch pressed from peripheral it again goes to NRF_BREAKPOINT_COND;

     This did not happen when I tested here. Maybe this will be resolved when you fix the db_disc_handler() function.

Reply
  • MeghaC said:

    But when I'm pressing button from peripheral the LED from central should turn ON. This is not happening.

     I took a look at the code, in db_disc_handler() you need to add ble_lbs_on_db_disc_evt(&m_ble_lbs_c, p_evt); , so that the function looks like this:

    /**@brief Function for handling database discovery events.
     *
     * @details This function is a callback function to handle events from the database discovery module.
     *          Depending on the UUIDs that are discovered, this function forwards the events
     *          to their respective services.
     *
     * @param[in] p_event  Pointer to the database discovery event.
     */
    static void db_disc_handler(ble_db_discovery_evt_t * p_evt)
    {
        ble_nus_c_on_db_disc_evt(&m_ble_nus_c, p_evt);
        ble_lbs_on_db_disc_evt(&m_ble_lbs_c, p_evt);
    }

     

    MeghaC said:

    Also I have observed while debugging that the when switch pressed from peripheral it again goes to NRF_BREAKPOINT_COND;

     This did not happen when I tested here. Maybe this will be resolved when you fix the db_disc_handler() function.

Children
Related