Device halts when GATT write requests greater than 13 bytes are given to ble_app_peripheral

⚠️
Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at//www.xmece.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
3 posts / 0 new
Last post
dhrishi
Offline
Last seen:3 years 3 months ago
加入:2017-02-10 09:56
Device halts when GATT write requests greater than 13 bytes are given to ble_app_peripheral

Hi,

I want to handle higher size GATT write requests from a central with the Dialog peripheral. I was facing some problems with my app. So tried using the standard ble_app_peripheral application.

Device: DA14580
SDK: 5.0.4
App: ble_app_peripheral

For that I used the ble_app_peripheral and made one change in it:

#define DEF_CUST1_CTRL_POINT_CHAR_LEN 1
Replaced by
#define DEF_CUST1_CTRL_POINT_CHAR_LEN 14

我编译应用程序。我我们ed nRF app as the central and tried to write 14 bytes to the control point characteristic.
The code reaches here and stops:

if ((GetWord16(SYS_STAT_REG) & DBG_IS_UP) == DBG_IS_UP)
__asm("BKPT #0\n");

Observations:
1. If DEF_CUST1_CTRL_POINT_CHAR_LEN is set to 13, and I write 13 (or less) bytes from the nRF app then it works fine and there are no issues.
2. If DEF_CUST1_CTRL_POINT_CHAR_LEN is set to 14, and I write 13 (or less) bytes from the nRF app then it works fine and there are no issues.
3. If DEF_CUST1_CTRL_POINT_CHAR_LEN is set to antyhing greater than 14 (say 20), and I write 14 (or more) bytes from the nRF app then the device halts (as shown above)

Could you please let me know what the problem would be. This would be in the SDK, right?

Or am I missing anything. The chances of this should be minimal as everything same works well with len = 13 and write of 13 bytes. It's just that after 13 bytes there is a problem.

Thanks,
Hrishikesh

Device:
MT_dialog
Offline
Last seen:2 months 4 days ago
Staff
加入:2015-06-08 11:34
Hi dhrishi,

Hi dhrishi,

Its the memcpy in the user_custs1_ctrl_wr_ind_handler() that makes the devices stall, i suppose that the 580 ends up in a hardfault,_Handler, if you remove the memcpy you will be ok (apparently when you are writting more than 13 bytes you overwrite significant data) the ARM doesn't like that, thats why it goes in a hardfault handler.

Thanks MT_dialog

dhrishi
Offline
Last seen:3 years 3 months ago
加入:2017-02-10 09:56
Please ignore this. It was a

Please ignore this. It was a problem on our side of implementation. Thanks for your support