Fix intermittent sync fail in tests-filesystem-general_filesystem #12850
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary of changes
tests-filesystem-general_filesystem declares BlockDevice and FileSystem pointers as globals. If these are initialized to their respective default_instance values in the declaration, the LFS init happens during OS startup when __libc_init_array() is invoked by mbed_toolchain_init().
If the filesystem blockdevice does not currently contain a valid filesystem (e.g. the chip has just been erased), then LFS will flag this as corruption and abort the mounting process.
This cleanup process can take long enough (and is running pre-main) that greentea times out waiting for the device to respond to its sync packet, and resets the device.
To resolve this, move the initialization into the first test case (bd_init_fs_reformat) right before it initializes and formats the blockdevice and filesystem.
Impact of changes
NA
Migration actions required
NA
Documentation
NA
Pull request type
Test results
The sleep test failures are known issues that are being worked on.
The failures on CY8CPROTO_064_SB are an intermittent pyocd programming failure.
GT_FT_KIT_062_BLE_GCC.txt
GT_FT_KIT_062_WIFI_BT_GCC.txt
GT_FT_KIT_062S2_43012_GCC.txt
GT_FT_P6S1_43012EVB_01_GCC.txt
GT_FT_PROTO_062_4343W_GCC.txt
GT_FT_PROTO_062S3_4343W.txt
GT_FT_PROTO_064_SB_GCC.txt
Reviewers
@ARMmbed/team-cypress