OS X, board not appearing as Mass Storage Device

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
epoz
Posts: 6
Joined: Fri May 02, 2014 9:11 am

OS X, board not appearing as Mass Storage Device

Post by epoz » Fri May 02, 2014 9:14 am

Hi All,

I have just received my board in the mail, very excited about it. As a quick test to see if it works, I have plugged it in via a USB cable to my laptop, and it does not show up as a Mass Storage Device in the Finder. The moment I plug in the cable to the board, the LED blinks once, but then nothing much happens from there.

What am I missing? Any tips?

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

Re: OS X, board not appearing as Mass Storage Device

Post by blmorris » Fri May 02, 2014 4:12 pm

I don't have a pyboard yet, but I have been playing around with Micropython for a few months now on a board I have designed with a very similarly configured STM32F405 (designed months before I heard of micro python, pure lucky chance that it was such an easy port)!
Anyway, I also use OS X and the mass storage component has been working pretty well for some time (for me…) accessing either the built-in flash filesystem (without an SD card inserted) or the SD card filesystem if it is inserted. The single LED blink sounds like what happens if the board is getting power but not configuring over USB. Can you see if there is a new entry in the /dev tree for the CDC (serial port emulation) device? On my machine it shows up as /dev/tty.usbmodem1a22 or /dev/tty.usbmodem1d12 depending on which port I plug in to. If the CDC component has configured properly, you should be able to access the REPL prompt using
screen /dev/tty.usbmodem1a22
using your device name.
I have found that the USB ports on my machine can sometimes get stuck in a weird state if a device misbehaved (like a micro python software crash) while it was plugged in and the only way I have found to clear this is a reboot. (If anyone know a better way, I would be grateful!)

My system is running 10.7.5, so there may be different issues for 10.8.x or 10.9.x

-Bryan

epoz
Posts: 6
Joined: Fri May 02, 2014 9:11 am

Re: OS X, board not appearing as Mass Storage Device

Post by epoz » Mon May 05, 2014 7:32 am

It does not show up in the /dev/ tree ether . :-(
Will try a reboot and see if that helps.

epoz
Posts: 6
Joined: Fri May 02, 2014 9:11 am

Re: OS X, board not appearing as Mass Storage Device

Post by epoz » Mon May 05, 2014 9:00 am

Even after rebooting, doesn't show up as MSD or under the /dev/ tree.
Might mean my board is b0rked DOA. :-(

pfalcon
Posts: 1155
Joined: Fri Feb 28, 2014 2:05 pm

Re: OS X, board not appearing as Mass Storage Device

Post by pfalcon » Mon May 05, 2014 4:27 pm

You of course tried pressing reset switch after you plugged it in? Did you try another computer?

Do you feel like trying a DFU upgrade of your board using a fresh build from http://micropython.org/download/ ?
Awesome MicroPython list
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/

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

Re: OS X, board not appearing as Mass Storage Device

Post by blmorris » Mon May 05, 2014 5:37 pm

Other things to try before giving up:
-See if you can get the board to appear in DFU mode. If you place the DFU jumper (not sure where on the pyboard but it is in the docs) and hit the reset button (or just plug it in) you should see an entry for STM32 BOOTLOADER under the USB entry in the System Information utility (on 10.7 it is found through the Apple icon -> About this Mac -> More Info… -> USB.
If you have that entry, then you should be able to install dfu-utils (available through Mac Ports, get at least version 0.7) and update the micro python firmware to the latest version.
-If still no luck, see if you can try a different computer or even a different USB cable (I have seen USB cables fail with a data line broken.)

Once I get my pyboards I could work on a generic hardware troubleshooting guide, of course acknowledging that a lot of hardware troubleshooting advice can be of limited utility to the average user. Advanced debugging requires advanced tools (multimeter, oscilloscope, logic analyzer, etc.) but a lot of problems can be caught and corrected with simpler methods.

epoz
Posts: 6
Joined: Fri May 02, 2014 9:11 am

Re: OS X, board not appearing as Mass Storage Device

Post by epoz » Tue May 06, 2014 2:54 pm

Thanks for the replies.
Yes, I had tried the reset switch - makes no difference. Tried a different USB cable, no difference.
Tried with a microsd card containing a simple script switching on the two leds - success! So the board executes code from a card. At least there is that! :-)

However it does not show up under the USB branch in the System Information - at all.
Also tried a call to pyb.usb_mode('CDC+MSC') as described on https://github.com/micropython/micropyt ... i/Examples to try and force storage mode, but nope.

If it doesn't show up as a USB device at all, flashing it won't work from this system. Going to try from a different computer and a RPi later.

torwag
Posts: 220
Joined: Fri Dec 13, 2013 9:25 am

Re: OS X, board not appearing as Mass Storage Device

Post by torwag » Tue May 06, 2014 4:53 pm

Hi,

I do not use OS X. However, under linux we have the possibility to see what happens after plugin a device.
Do you have any commands for the command line like
dmesg
lsusb
etc.?
You might google those and check for Mac counterparts. After that you should have more infos what is going wrong. I assume you simply miss a driver.

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

Re: OS X, board not appearing as Mass Storage Device

Post by blmorris » Tue May 06, 2014 4:58 pm

Epoz- So not completely dead, that is actually promising.
You didn't say whether you tried to get it into DFU mode yet. You don't need to install dfu-utils to do this, just place the DFU jumper (not sure where on the board it is, but connects to pin 60 of the processor, may also be labeled BOOT0, but I don't have a board to say for sure.)
I only suggest this because the fact that your board runs any code at all is proof that the USB connection was working when it was tested; pretty sure that Damien is using DFU via USB connection to program all of the boards.
If you can get the board to show up as a DFU device, then there is a chance that you can re-flash the firmware and have the USB come up the way it is supposed to. Weird, but I have seen this happen at least once in the work I have done with this processor. Other possibilities are that there is a broken solder joint in the USB data lines- might be able to determine with a strong magnifying glass or a sharp-tipped multimeter. Also possible that the USB hardware within the chip got a strong static discharge somewhere along the way, which really leaves no recourse but replacing the board :(
Good luck, hope you get it working.

@torwag- no drivers necessary on OS X, as far as I can tell. I should check to see what the equivalent to dmesg and lsusb are for mac, used to use them on Linux all the time but haven't yet had a need in OS X.
-Bryan

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

Re: OS X, board not appearing as Mass Storage Device

Post by Damien » Wed May 07, 2014 10:58 am

What version of OS X are you running?

If you try to enter DFU mode, that will tell us if the USB connector is broken or working. To do this you need to connect the DFU hole (labelled P1/DFU on the back of the pyboard, in the bottom right corner looking from the back) with the 3V3 hole that is next to it. Connect these 2 holes with a paperclip (or any piece of conductive wire), or a resistor that is 10k ohm or less. While this wire is connected, press the RST button. You have entered DFU mode if the red, orange and blue LEDs are faintly lit. If not, press RST again, making sure the wire has contacted the DFU and 3V3 holes. When the 3 LEDs are faintly glowing, you can remove the piece of wire.

Now check to see if your Mac can recognise (or at least see) the USB device. Try "lsusb" or "dmesg" at the terminal.

Post Reply