mbed v138 breaks LocalFileSystem (LPC1768)

06 Aug 2017

While updating some applications, I updated libraries. Suddenly features in my app were failing.

I isolated it to mbed v138 and newer. Then found this branch of v137; clearly I'm not the only one experiencing this.

I deleted most of my program until I was down to this:

#include "mbed.h"                   // v137 works, v138 fails

LocalFileSystem local("local");     // access to calibration file for resistive touch.
Serial pc(USBTX, USBRX);            // And a little feedback

DigitalOut myled(LED1);
DigitalOut cb(LED4);

int main() {
    pc.baud(460800);    // I like a snappy terminal, so crank it up!
    pc.printf("\r\nLocalFileSystem Test - Build " __DATE__ " " __TIME__ "\r\n");
    pc.printf("mbed version %d\r\n", MBED_LIBRARY_VERSION);

    FILE *fh = fopen("/local/test.bin", "wb");
    pc.printf("fh = %p\r\n", fh);    // v137 prints the fh address, v138 prints 0 (NULL)
    if (fh) {
        fprintf(fh, "%s\r\n", "This is a test");
        fclose(fh);
        wait(0.5);
        pc.printf("file written\r\n");
    }
 
    while(1) {
        myled = 1;
        wait(0.2);
        myled = 0;
        wait(0.2);
    }
}
  • Does the mbed team have any regression tests for this?
  • Is there a chance this will be corrected?