2017-08-03 11:25 AM
Hi,
I am building an application using an STM32L4 and a BLUENRG-MS. I have an GATT server application that can happily connect and ping pong messages with a GATT client. The client sends a ping on one characteristic, and my application sends a response on a different characteristic by doing a characteristic update. After a while it seems that something changes on the client, and the characteristic update call leads to a hard fault on the STM32L4, while it is deep within the BlueNRG stack. Can someone tell me what is happening? Is there a way to tell if a characteristic is ready to be updated before actually doing so? Is there a known issue in the BlueNRG stack that leads to hard faults?
Ricardo
Solved! Go to Solution.
2017-08-31 07:29 AM
I'm posting this as a reference, because this was not easy for me to figure out. The problem was I was trying to send data on one characteristic in the attribute modified event handler for another. The stack does not tolerate this, and tries to dereference a null pointer as it's removing a node from it's internal linked list. It would be nice if the stack was more robust to such a thing, and I suggest that STM improve this in the next stack release. My solution was to make sure that I used a different thread to do the characteristic update, and everything worked fine. HTH.
Ricardo
2017-08-31 07:29 AM
I'm posting this as a reference, because this was not easy for me to figure out. The problem was I was trying to send data on one characteristic in the attribute modified event handler for another. The stack does not tolerate this, and tries to dereference a null pointer as it's removing a node from it's internal linked list. It would be nice if the stack was more robust to such a thing, and I suggest that STM improve this in the next stack release. My solution was to make sure that I used a different thread to do the characteristic update, and everything worked fine. HTH.
Ricardo