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

No build description or instructions #5

Open
droidium opened this issue May 14, 2018 · 3 comments
Open

No build description or instructions #5

droidium opened this issue May 14, 2018 · 3 comments

Comments

@droidium
Copy link

Is this meant for Linux, Windows OSx?
How to build on Windows? Do you need to create some VS project, or do you have to
install make, mingw and or gccwin ?

Not clear at all, some of us are new to Github. A how-to one liner would help a lot.
Thank you.

@jeffsf
Copy link

jeffsf commented Nov 22, 2018

LOL, yeah, it isn't you

macOS

devel]$ git clone https://github.com/Microsoft/uf2
devel]$ git clone https://github.com/adafruit/uf2-samdx1
devel]$ ln -s uf2-samdx1 uf2-samd21
devel]$ cd ufl2
devel/uf2]$ git submodule init
devel/uf2]$ git submodule update
devel/uf2]$ cd uf2tool
devel/uf2/uf2tool]$ make

devel/uf2/uf2tool]$ ../built/uf2tool
usage: ../built/uf2tool COMMAND [ARGUMENTS...]
Commands include:
   serial           - run 'serial' port forwarding
   list             - list devices
   dmesg            - dump internal runtime logs from the device
   info             - dump information about the device
   FILE             - write specified BIN or UF2 file
   random           - write randomly generated bin file

devel/uf2/uf2tool]$ ../built/uf2tool info
INFO: UF2 Bootloader v1.23.1-adafruit.2 SFHR
Model: ItsyBitsy M0 Express
Board-ID: SAMD21G18A-ItsyBitsy-v0

page size: 256, total: 256kB

@vkottler
Copy link

vkottler commented May 17, 2023

I'm posting this on all of the issues that seem somewhat relevant, but there's a pip-installable option as well (see: #42 (comment)).

@richdawe
Copy link

I took similar steps to #5 (comment) to compile this on Linux, with a couple of additional steps:

  1. Install the udev libraries and header files. On Ubuntu, I used apt-get install libudev-dev.
  2. Apply the patch below to disable the macOS linker options, and link against libudev, and add a header that's required on Linux.
diff --git a/uf2tool/Makefile b/uf2tool/Makefile
index efc615b..4189070 100644
--- a/uf2tool/Makefile
+++ b/uf2tool/Makefile
@@ -1,3 +1,6 @@
 all:
        mkdir -p ../built
-       $(CC) -g -Wall tool.c ../hidapi/mac/hid.c -I../../uf2-samd21/inc -I../hidapi/hidapi -I. -framework IOKit -framework CoreFoundation -o ../built/uf2tool
+#      $(CC) -g -Wall tool.c ../hidapi/mac/hid.c -I../../uf2-samd21/inc -I../hidapi/hidapi -I. -framework IOKit -framework CoreFoundation -o ../built/uf2tool
+#
+#      apt-get install libudev-dev
+       $(CC) -g -Wall tool.c ../hidapi/linux/hid.c -I../../uf2-samd21/inc -I../hidapi/hidapi -I. -o ../built/uf2tool -ludev
diff --git a/uf2tool/tool.c b/uf2tool/tool.c
index 9ec20a7..c390f54 100644
--- a/uf2tool/tool.c
+++ b/uf2tool/tool.c
@@ -2,6 +2,7 @@
 #include <windows.h>
 #endif
 #include <stdio.h>
+#include <stdint.h>
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>

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

4 participants