Linker error (legacyalign) with FATFileSystem Example

I am trying to run the FATFileSystem example in order to read and write to an SD card using MBED Studio with MBED-OS 6.16.0.

However, when compiling I receive a linker error stating that:

[Warning] @0,0: L3912W: Option ‘legacyalign’ is deprecated.
[Error] @0,0: L6218E: Undefined symbol feof (referred from BUILD/NUCLEO_F070RB/ARMC6/main.o).
Warning: L3912W: Option ‘legacyalign’ is deprecated.
Error: L6218E: Undefined symbol feof (referred from BUILD/NUCLEO_F070RB/ARMC6/main.o).
Finished: 0 information, 1 warning and 1 error messages.
[ERROR] Warning: L3912W: Option ‘legacyalign’ is deprecated.
Error: L6218E: Undefined symbol feof (referred from BUILD/NUCLEO_F070RB/ARMC6/main.o).
Finished: 0 information, 1 warning and 1 error messages.

I have tried MBED-OS 6.11.0 with the same error.
Am I correct in saying the MBED-OS has the LittleFileSystem and the FatFileSystem pre-installed? I have tried installing the FATFILESYSTEM Library, however this does not compile.

Details:

  • Compiling on MBED Studio
  • Board: NUCLEO_F070RB

Any suggestions much appreciated.
Will

Hi,

The NUCLEO_F070RB target use small model library by default and the FATFilesSystem example requires standard model.
To avoid a link error, you can edit the mbed_app.json file of your project as below.

{
    "target_overrides": {
        "*": {
            "platform.stdio-convert-newlines": true
        },
        "NUCLEO_F070RB": {
            "target.c_lib": "std"
        }
    }
}

Thanks,
Toyo

Thank you very much, Toyo.
This indeed solved my problem and it now compiles successfully.