Skip to content

nrf52840: BLE Connection resets if sent data lenght is bigger than MTU size  #8548

@wlamprecht

Description

@wlamprecht

Description

Tagret: Nordic nRF52840
Toolchain: mbed cli 1.7.5, arm-gcc

Source code changes:
in mbed-os/features/FEATURE_BLE/ble/services/UARTService.h:
change BLE_UART_SERVICE_MAX_DATA_LEN to 40
static const unsigned BLE_UART_SERVICE_MAX_DATA_LEN = 40;

How to reproduce:
Flash Nordic BLE UART Service (https://os.mbed.com/teams/Bluetooth-Low-Energy/wiki/UART-access-over-BLE) to nrf52840
Connect to BLE UART service with nrfConnect Android App
Send a packet bigger than MTU sixe (23) and smaller than BLE_UART_SERVICE_MAX_DATA_LEN (40) to the device (RX Characteristic)

Outcome on mesage GATT_EVENT_WRITE_AUTHORIZATION_REQ:

In file mbed-os/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF52/source/nRF5xGattServer.cpp
int characteristicIndex = resolveValueHandleToCharIndex(handle_value); is -1
this causes a target reset in line
uint16_t write_authorization = p_characteristics[characteristicIndex]->authorizeWrite(&cbParams);

Issue request type

[ ] Question
[ ] Enhancement
[x] Bug

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions