5 years, 2 months ago.

Firmware 141212 bug in mbed LPC1768

With the mbed with its latest firmware, if i run the following example:

#include "mbed.h"

DigitalOut myled(LED1);
LocalFileSystem local("local");               // Create the local filesystem under the name "local"
volatile char buf[255];
int main() {
    
    while(1) {
        myled = 1;
        FILE *fp = fopen("/local/out.txt", "w");  // Open "out.txt" on the local file system for writing
        fprintf(fp, "Hello World!");
        fclose(fp);
        wait(0.2);
        myled = 0;
        wait(0.2);
    }
}

Compiled with the online compiler, After a while the lpc hangs, I can notice that the interface also freezes because if I press the reset button it does nothing (The interface led doesn't turn off). The only way I can make it work again is by power resetting.

With the previous firmware (21164) we weren't able to reproduce this.

Question relating to:

Interesting, I was able to replicate this, and it seems that opening the file from the host computer also causes the freeze to occur. I ran it overnight disconnected from the computer and it seemed to have no issue. I bet the OS is scanning the FS and causing some race condition in the firmware.

The device will probably be fine in an unmounted state (eject in windows/mac, umount in linux), if you don't need to access it from the host.

posted by Christopher Haster 24 Jul 2015

Thanks for answering, I also thought that without a connection to the PC it didn't crash, but i tested it carefully taking into account to unmount the device, and it crashed again after a long time. I do notice that it crashes faster if i dont unmount the lpc correctly.

posted by marcos diaz 24 Jul 2015

Any chance we could get the source code so we can fix it ourselves?

posted by marcos diaz 02 Oct 2015
Be the first to answer this question.