r/microbit • • 4d ago

Error 504 on microbit while using a framework

Hi everyone,

I'm having trouble flashing my micro:bit V2 from the command line and I'd appreciate any help.

Setup:

- micro:bit V2

- Framework laptop 12 running Fedora 45

- Python 3 in a virtual environment, with uflash installed via pip

- Editing in VS Code

What I do:

I run `uflash test.py` from the terminal. The output looks normal:

Flashing test.py to: /run/media/<user>/MICROBIT/micropython.hex

The yellow LED on the back blinks for a short while, then the micro:bit shows a sad face followed by error 504. My code never runs.

My test script is just:

from microbit import *

import radio

import random

import music

display.show("G")

The MICROBIT drive then contains a FAIL.TXT with this content:

error: The transfer timed out.

type: transient, user

What I've understood so far:

From the micro:bit support pages, error 504 seems related to the file transfer itself (not to my code), so I suspect a USB or timeout issue rather than a MicroPython problem.

What I haven't been able to try yet:

I only have the one cable and port available right now (my Framework uses expansion cards, and I don't have a USB-C to micro-USB cable), so I couldn't compare other ports or cables.

  1. Is this a known issue with uflash and micro:bit V2 with Framework?
  2. Would copying the .hex manually and running `sync` help avoid the timeout?

Thanks a lot for your help!

1 Upvotes

1 comment sorted by

1

u/ayawk 4d ago

For error 504 in transfers from Linux, try this UDEV rules file fix.

Error 504 means “timeout” - the micro:bit saw a transfer start, and gave up waiting for it to finish.

USB errors (5xx) can be caused by the micro:bit, USB cable, or the computer configuration or installed software.

It’s possible to see varying results from different methods of starting a transfer: e.g. a drag to the MICROBIT drive, a command, a direct save from a browser to the drive.