dwm_set_pos or any way to save a bit of state between resets


Using DW1001_Dev boards, I need to be able to alternately make a tag visible or invisible over Bluetooth.

I thought about using the tag position in flash to save a code that determines whether to enable Bluetooth or not (i don’t want to use the ble_enable flag in the config for other reasons).

When my tag is running, I tried setting the position of the tag with dwm_set_pos to a known/coded value and then doing a dwm_reset but the position isn’t being saved when read back with dwm_get_pos (both after reset or immediately after writing), presumably because it’s running as a tag (even though it says in 4.3.1 of the API Guide that it will be stored anyway). For completeness, I have verified the code setting the position is being run with the debugger. First question…is this position setting behavior correct?

Second question, assuming that the position setting behavior above is correct, is it possible to set some bits in flash between resets other than through dwm_cfg_tag_set?