esp32<|s2|s3>_board_spiflash: Fix error message about SmartFS init

The SmartFS partition needs to be formatted before being mounted.
Otherwise, it would throw an error message. The error message now
contains a suggestion to format the partition when such an error
is detected.
This commit is contained in:
Tiago Medicci Serrano
2023-12-12 09:56:28 -03:00
committed by Xiang Xiao
parent 6c4b30736e
commit 908bac55f3
3 changed files with 18 additions and 0 deletions
@@ -204,6 +204,12 @@ static int setup_smartfs(int smartn, struct mtd_dev_s *mtd,
if (ret < 0)
{
ferr("ERROR: Failed to mount the FS volume: %d\n", ret);
if (ret == -ENODEV)
{
fwarn("Smartfs seems unformatted. "
"Did you run 'mksmartfs /dev/smart%d'?\n", smartn);
}
return ret;
}
}
@@ -115,6 +115,12 @@ static int setup_smartfs(int smartn, struct mtd_dev_s *mtd,
if (ret < 0)
{
ferr("ERROR: Failed to mount the FS volume: %d\n", ret);
if (ret == -ENODEV)
{
fwarn("Smartfs seems unformatted. "
"Did you run 'mksmartfs /dev/smart%d'?\n", smartn);
}
return ret;
}
}
@@ -106,6 +106,12 @@ static int setup_smartfs(int smartn, struct mtd_dev_s *mtd,
if (ret < 0)
{
ferr("ERROR: Failed to mount the FS volume: %d\n", ret);
if (ret == -ENODEV)
{
fwarn("Smartfs seems unformatted. "
"Did you run 'mksmartfs /dev/smart%d'?\n", smartn);
}
return ret;
}
}