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

SDK15.2.0 firmware crashing if more than 21 bytes sent from the nrf connect app.

Earlier with SDK 13 in custom advertisement I was able to send 30 bytes under unknown characteristics tab in Nrf connect APP but in SDK 15 I am not. Because the firmware or app getting stuck if I sen more than  bytes.

  • You can comment that. ,Or you take Ble App Uart example sdk15, make all uuids zero, remove flags and then try. 

  • I tested your sample and saw the same behavior as you. If I send more than 20 bytes (21) from the nRF Connect App, it is not received by the application.

    However, I tested the ble_app_uart example, and it was possible to send more than 20 bytes. 

    I am not sure what the issue is with your application, but I will investigate further.

    However, before I investigate any more, could you do the following:

    • Flash nRF5_SDK_15.2.0_9412b96\examples\ble_peripheral\ble_app_uart\hex\ble_app_uart_pca10040_s132.hex onto an nRF52832
    • Open J-Link RTT Viewer and check if you get "00> <info> app: Data len is set to 0xF4(244)"
    • Also, try to connect with the nRF Connect App and send more than 20 bytes
      • Check with e.g. UART to see the UART printf log

    I am quite busy at the moment, but I will try to get to the bottom of it as soon as possible.

    Best regards,

    Simon

  • Are you able to receive those more than 20 bytes in the device?

  • No, with your code, I am not able to receive more than 20 bytes. The nus_data_handler() doesn't run if 21 bytes I sent from the nRF Connect App. I will investigate further and try to provide you with an answer on Monday (6/8/2020).

    Best regards,

    Simon

  • I figured out what was causing the issue.

    In main.c ble_evt_handler()→BLE_GAP_EVT_SEC_PARAMS_REQUEST, you have commented out sd_ble_gap_sec_params_reply(). Try changing it to:

    static void ble_evt_handler(ble_evt_t const * p_ble_evt, void * p_context)
    {
    .
    .
    .
        case BLE_GAP_EVT_SEC_PARAMS_REQUEST:
        	printf("BLE_GAP_EVT_SEC_PARAMS_REQUEST");
            // Pairing not supported
            err_code = sd_ble_gap_sec_params_reply(m_conn_handle, BLE_GAP_SEC_STATUS_PAIRING_NOT_SUPP, NULL, NULL);
            APP_ERROR_CHECK(err_code);
            break;
    .
    .
    }

    I did this and was able to send 21 bytes from the nRF Connect App.

    Best regards,

    Simon

Related