Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uflash fails to find microbit #59

Open
rhubarbdog opened this issue Dec 6, 2018 · 1 comment
Open

uflash fails to find microbit #59

rhubarbdog opened this issue Dec 6, 2018 · 1 comment

Comments

@rhubarbdog
Copy link

I was trying some blocks and returned to micropython.
when i tried command uflash my-script.py i get error message
Error flashing pongo.py to microbit: Unable to find micro:bit. Is it plugged in?

solution
uflash my-script.py ~/Downloads
that creates a micropython.hex in ~/Downloads I just copied that using a GUI file manager to my microbit

but with this script now flashed to the micobit uflash my-script.py still fails

@spalbird
Copy link

spalbird commented Aug 7, 2020

Our company IT does not allow booting from removeable drive. Maybe a security mechanism alters a return value? Not sure...

I located following problem in uflash.py in find_microbit() function:
"if ctypes.windll.kernel32.GetDriveTypeW(path) != 2:" will fail because this function returns 1 on my Window10 company PC

from https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-getdrivetypew

1 DRIVE_NO_ROOT_DIR (The root path is invalid; for example, there is no volume mounted at the specified path.)
2 DRIVE_REMOVABLE (The drive has removable media; for example, a floppy drive, thumb drive, or flash card reader.)

I changed the line to
"if not ctypes.windll.kernel32.GetDriveTypeW(path) in (1, 2):"

Download uflash-1.3.0.tar.gz from https://pypi.org/project/uflash/#files
Modify line as described above
reinstall with "python setup.py install"

If it still doesn't work for you debug uflash.py yourself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants