You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
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
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):"
Activity
spalbird commentedon 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.