Firmware 141212 does not release local file system on last fclose()

31 Oct 2013

Bug migrated from "Questions" as it is better served here in "Bugs & Suggestions".

On an LPC1768 mbed with firmware 141212, the local file system does not seem to release and update in Windows when the last file is closed. With firmware 16457, the updates do reflect in Windows explorer as expected.

Is this expected, or a defect?

In more detail:

I have one mbed where I updated the firmware to the latest.
loader=11972
firmware=141212
configuration=4

I have another which is "original".
loader=11972
firmware=16457
configuration=4

Relevant clips from the Firmware page

rev 141212

  • Added CMSIS-DAP support

rev 21164

  • Added support for LPC11U24

rev 16457

  • Unified firmware update for LPC1768 and LPC2368 boards
  • Improved programming and semihosting performance
  • LocalFileSystem disk now released to PC when mbed has no files open (used to only happen on program exit)
  • ...

This suggests that 141212 should be backward compatible, and it too should release to the PC when on files are open, but this appears to not be the case.

Is it possible to "downgrade" my mbed with 141212 to 16457?

Example program

#include "mbed.h"

LocalFileSystem local("local");
Serial pc(USBTX, USBRX);

DigitalOut myled(LED1);

int main() {
    FILE *fp;   
    pc.baud(460800);    // I like a snappy terminal, so crank it up!
    fp = fopen("/local/test.txt", "w");
    if (fp) {
        fprintf(fp, "Hello World!");
        fclose(fp);
        pc.printf("See if /local/test.txt was written, then hit <enter> ");
        // 141212: while awaiting a keystroke, the file does not show.
        // can hit <refresh> in Win7, or reset on mbed, still no show.
        // if I unplug the mbed usb (and power), then plug in, then the file appears.
        // 
        // 16457: can hit <refresh> in Win7 and the file appears.
        pc.getc();
        pc. printf("\r\n");
    } else {
        pc.printf("fopen returned null.\r\n");
    }
    while(1) {
        myled = 1;
        wait(0.2);
        myled = 0;
        wait(0.2);
    }
}
25 Nov 2013

Hi David - I've added download links on the firmware page to older images.