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 build --deploy does not work in macOS Sequoia #6043

Open
lobodpav opened this issue Dec 17, 2024 · 2 comments
Open

pxt build --deploy does not work in macOS Sequoia #6043

lobodpav opened this issue Dec 17, 2024 · 2 comments

Comments

@lobodpav
Copy link

Describe the bug
pxt build --deploy copies the HEX file to micro:bit's flash and even though that step succeeds, once micro:bit reboots it fails on error 504.

This issue is a follow-up to this one.

To Reproduce
Steps to reproduce the behavior:

  1. Clone your micro:bit GitHub project and cd to that directory
  2. Follow the official instructions to setup a project. I.e.:
    npm install -g pxt
    pxt target microbit
  3. Connect the board to your Mac
  4. Rename the NO NAME USB drive to MICROBIT. See this comment for more details.
  5. Run pxt build --deploy
  6. You'll get the output below and the process will succeed with the exit code 0
    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/
    
  7. Wait a bit until the MICROBIT volume disconnects and re-connects
  8. Actual behaviour: Your micro:bit displays a 504 error
  9. On the micro:bit's flash drive there is a file called FAIL.TXT which says
    error: The transfer timed out.
    type: transient, user
    

Expected behavior
The program shall be deployed to micro:bit the same way it works when using MakeCode.

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.2
@martinwork
Copy link
Contributor

@lobodpav I have just upgraded to 15.2. It seems to work for me with the same workaround as for dragging a hex file to the drive: reconnect USB and drag to the drive as soon as it appears.

I guess it will fail if the build takes a long time - maybe separate build and deploy? When it fails, just as with drag & drop, the copy completes much too quickly - no need to wait for 504! After a successful copy, the drive doesn't remount for a good 10 seconds, which is unusual.

I have always added pxt install to the installation commands. There is a nice summary from @microbit-carlos
https://github.com/carlosperate/pxt-banana?tab=readme-ov-file#local-builds

By the way, this worked for me on macOS 15.1.1
diskutil rename "NO NAME" MICROBIT

but started failing after installing macOS 15.2 with
Failed to rename volume: Unknown error: -119930871 (-119930871)

So I started using your method:

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

I don't know what changed, but the simple rename has started working on 15.2 now!

So this is working immediately after the NO NAME drive appears:

diskutil rename "NO NAME" MICROBIT
pxt deploy

@lobodpav
Copy link
Author

lobodpav commented Dec 20, 2024

@martinwork A couple of notes:

  1. The pxt deploy succeeds. However, once micro:bit restarts, I get the sad face along with the 504 code.
  2. I had no issues with renaming the flash drive.
  3. Even dragging&dropping the hex file to micro:bit ends up with 504. However, when uploading my program via MakeCode, all works fine.
  4. My program is written in TypeScript and is a bit bigger so it won't fit micro:bit V1. I have disabled the mbdal variant in pxt.json to allow pxt to finish the build.

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