Getting "disk not ejected properly" in OSX

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
LarryTru
Posts: 26
Joined: Wed Aug 06, 2014 5:46 am

Re: Getting "disk not ejected properly" in OSX

Post by LarryTru » Sat Sep 27, 2014 9:23 pm

Do we know if the code change had the intended effect and prevented the call to StopUnit? There's no logging of that is there?

User avatar
dhylands
Posts: 3821
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: Getting "disk not ejected properly" in OSX

Post by dhylands » Sun Sep 28, 2014 12:55 am

Hey Larry,

It didn't seem to work.

The next step is to add some logging. I've been working on the timer code and that seems to be very close to being done.
So I'll work up a logging patch next.

blmorris
Posts: 348
Joined: Fri May 02, 2014 3:43 pm
Location: Massachusetts, USA

Re: Getting "disk not ejected properly" in OSX

Post by blmorris » Sun Sep 28, 2014 3:30 am

Hi Larry - As Dave said, no luck yet. On the bright side, we did successfully resolve a few unrelated OSX issues this week (related to building micropython's unix port on OSX) and this is next on my list. Not that I necessarily know what to do, but one week ago I didn't think I knew what to do about the unix build issues either ;)
I also have a bit of a mea culpa - I took another look at the code Dave found, and realized the comments around it looked familiar; I also remembered that Damien generally doesn't mess with the hardware abstraction layer code unless absolutely necessary (makes it harder to migrate later when updated libraries are released.) So I looked back at the history and saw that I had an exchange with Damien when he put this change in back in April - it was to fix another OSX issue where it was impossible to do a clean eject of the filesystem; OSX would always immediately remount it. I confirmed to Damien that it worked and we could eject the filesystem - at least if it was done right away. I didn't notice until much later that I couldn't unmount after a few minutes, and it took me much more time still to confirm that it wasn't just my machine.
Oh well - some things you are just going to miss.
Dave- I'm thinking we should open an issue for this on Github - my only hesitation being that I like to write up a clear and detailed description of the problem (even if my interpretation of the details turns out to be wrong, as it often is.) In this case, I'm not really sure how to describe it, except that OSX seems to be using some SCSI commands to put mass storage devices into and out of sleep states, in a way that Windows and Linux don't, and the pyboard misinterprets something there causing the MSC device to hang. That is probably good enough for a report, though; I'll take any suggestions you have and try to post something tomorrow or Monday (unless you want to do it first.)
-Bryan

Damien
Site Admin
Posts: 647
Joined: Mon Dec 09, 2013 5:02 pm

Re: Getting "disk not ejected properly" in OSX

Post by Damien » Wed Oct 01, 2014 10:51 pm

Thanks guys for finding and working out the cause of this bug, and Dave for fixing it.

The fix is now in the master branch, and firmware with the fix will be available from micropython.org/download, dates 2014-10-02 onwards.

Post Reply