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
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
Please ignore this. It was a problem on our side of implementation. Thanks for your support