Since Stack 2.3.0 we have trouble sending multiple notifications without much delay in between them with a bgm111. The stack behaves unpredictably after that. In earlier stacks there were not these problems, Just error returns by gecko_cmd_gatt_server_send_characteristic_notification(). The limit seems to be around 256 bytes of total notification data.
I have not checked with a separate testing app yet but I suspect
What is the best we can do to avoid such problems?
We are using gcc + makefile build.
Have you tried the patch to 2.3.1? There was a bug fix related to connection times. It could be that it affects the issue that you're seeing as well.
Please try and let us know if that helps.
Do you mean 2.3.1 or any patch on top of that? With 2.3.1 I have also that problem.
That problem does not exist with 2.1.1.
I meant the latest, which is now 2.3.2. I looked over the latest release notes and there's nothing specific mentioned about this issue so I think the best thing to do is to send in a project that can reproduce the problem. If you don't want to publish your code in the public forum here, you can make a ticket in our support portal.
I have tested 2.3.2 and 2.4.0. Same problem. I have not reproduced it yet with a small piece of code.
If the cause is memory corruption somewhere, there also needs to be something to be corrupted. So probably a little bit more testing code is required.
found the solution:
+uint8_t bluetooth_stack_heap[DEFAULT_BLUETOOTH_HEAP(MAX_CONNECTIONS) + 1024];
So the memory used by the stack has been greatly increased.
If you issue multiple send_notification commands right after each other you may get a memory overflow (messages are sent out in a slower rate than they are written). To handle this exception, currently you should call the gecko_peek_event() function between two consecutive call of send_notification - even if there are no expected events at all. Let me know, if this solves your issue.
doing gatt_peek_event() between notifications does not improve the situation.
So the easiest solution seems just increase the bluetooth heap size.