2024-03-21 09:51 AM
Hi,
I am writing a client/server application for STM32WB55. Server behavior is ok. On client side, I connect to a peripheral and try to send 32 bytes packets every 100 ms on peripheral's RX characteristic using aci_gatt_write_without_response function. MTU is set to 156. Nevertheless most of the time the function return with error code 0x64 (insufficient resource). The application is connected to 1 peripheral only, no advertising. I didn't find any helpful information.
Any idea? Any orientation for investigation?
Thanks,
Jacques
Solved! Go to Solution.
2024-03-27 02:19 AM
Hello,
Thanks a lot for your advices.
Finally I found that the parameters I used for the connection (aci_gap_create_connection) were not suitable. For example the connection intervals (min & max) were too high in comparison to the frequency of the call of the aci_gatt_write_without_response function. This is detailed in chapter 6 of the PM0271 document.
I hope this can help someone else also.
Regards.
2024-03-26 01:55 AM
Hello @JGM ,
The error indicates that the BLE stack on your STM32WB55 client device does not have enough resources to perform the requested operation at the time the aci_gatt_write_without_response function is called. This could be due to various reasons, such as buffer constraints, timing issues, or limitations in the BLE stack's concurrency management.
Here are some considerations to help you resolve the issue:
- Ensure that the buffer sizes allocated for GATT operations are sufficient for your needs.
- Check if there is a way to query the BLE stack for buffer availability before attempting to send a packet.
- The BLE stack may have limitations on the number of concurrent GATT operations that can be processed. Sending data too quickly might exceed this limit.
- Instead of sending packets strictly every 100 ms, consider implementing a dynamic delay that adjusts based on the success or failure of the previous write operation.
Best Regards.
2024-03-27 02:19 AM
Hello,
Thanks a lot for your advices.
Finally I found that the parameters I used for the connection (aci_gap_create_connection) were not suitable. For example the connection intervals (min & max) were too high in comparison to the frequency of the call of the aci_gatt_write_without_response function. This is detailed in chapter 6 of the PM0271 document.
I hope this can help someone else also.
Regards.