Hi we worked to DA14585 with peripheral mode. We use ble_app_peripheral_example in SDK. In the example we deleted service-2, service-3 and excluded DISS. We habe only 1 service and 1 characterictic with PERM(WR, ENABLE) | PERM(WRITE_REQ, ENABLE).
Our service definition like that
const struct attm_desc_128 custs1_att_db[CUSTS1_IDX_NB] =
{
/*************************
* Service 1 configuration
*************************
*/
// Service 1 Declaration
[SVC1_IDX_SVC] = {(uint8_t*)&att_decl_svc, ATT_UUID_128_LEN, PERM(RD, ENABLE),
sizeof(custs1_svc1), sizeof(custs1_svc1), (uint8_t*)&custs1_svc1},
// Long Value Characteristic Declaration
[SVC1_IDX_LONG_VALUE_CHAR] = {(uint8_t*)&att_decl_char, ATT_UUID_16_LEN, PERM(RD, ENABLE),
0, 0, NULL},
// Long Value Characteristic Value
[SVC1_IDX_LONG_VALUE_VAL] = {SVC1_LONG_VALUE_UUID_128, ATT_UUID_128_LEN, PERM(WR, ENABLE) | PERM(WRITE_REQ, ENABLE),
400, 0, NULL},
};
We compiled application and load the da14585. Then for test we connect to our device. (with a android phone with nrf connect test application) We can write from client device to server device (in this case server da14585) various length messages. 5 bytes, 20 bytes, 200 bytes, 270 bytes that all tests ok. But if we want to write more than 285 bytes; our test application ( nrf connect) disconnected from DA14585 (with GATT_ERROR and GATT_CONN_TIMEOUT) and DA14585 doesn't sense this case.
Questions :
- How can i sense this case in DA14585 ?
- how can i increment GATT_CONN_TIMEOUT ? ( i increased/decreased Supervision timeout in user_config.h but don't change anything)
Thank you...
Hi ltdev,
I assume that this question is related with the below forum ticket :
https://support.dialog-semiconductor.com/forums/post/dialog-smartbond-bluetooth-low-energy-%E2%80%93-software/gatt-peripheral-mode-write-char-size
Thanks, PM_Dialog
Hi;
- We have only uart on our custom board. So that we can't debug it with jtag.
- I add some printf messages in user_app_connection and user_app_disconn
{
// Service 1 Declaration
[SVC1_IDX_SVC] = {(uint8_t*)&att_decl_svc, ATT_UUID_128_LEN, PERM(RD, ENABLE),
sizeof(custs1_svc1), sizeof(custs1_svc1), (uint8_t*)&custs1_svc1},
// Long Value Characteristic Declaration
[SVC1_IDX_LONG_VALUE_CHAR] = {(uint8_t*)&att_decl_char, ATT_UUID_16_LEN, PERM(RD, ENABLE),
0, 0, NULL},
// Long Value Characteristic Value
[SVC1_IDX_LONG_VALUE_VAL] = {SVC1_LONG_VALUE_UUID_128, ATT_UUID_128_LEN, PERM(WR, ENABLE) | PERM(WRITE_REQ, ENABLE),
400, 0, NULL},
};
in the beginnin we have 2 problems
1- When i define the structure that;
{
// Service 1 Declaration
[SVC1_IDX_SVC] = {(uint8_t*)&att_decl_svc, ATT_UUID_128_LEN, PERM(RD, ENABLE),
sizeof(custs1_svc1), sizeof(custs1_svc1), (uint8_t*)&custs1_svc1},
// Long Value Characteristic Declaration
[SVC1_IDX_LONG_VALUE_CHAR] = {(uint8_t*)&att_decl_char, ATT_UUID_16_LEN, PERM(RD, ENABLE),
0, 0, NULL},
// Long Value Characteristic Value
[SVC1_IDX_LONG_VALUE_VAL] = {SVC1_LONG_VALUE_UUID_128, ATT_UUID_128_LEN, PERM(WR, ENABLE) | PERM(WRITE_REQ, ENABLE),
50, 0, NULL},
};
In this case i try to write 51 bytes to characteristic i get ATTR_LEN_ERR. After thar i changed 50 bytes to 400 bytes. And that problem solved.
2-) After solved problem-1 i define my service structure like that
{
// Service 1 Declaration
[SVC1_IDX_SVC] = {(uint8_t*)&att_decl_svc, ATT_UUID_128_LEN, PERM(RD, ENABLE),
sizeof(custs1_svc1), sizeof(custs1_svc1), (uint8_t*)&custs1_svc1},
// Long Value Characteristic Declaration
[SVC1_IDX_LONG_VALUE_CHAR] = {(uint8_t*)&att_decl_char, ATT_UUID_16_LEN, PERM(RD, ENABLE),
0, 0, NULL},
// Long Value Characteristic Value
[SVC1_IDX_LONG_VALUE_VAL] = {SVC1_LONG_VALUE_UUID_128, ATT_UUID_128_LEN, PERM(WR, ENABLE) | PERM(WRITE_REQ, ENABLE),
400, 0, NULL},
};
In this case i can write to characteristic up to 285 bytes. When i was try to write more than 285 bytes; my client device (in test case nrf connect application on android) got GATT_TIMEOUT_ERR and disconnected. But my server device (DA14585 custom board) dont sense this disconnected state. So that dont start advertise again. And i can not connect it again.
I hope that message clearly.
Respect...
Hi ltdev,
Are you booting from an external SPI flash or from the System-RAM?
If you are booting from System-RAM and the device does nothing, this means that is frozen into an assertion, or the WDOG is expired or an NMI has been occurred.
You can verify this by booting from the SPI flash and you will see that the device reboots.
You should run the project somehow in debug mode and try to find where the code freezes. Otherwise we cannot know what the root cause of the issue is.
Do you have any of Dialog DKs? Since you don’t have a JTAG interface on you board, you can use any of the Dialog DK. All DA145xx Development Kits contain a Segger J-Link device that provides Serial Wire Debug (SWD) capability.
http://lpccs-docs.dialog-semiconductor.com/Tutorial_SDK6/debug_probe.html
Thanks, PM_Dialog
Hi i solved the the problem without j-link
Thank you
Hi ltdev,
Glad that you solve this issue. If you have any other follow up question, please create a new forum post.
Thanks, PM_Dialog