This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

When does the SoftDevice update characteristic memory?

If I let the SoftDevice write to my variables directly by having the characteristics point to my app's variables through BLE_GATTS_VLOC_USER - when are these variables actually updated?

Assume I have some calculation running with a couple of variables which logically depend on each other, i.e. need to be consistent. Can that calculation be interrupted by the SoftDevice in a way such that my calculation becomes inconsistent because the SoftDevice interfered and magically changed my variables in the middle of a running calculation that then continues after the SoftDevice interrupt returns?

I believe I have this problem since I have been using BLE_GATTS_VLOC_USER. Before I used BLE_GATTS_VLOC_STACK and queued the write events with the app scheduler. Then I changed to BLE_GATTS_VLOC_USER because it was suggested here. Essentially, I am looking for a way that my variables get updated via Bluetooth in the main, not interrupt context, but I also don't want to write = maintain any code doing those updates. I am afraid of writing more of the app scheduler queueing code because I will have around 30 characteristics in the end - how can I have the SoftDevice update my variables directly in the main context without writing app scheduler code and without using BLE_GATTS_VLOC_STACK as a cache creating too much RAM usage (want the app to run on the 16 KB variant of the chip too).

Parents Reply Children
No Data
Related