I'm using the example examples/peripheral/usbd_ble_uart
on a nRF42840 USB dongle (pca10059).
As client (central) I'm using nrfconnect on an Android phone.
Connecting to the peripheral and sending data onto the UART RX channel works fine, as long as data length doesn't exceed the maximum MTU (hardcoded to 64bytes in the example).
Example output:
<info> nrf_ble_gatt: Requesting to update ATT MTU to 64 bytes on connection 0x0.
<info> app: BLE NUS connected
<info> app: Data len is set to 0x3D(61)
<info> app: CDC ACM unavailable, data received: 123456789012345678901234567890123456789012345678901234567890
If I exceed that 64bytes limit, though, the device hard faults with:
<error> app: ERROR 7 [NRF_ERROR_INVALID_PARAM] at ../../../main.c:481
PC at: 0x00031F33
<error> app: End of error report
While this is probably to be expected(?), I'm missing a hint how to do it right.
By right I mean:
best case) how to still be able to receive that data (e.g. as multiple packets each not exceeding the MTU)
worst case) discard data and/or disconnect from the central or alike, but stay operational for the next connection request
..but not hard fault.
Thanks!