1 of 1 people found this helpful
Strings are stored as nonzero characters followed by a null character which is equal to 00. If you are not writing the 00 to flash, then the code will read the string from memory and will keep reading characters until it hits the null character from the initialization value of "default"0x00
Things to try:
Make sure to write the null character of the string to flash as well.
Try checking if there is already a value in memory before reading/writing/using the value, otherwise you might be overwriting it without checking if it is no longer the default value.
Thanks that was indeed the problem.
Other think to care is that the Device name in the configuration UI have to be longer or equal at the device name replacment otherwise it is cut (same characters number than the Device name in the configuration UI).
Yep. That is commented in the function documentation, but mentioning it is helpful too.
If you write the advertisement packet yourself you won't have that issue, but if you want a longer possible name you can start with a really long default name, and then shorten it on bootup/initialization.