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

How to upload an uf2 file #31

Open
tarjei opened this issue Jan 13, 2021 · 2 comments
Open

How to upload an uf2 file #31

tarjei opened this issue Jan 13, 2021 · 2 comments

Comments

@tarjei
Copy link

tarjei commented Jan 13, 2021

Hi,

With the new uf2 pack(#15) command it is my understanding that you can upload and run an UF2 file from makecode.org directly on an EV3, but I have somehow failed to understand the steps. I try:

  1. Create a file and download it (named lego-untitled.uf2)
  2. ev3duder uf2 pack /home/user/lego-untitled.uf2 Projects test
  3. ...

That is, step 3 does not return anything meaningful - nor do I find the file on my EV3. Any tips on what I'm doing wrong? What is the correct usage of the third argument (test) - what does it do?

Regards,
Tarjei

@JakubVanek
Copy link
Contributor

JakubVanek commented Jan 13, 2021

Hi!

I originally planned to implement uploading as well, but so far I only implemented packing & unpacking. pack should create a UF2 archive from a specified set of files, unpack should extract files from a UF2 archive.

Currently there are two ways of uploading a UF2 file:

  • Manually copy the UF2 file into the emulated USB drive that appears after an EV3 with firmware >=1.10E is plugged into a PC. This should work well on Windows, but on Linux there is an issue with the format of the emulated filesystem. I found a workaround for this, but it relies on some commands:
sudo mkdir /mnt/ev3                                     # prepare temporary directory
sudo umount /dev/<name of the emulated device>          # unmount, if mounted (OK if it fails)
sudo mount /dev/<name of the emulated device> /mnt/ev3  # remount it in the temporary directory
cp file.uf2 /mnt/ev3/                                   # copy over the UF2 (do not run ls or other commands!)
sudo umount /mnt/ev3                                    # unmount the filesystem
sync                                                    # force changes to propagate to the brick
  • Unpack the files from the UF2 file using ev3duder uf2 unpack test.uf2 tmpdir and upload them using ev3duder up:
ev3duder up tmpdir/file.rbf /home/root/lms2012/prjs/file.rbf
ev3duder up tmpdir/file.elf /home/root/lms2012/prjs/file.elf

It should be possible to build uf2 uploading into ev3duder. However, I think some refactoring may be needed to prevent code duplication. I don't currently have much free time, but I'll try to look into that in the coming months.

With regards,
Jakub

@tarjei
Copy link
Author

tarjei commented Jan 13, 2021

@JakubVanek thanks!

At least now I got some pointers to where I should start :)

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