mBed R.I.P. ?!?!?!

29 Oct 2009

Safari stopped downloading to mBed.

Instead it downloaded to the "Downloads" folder (it changed the preferences itself). It looked like it saw something wrong with mBed and chose to reroute the download.

Check mBed info - only 18K free in memory even though it was empty!

Decided to use Disk Utility to erase mBed. (Does the mBed not do a garbage collection?)

mBed is not appearing as an external drive when I plug it in.

Have we lost it?

29 Oct 2009

I should add that all of this happened as I was trying out the RTC stuff. The program I was using was:

#include "mbed.h"

int main() {
    set_time(1257129737);
    while (1) {
        time_t seconds = time(NULL);

        printf("--------------------------------------------------------\n\r");
        printf("Time as seconds since January 1, 1970 = %d\n\r", seconds);

        printf("Time as a basic string = %s\n\r", ctime(&seconds));

        char buffer[32];
        strftime(buffer, 32, "%I:%M %p\n\r", localtime(&seconds));
        printf("Time as a custom formatted string = %s", buffer);

        wait(1);
    }
}

29 Oct 2009 . Edited: 29 Oct 2009

Hi Paul,

Hopefully this is recoverable. Let's try and track it down...

Paul Mulvey wrote:
Check mBed info - only 18K free in memory even though it was empty! Decided to use Disk Utility to erase mBed.

The check info saying 18k free gets me suspicious already, and your other comment may have inadvertently identified the problem...

Paul Mulvey wrote:
Does the mBed not do a garbage collection?

The mbed drive is just a FLASH disk, so there is no concept of garbage collection; it is a block storage on which the OS interprets a filesystem and performs actions.

However, that does make me think whether Mac OS X is doing garbage collection! I remember MAC OS X creates a .Trashes directory of some kind, and that may mean if you are deleting things, you aren't actually deleting them, simply moving them.

A google on the subject shows up a number of things related to this, and basically says you need to empty the trash with the disk plugged in to properly delete the files (here), or use terminal to delete the .trashes etc. Also, I found something which provides a simple way to stop it making these files (there may be better/official ways):

I suspect this is the problem; you "deleted" stuff but didn't actually delete it, and hence safari decided there was no space.

Paul Mulvey wrote:
mBed is not appearing as an external drive when I plug it in.

I'm not clear whether this is a result of some of your Disk Utility actions, whether this is intermittent, or Mac has just blocked it out based on some actions? The mbed drive is somewhat intelligent, so if you delete everything it'll re-create the MBED.HTM, and if you reformat it, it'll go and reformat the disk itself back to the factory default.

So the main goal is just to get something to register it as a media; you can then delete or reformat it. Maybe try the Mac after a reboot in case it caches stuff, try it in a different USB socket (i'm not clear how Mac registers devices), or another computer to get it to appear.

Keep us posted. Also, the Mac OS X and safari versions would be useful for reference.

Simon

29 Oct 2009

Simon,

I'm on OSX 10.5.6. and Safari 3.2.1.

I plugged into my Windows 7 PC and mBed appears. MBED.HTM is there and nothing else. I have compiled and downloaded a led flash prog. and all seems normal. MAC still cannot see the mBed.

Downloaded a prog. on PC that uses printfs. Terminal in MAC sees the output but MBED does not appear as an external drive!

 

Paul

29 Oct 2009

Hi Paul,

Paul Mulvey wrote:
plugged into my Windows 7 PC and mBed appears. MBED.HTM is there and nothing else. I have compiled and downloaded a led flash prog. and all seems normal. MAC still cannot see the mBed. Downloaded a prog. on PC that uses printfs. Terminal in MAC sees the output but MBED does not appear as an external drive!

Ok, that is great. So we know the mbed is working!

How much space does windows say you have? If there is not much left (the disk is ~2MB), are you showing hidden files on windows? If not, the .Trashes files might still be there. You could turn this on and delete all files, or even format the drive (on windows).

A format may be worthwhile anyway, as you said you'd played with disk utility.

Also, it could be the Mac has got some info about the device hanging around somewhere which means it is now ignoring it; a google might help here, for example I found the following which explains a similar problem:

btw, if you haven't updated the firmware (click MBED.HTM to login and it'll tell you if you need to), that might be worth doing anyway and may even change something so Mac thinks the device has changed/is different?!

Simon

29 Oct 2009

Simon,

 

I formatted mBed on the PC and now the MAC can see it. Everything now seems to be back to normal. Thanks for your help.

Paul

29 Oct 2009

Hi Paul,

That is great news. The conclusion would seem to be that on Mac OS X, make sure files you delete get emptied from the trash, else the hidden .Trashes files will eat all your space!

Simon

29 Oct 2009

I wonder if the MAC can format the mBed correctly anyway?

29 Oct 2009

Just open terminal is mac os x and enter:

defaults write com.apple.finder AppleShowAllFiles TRUE
killall Finder

This will let finder show all hidden files (files that start with a ., aka .Trash)

Just open your mbed and everything on the drive will be shown, just delete everything and you should be ok.