intellij-micropython icon indicating copy to clipboard operation
intellij-micropython copied to clipboard

Flash multiple files to Micro:bit

Open kylinpoet opened this issue 7 years ago • 9 comments

I had done follow the instruction:

Select the top level folder of the project in the path browser of "Run/Debug Configurations".

BUT it shows:

Python files must end in ".py".

kylinpoet avatar Jul 22 '18 15:07 kylinpoet

Make sure you've selected a "Flash ...", not a regular "Python" run configuration.

vlasovskikh avatar Jul 24 '18 23:07 vlasovskikh

Make sure you've selected a "Flash ...", not a regular "Python" run configuration.

Sorry for my poor understanding、、、 I use the pycharm for windows: z11 There's something different。。。 Could you show more tips? 囧囧囧

kylinpoet avatar Jul 25 '18 11:07 kylinpoet

Everything looks correct so far. Please edit one of your t1.py or r1.py run configurations and try to specify the path to your project directory instead of a specific *.py file. Please attach a screenshot if you see any errors you don't expect.

vlasovskikh avatar Jul 27 '18 23:07 vlasovskikh

1

What I had done are these: ww What's the next now?? Sorry again for disturbing you...

kylinpoet avatar Jul 28 '18 01:07 kylinpoet

@kylinpoet I got it now. Uploading multiple file to Micro:bit devices is not supported yet. It works only for ESP8266 and Pyboard. Sorry about that. A pull request that adds support for it is welcome. It will require changing the upload method from uflash so some other packages that actually allows transferring multiple files.

vlasovskikh avatar Aug 01 '18 11:08 vlasovskikh

@vlasovskikh You mentioned here that the upload method would need to be changed from uflash to some other packages that allow transferring multiple files, do you happen to know of any that would achieve this?

I'm embarking on a big project using a micro:bit which I really don't want to develop all in a single file! I'm unsure how to flash multiple files though.

Cheers!

adam-binks avatar Nov 02 '18 17:11 adam-binks

@adam-binks Sorry, I'm not aware of any. I haven't done any research, so it may be possible that a tool for uploading multiple files to Micro:bit devices exists. AFAIK uflash allows to upload only a single Python file built into the binary of the MicroPython interpreter itself.

vlasovskikh avatar Dec 06 '18 15:12 vlasovskikh

https://github.com/ntoll/microfs/ can be used to add multiple files to the micro:bit MicroPython filesystem.

carlosperate avatar Mar 03 '19 18:03 carlosperate

https://github.com/ntoll/microfs/ can be used to add multiple files to the micro:bit MicroPython filesystem.

In a sample project I was able to successfully use ufs to upload a multi-file Pyhon project to the microbit. One detail I found is that becase a file is executed straight away, any dependencies must be uploaded first. Example from the Makefile of my test project:

flashit:
	ufs put src/config.py
	sleep 5
	ufs put src/main.py

main.py contains import config, therefore config.py has to be on the microbit already when main.py uploaded.

marcelloromani avatar Mar 05 '23 11:03 marcelloromani