You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
from the hex view, we can see that the size is error, actural length of "中文" is 7, but the wrong length in nvs.bin is 3, so I double checked by some simple program to read the key-value item which is failed.
btw, by the original nvs_partition_gen.py, I tried everything, eg string, binary, hex2bin, every method can wrote the utf-8, but nothing can read from the nvs library (ESP_ERR_NVS_NOT_FOUND)
Describe the solution you'd like.
after all, i reviewed the nvs_partition_gen.py file and did little modification with AI, it seems like
defwrite_entry(self, key, value, encoding):
# Encoding-specific handlingifencoding=='hex2bin':
value=value.strip()
iflen(value) %2!=0:
raiseInputError('%s: Invalid data length. Should be multiple of 2.'%key)
value=binascii.a2b_hex(value)
elifencoding=='base64':
value=binascii.a2b_base64(value)
elifencoding=='string':
iftype(value) ==bytes:
value=value.decode()
value+='\0'value=value.encode("utf-8") # added line
everything is ok now.
did I need to add a PR to the resposity ?
Describe alternatives you've considered.
No response
Additional context.
No response
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem?
in components\nvs_flash\nvs_partition_generator folder, sample_val.csv is working well
I change some string to utf-8 as following,
then generate the nvs binary file by
from the hex view, we can see that the size is error, actural length of "中文" is 7, but the wrong length in nvs.bin is 3, so I double checked by some simple program to read the key-value item which is failed.
btw, by the original nvs_partition_gen.py, I tried everything, eg string, binary, hex2bin, every method can wrote the utf-8, but nothing can read from the nvs library (ESP_ERR_NVS_NOT_FOUND)
Describe the solution you'd like.
after all, i reviewed the nvs_partition_gen.py file and did little modification with AI, it seems like
everything is ok now.
did I need to add a PR to the resposity ?
Describe alternatives you've considered.
No response
Additional context.
No response
The text was updated successfully, but these errors were encountered: