Skip to content

Commit

Permalink
samples: subsys: nvs: Print rc on errors
Browse files Browse the repository at this point in the history
So that the user gets a hint of what the problem can be.

Signed-off-by: Lluis Campos <lluis.campos@northern.tech>
  • Loading branch information
lluiscampos authored and carlescufi committed Aug 26, 2024
1 parent ffd065f commit 1973bc5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions samples/subsys/nvs/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,15 @@ 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;
fs.sector_count = 3U;

rc = nvs_mount(&fs);
if (rc) {
printk("Flash Init failed\n");
printk("Flash Init failed, rc=%d\n", rc);
return 0;
}

Expand Down

0 comments on commit 1973bc5

Please sign in to comment.