Closed SamiLappalainenArm closed 6 years ago
compiling with GCC_ARM gives following output (seems to work correctly)
--- Mbed OS filesystem example --- Mounting the filesystem... OK Opening "/fs/numbers.txt"... OK Incrementing numbers (10/10)... OK Closing "/fs/numbers.txt"... OK Opening the root directory... OK root directory: . .. numbers.txt Closing the root directory... OK Opening "/fs/numbers.txt"... OK numbers: 5 3 4 5 6 7 8 9 10 11 Closing "/fs/numbers.txt"... OK Unmounting... OK Mbed OS filesystem example done! --- Mbed OS filesystem example --- Mounting the filesystem... OK Opening "/fs/numbers.txt"... OK Incrementing numbers (10/10)... OK Closing "/fs/numbers.txt"... OK Opening the root directory... OK root directory: . .. numbers.txt Closing the root directory... OK Opening "/fs/numbers.txt"... OK numbers: 6 4 5 6 7 8 9 10 11 12 Closing "/fs/numbers.txt"... OK Unmounting... OK Mbed OS filesystem example done!
it seems that used filesystem does not have any impact to functionality only used complier has impact to the output
Can you try wiping the storage device by pressing BUTTON1? I've seen before when the storage device gets in a bad state on previous runs the behavior can persist across new binaries.
Do you have this commit as well? Had previously fixed it for both @geky and myself.
Also which block device are you using?
I have used block device definition shown below:
SDBlockDevice bd( MBED_CONF_SD_SPI_MOSI, MBED_CONF_SD_SPI_MISO, MBED_CONF_SD_SPI_CLK, MBED_CONF_SD_SPI_CS);
by pressing Button1 (SW2) before reset does not help:
--- Mbed OS filesystem example --- Mounting the filesystem... Fail :( No filesystem found, formatting... OK Opening "/fs/numbers.txt"... Fail :( No file found, creating a new file... OK Writing numbers (10/10)... OK Seeking file... OK Incrementing numbers (10/10)... OK Closing "/fs/numbers.txt"... OK Opening the root directory... OK root directory: numbers.txt Closing the root directory... OK Opening "/fs/numbers.txt"... OK numbers: 1 1 2 3 4 5 6 7 8 9 Closing "/fs/numbers.txt"... OK Unmounting... OK Mbed OS filesystem example done! Initializing the block device... OK Erasing the block device... OK Deinitializing the block device... OK --- Mbed OS filesystem example --- Mounting the filesystem... OK Opening "/fs/numbers.txt"... OK Incrementing numbers (10/10)... OK Closing "/fs/numbers.txt"... OK Opening the root directory... OK root directory: numbers.txt Closing the root directory... OK Opening "/fs/numbers.txt"... OK numbers: 2 1 2 3 4 5 6 7 8 9 Closing "/fs/numbers.txt"... OK Unmounting... OK Mbed OS filesystem example done!
What's your Mbed OS and Filesystem example commit hash? We can try to debug locally.
@kegilbert I believe it's the same as https://github.com/ARMmbed/mbed-os-example-filesystem/issues/39#issuecomment-374144985
above comment is correct related to used commit hash.
The fix here: 29a91bf is only on master it looks like, it needs to be cherry picked to the oob branch.
@geky
this problem was solved after applying above fix
ARM Internal Ref: MBOTRIAGE-510
Closing since this is resolved.
similar ticket has been closed, https://github.com/ARMmbed/mbed-os-example-filesystem/issues/16
used LittleFileSystem
following output has compiled by using ARM.
--- Mbed OS filesystem example --- Mounting the filesystem... lfs error:469: Corrupted dir pair at 0 1 lfs error:2202: Invalid superblock at 64693 500 Fail :( No filesystem found, formatting... OK Opening "/fs/numbers.txt"... Fail :( No file found, creating a new file... OK Writing numbers (10/10)... OK Seeking file... OK Incrementing numbers (10/10)... OK Closing "/fs/numbers.txt"... OK Opening the root directory... OK root directory: . .. numbers.txt Closing the root directory... OK Opening "/fs/numbers.txt"... OK numbers: 1 1 2 3 4 5 6 7 8 9 Closing "/fs/numbers.txt"... OK Unmounting... OK Mbed OS filesystem example done! --- Mbed OS filesystem example --- Mounting the filesystem... OK Opening "/fs/numbers.txt"... OK Incrementing numbers (10/10)... OK Closing "/fs/numbers.txt"... OK Opening the root directory... OK root directory: . .. numbers.txt Closing the root directory... OK Opening "/fs/numbers.txt"... OK numbers: 2 1 2 3 4 5 6 7 8 9 Closing "/fs/numbers.txt"... OK Unmounting... OK Mbed OS filesystem example done!