samples: subsys: nvs: Print rc on errors

So that the user gets a hint of what the problem can be.

Signed-off-by: Lluis Campos <lluis.campos@northern.tech>
This commit is contained in:
Lluis Campos 2024-08-22 14:40:07 +02:00 committed by Carles Cufí
parent ffd065f93e
commit 1973bc565f
1 changed files with 2 additions and 2 deletions

View File

@ -86,7 +86,7 @@ int main(void)
fs.offset = NVS_PARTITION_OFFSET;
rc = flash_get_page_info_by_offs(fs.flash_device, fs.offset, &info);
if (rc) {
printk("Unable to get page info\n");
printk("Unable to get page info, rc=%d\n", rc);
return 0;
}
fs.sector_size = info.size;
@ -94,7 +94,7 @@ int main(void)
rc = nvs_mount(&fs);
if (rc) {
printk("Flash Init failed\n");
printk("Flash Init failed, rc=%d\n", rc);
return 0;
}