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

pxt deploy reports Error: cannot find any drives #6022

Closed
lobodpav opened this issue Nov 29, 2024 · 7 comments
Closed

pxt deploy reports Error: cannot find any drives #6022

lobodpav opened this issue Nov 29, 2024 · 7 comments

Comments

@lobodpav
Copy link

Describe the bug
pxt deploy reports Error: cannot find any drives to deploy to even though the micro:bit is connected and working well in MakeCode online.

To Reproduce
Steps to reproduce the behavior:

  1. Follow the official instructions to setup a project. I.e.:
    npm install -g pxt
    mkdir makecode
    cd makecode
    pxt target microbit
  2. Pull your Git code to ./projects/microbit-christmas-tree
  3. Connect the board to your Mac
  4. Run cd ./projects/microbit-christmas-tree
  5. Run pxt deploy
  6. You'll get the output below
    Using target microbit with build engine yotta
      target: v7.1.15 /Users/pavel/Microbit/makecode/node_modules/pxt-microbit
      pxt-core: v11.3.3 /Users/pavel/Microbit/makecode/node_modules/pxt-core
    building /Users/pavel/Microbit/makecode/projects/microbit-christmas-tree
    INTERNAL ERROR: Error: cannot find any drives to deploy to
        at /Users/pavel/Microbit/makecode/node_modules/pxt-core/built/buildengine.js:562:23

Expected behavior
The program shall be deployed to micro:bot.

micro:bit version (please complete the following information):

V2.21

Desktop (please complete the following information):

  • Computer: MacBook Pro M2 Max
  • OS: macOS Sequoia 15.1.1
  • pxt-core: v11.3.3
@martinwork
Copy link
Contributor

I think this will be because it's looking for a drive named MICROBIT,

"deployDrives": "(MICROBIT|MBED)",

but currently on Sequoia the drive is named NO NAME
ARMmbed/DAPLink#1082

@lobodpav
Copy link
Author

I think this will be because it's looking for a drive named MICROBIT,
but currently on Sequoia the drive is named NO NAME

Thanks for the hint! I have renamed the volume to MICROBIT and pxt deploy went well.

However, right after deployment, the volume name was reverted back to NO NAME 😢

Any clue what could cause the name changes?

@martinwork
Copy link
Contributor

Good idea - I didn't think of renaming the volume! The micro:bit resets and remounts, so the name would revert (see the DAPLink issue for the cause). I don't know how to override the default name. Maybe a script to rename the volume then pxt deploy?

@lobodpav
Copy link
Author

Good idea - I didn't think of renaming the volume! The micro:bit resets and remounts, so the name would revert (see the DAPLink issue for the cause). I don't know how to override the default name. Maybe a script to rename the volume then pxt deploy?

Yep, a custom pxt shell alias would do the trick. I just hope I won't rename some other flash drive by accident 😊

@tballmsft
Copy link
Contributor

Thanks for the resolution!

@lobodpav
Copy link
Author

lobodpav commented Dec 5, 2024

Anyway, it would be nice if this could be fixed properly so that the drive is not renamed every time after the deployment.

@lobodpav
Copy link
Author

For reference, I used these commands to rename the flash drive:

MICROBIT_DEVICE=$(diskutil list external physical "/Volumes/NO NAME" | awk '/NO NAME/ {print "/dev/" $NF}')
diskutil rename "$MICROBIT_DEVICE" "MICROBIT"

When running

pxt build --deploy

It ends successfully and outputs:

Using target microbit with build engine yotta
  target: v7.0.54 /Users/pavel/Microbit/microbit-christmas-tree/node_modules/pxt-microbit
  pxt-core: v11.1.10 /Users/pavel/Microbit/microbit-christmas-tree/node_modules/pxt-core
building /Users/pavel/Microbit/microbit-christmas-tree
copying binary.hex to /Volumes/MICROBIT/

However, in a short while, the device:

  1. Displays error 504
  2. The drive is unmounted and re-mounted
  3. The drive name is changed back to NO NAME
  4. There is a file called FAIL.TXT which says
    error: The transfer timed out.
    type: transient, user
    

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

3 participants