unable to flash on microbitv2

Questions and discussion about running MicroPython on a micro:bit board.
Target audience: MicroPython users with a micro:bit.
Post Reply
gekorob
Posts: 2
Joined: Tue Dec 22, 2020 11:18 am

unable to flash on microbitv2

Post by gekorob » Tue Dec 22, 2020 12:04 pm

Hi all,
I'm just starting experimenting on my microbit v2 and with the mu editor I have no problem on flashing python code on the board and I'm a newbie in this field).
Using instead the 'uflash' (that I'd prefer, 'cause I'm using my usual code editor to write python) instead I have problem.
After flashing on the microbit v2 the board show the code 529 (I guess that is a problem of wrong hex), instead on the microbit v1 it works correctly.

So the question is: how I can flash python code to microbit v2 using uflash?

I'm using 'uflash' in a very easy way:

uflash hi.py <---- this is NOT working (the command finish correctly but the board shows 529)

and

uflash -r micropython-microbit-v2.0.0-beta.3.hex <---- this is working correctly

From mu-editor, opening the REPL I can see that on the board I have:

MicroPython v1.13 on 2020-12-21; micro:bit v2.0.0-beta.3 with nRF52833

Any help is highly appreciated,
Thanks a lot
Roberto

User avatar
aivarannamaa
Posts: 171
Joined: Fri Sep 22, 2017 3:19 pm
Location: Estonia
Contact:

Re: unable to flash on microbitv2

Post by aivarannamaa » Tue Dec 22, 2020 12:25 pm

This seems to be a known issue: https://github.com/ntoll/uflash/issues/67

Instead of combining MicroPython and your code into single hex, I'd recommend flashing your micro:bit once with https://github.com/microbit-foundation/ ... beta.3.hex, and upload your script as main.py

If you want to keep your current editor, then you could use any of the following command line tools for uploading scripts or other files into MicroPython's filesystem:

* rshell (https://github.com/dhylands/rshell)
* ampy (https://github.com/scientifichackers/ampy)
* mpfshell (https://github.com/wendlers/mpfshell)
* pyboard (https://docs.micropython.org/en/latest/ ... rd.py.html)
Aivar Annamaa
https://thonny.org

gekorob
Posts: 2
Joined: Tue Dec 22, 2020 11:18 am

Re: unable to flash on microbitv2

Post by gekorob » Tue Dec 22, 2020 1:41 pm

Oh thanks a lot for your answer,
great I'll look at the links and will use your suggestions for sure.

Thanks again
Roberto

Post Reply