4 months, 1 week ago.

MBED crashes on reliable write (BLE)

Hi, we accidentaly used a wrong method to write data to one of our NRF52s, and that led to a crash of mbed. We can just use the right method and everything works as expected, but we dont want the program to crash on any case, even if somebody writes wrong data to us.

I created a very small program to reproduce the error and its very strange, because Im not using a single event, its all just stack / internal handling thats going on, but still MBED crashes. Maybe I found a bug in the BLE stack?

this is a sniff of the crashing write, mbed crashes right after packet 1373. /media/uploads/Jwoerner/bildschirmfoto_2019-02-13_11-33-34.png

here a sniff of the working write procedure: /media/uploads/Jwoerner/bildschirmfoto_2019-02-13_11-32-48.png

you can reproduce the problem, I will add sniffer screenshots as well as the test program. /media/uploads/Jwoerner/mbed_reliablewritecrashtest.cpp

Hi Jonas,

We need more information, please provide below.

What's the Mbed OS version?

What BLE stack are you using?

Could you attach the crash log?

What does "wrong method to write data" mean? I assume I need to use nRF app on mobile to send data to nRF52, but I don't know how to use the wrong method, could you describe more?


posted by Desmond Chen 15 Feb 2019

hi, Mbed OS 5.5 Nordic BLE stack (I believe S132) I dont have the crash log at the moment, but I know the PC register pointed to the MBED fault handler (as always?) and the error decoder said Cortex M Hard fault. The wrong method to write data was an so called "reliable write" on android. If you wish, I can send you an .APK so you can use it for testing. EDIT: I just realized MBED5.5 is not true?! mbed_verison.h: MAJOR: 5 MINOR: 9 PATCH 4

posted by Jonas Woerner 15 Feb 2019
Comment on this question

1 Answer

4 months ago.

Hi Jonas,

We had an issue related to BLE_GATTS_OP_EXEC_WRITE_REQ_NOW, which accesses an invalid memory address and may cause Hard Fault like what you have.

This issue has been fixed in Mbed OS 5.11.1 by below PR,

Could you verify if this solve you problem?

Thanks, Desmond

To post an answer, please log in.