Code Monkey home page Code Monkey logo

tomu-quickstart's People

Contributors

evyatartamir avatar guynoirq avatar jelly avatar jerith avatar keir avatar marcmerlin avatar mist64 avatar mithro avatar neilbags avatar schnommus avatar sowbug avatar spencerwf avatar tyll avatar xobs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tomu-quickstart's Issues

Solid Red light

Hi,

I just got my Tomu's and after trying to load the chopstix/u2f bin I now get a solid red light. Does this mean the key is toast or is here a way to reset it?

When I run dfu-util -l I'm informed no devices are found. I have 9 other keys but want to make sure I don't break them too, and also learn what's going on.

Thanks.

Unable to compile U2F (chopstx)

Sorry for posting this issue here since im-tomu/chopstx doesn't have an issue tracker.

I was trying to build the u2f source code for my Tomu but the following error prevents it from building the binary:

arm-none-eabi-gcc -c -mcpu=cortex-m0plus -O3 -Os -fstack-usage -ffunction-sections -fdata-sections -fno-common -Wall -Wextra -Wstrict-prototypes -Wa,-alms=build/bn.lst -DMAKE_ENTRY_PUBLIC -DUSE_SYS3 -DFREE_STANDING -DMHZ=21 -mthumb -mno-thumb-interwork -DTHUMB -MD -MP -MF .dep/bn.o.d -I. -I.. bn.c -o build/bn.o
In file included from bn.c:134:0:
bn-thumb1.h: In function ‘bn256_mul_thumb1’:
bn-thumb1.h:32:1: error: ‘asm’ operand has impossible constraints
 asm (                                                      \
 ^
bn-thumb1.h:78:4: note: in expansion of macro ‘MULADD’
    MULADD(at[0], at[8]);
    ^~~~~~

As I checked the source code, MULADD is defined as follows:

#define MULADD(i, j)                                       \
asm (                                                      \
   "ldr r1, %[_i]         \n\t"                            \
   "ldr r2, %[_j]         \n\t"                            \
   "uxth r6, r1           \n\t"                            \
   "uxth r7, r2           \n\t"                            \
   "lsr r1, r1, #16       \n\t"                            \
   "lsr r2, r2, #16       \n\t"                            \
                                                           \
   "mov r0, r6            \n\t"                            \
   "mul r0, r0, r7        \n\t"                            \
   "mul r6, r6, r2        \n\t"                            \
   "mul r2, r2, r1        \n\t"                            \
   "mul r1, r1, r7        \n\t"                            \
                                                           \
   "mov r7, #0            \n\t"                            \
   "add %0, %0, r0        \n\t"                            \
   "adc %1, %1, r2        \n\t"                            \
   "adc %2, %2, r7        \n\t"                            \
                                                           \
   "lsl r0, r6, #16       \n\t"                            \
   "lsr r2, r6, #16       \n\t"                            \
   "add %0, %0, r0        \n\t"                            \
   "adc %1, %1, r2        \n\t"                            \
   "adc %2, %2, r7        \n\t"                            \
                                                           \
   "lsl r0, r1, #16       \n\t"                            \
   "lsr r2, r1, #16       \n\t"                            \
   "add %0, %0, r0        \n\t"                            \
   "adc %1, %1, r2        \n\t"                            \
   "adc %2, %2, r7        \n\t"                            \
                                                           \
   :"=l"(c0), "=l"(c1), "=l"(c2)                           \
   : "0"(c0), "1"(c1), "2"(c2), [_i] "m" (i), [_j] "m" (j) \
   : "r0", "r1", "r2", "r6", "r7", "cc");

I guess it could be some instructions/registers not supported by this chip, but I have no further clue on what to do with it. I have little experience with embedded programming, so I don't know if this situation is very trivial and have simple solutions.

Here's my gcc version:

$ arm-none-eabi-gcc --version
arm-none-eabi-gcc (Gentoo 7.3.0-r3 p1.4) 7.3.0

And my full make log: output.log

A little help would be appreciated!

Issue uploading to tomu

$ dfu-util -v -d 1209:70b1 -D u2f-TOMU.bin

dfu-util 0.9

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2016 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/

dfu-util: Invalid DFU suffix signature
dfu-util: A valid DFU suffix will be required in a future dfu-util release!!!
Opening DFU capable USB device...
ID 1209:70b1
Run-time device DFU version 0101
Claiming USB DFU Interface...
Setting Alternate Setting #0 ...
dfu-util: Cannot set alternate interface`

I've been looking what "Cannot set alternate device" means but i cannot find any information about it.
This is OSX Catalina 10.15.3 with dfu-util and hidapi installed using homebrew.

$ dfu-util -l

dfu-util 0.9

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2016 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/

Found DFU: [1209:70b1] ver=0101, devnum=50, cfg=1, intf=0, path="20-2", alt=0, name="Tomu Bootloader v2.0-rc4", serial="UNKNOWN"```

gpg?

Is possible to encrypt, dectypt a data?
for example i use program
$echo" my text" | ./program_on_tomu

and show base64 encryption data without storage any keys on computer.

RFC: mass storage with write support

I would like to change the mass storage example to also allow write support with storing the actual changes in RAM. Since the RAM is quite limited in tomu, this would require to reduce the actual size of the mass storage device to a size that is not enough for a vfat filesystem. The current example implements a read-only vfat filesystem, though. Do you have any preference about how to implement this change? My idea was to make this conditional on a define so one can select to either get the current example or a fully working, quite slow mass-storage device (4 to 7 kiB probably).

HID Keyboard example?

Hi,
First, Tomu is really impressive.

Now, I'm looking for an example on how to make keys injection.
Did I missed it somewhere?
Thanks

Inconsistently loading new code

Opened up the quickstart and started compiling and flashing everything. :) Some programs seem to load correctly, according to dfu-util, but previously loaded programs are run.

Specifically, I ran miniblink and played around with changing the blink time, everything worked. Then I ran usb-cdcacm, and it worked fine.

Next, I tried to run usb-midi, and dmesg still shows that it's connected as a serial terminal, amidi doesn't find the device, and when I connect to it via serial, it's still running the cdcacm demo.

Miniblink, cbmbasic, opticspy, and usb-cdcacm seem to work. Captouch, usb-hid, usb-midi, and bare-minimum do not.

Oddly enough, just now I loaded opticspy, overflashed captouch and opticspy was still loaded, then flashed bare-minimum and it runs the usb-acm demo. Where did opticspy go?

This might be a toboot bug?

Clarify documentation in readme.md

Quickstart and readme's need to display how to use dfu-util to flash, IE don't say "dfu-util -D" actually list the path to the .dfu file dn all examples. Copy-paste is a good test :)

Readme in root should list toboot to perform the bootloader upgrade - better, include the prebuilt from toboot in this repo, and have instructions here to update them.

The macos prereqs should be brew tap osx-cross/arm && brew install arm-gcc-bin instead of the arm-gcc website.

Windows 10 wont recognize USB examples

Despite trying both techniques mentioned in im-tomu/toboot#23 I am unable to get Windows to recognize any of the usb- examples; miniblink works fine, but anything requiring a USB driver results in:

Windows has stopped this device because it has reported problems. (Code 43)

A request for the USB device descriptor failed.

in Device Manager. Please let me know if there's any more info I can provide or docs I may have missed etc. - thanks! :bowtie:

quickstart documentation should contain links on the programming API

Hi @mithro. Ok, so I flashed ledpulse, it works (after reflashing the bootloader and rescuing tomus that wouldn't flash).

I then spent hours looking at it, doing my own example with much trial and error as I can't find any documentation for the APIs used, and all I know how to debug with is whether the LED turned on or off, and I can't even seem to change it with set or clear, but only with gpio_toggle. Sure, there is a libopencm3/include/libopencm3/efm32/common/gpio_common.h which isn't much of an API.

I'm totally shooting in the dark, it's not fun.
Could write documentation that gives more info on what to do next, written for someone who only knows arduino style programming? (a reasonable target I assume).

After some searching, and figuring out what chip I had, I found http://libopencm3.org/docs/latest/efm32g/html/modules.html
but that doesn't quickly show me how to use gpio_set vs toggle
None of the examples in https://github.com/libopencm3/libopencm3-examples/tree/master/examples seem to be for this chip.

Similarly, outside of LED debugging, there is obviously no Serial.print debugging. Can you give more details on how to setup an emulator and do proper debugging given that using the target for that, is an exercise in frustration?
Thanks

TOBOOT_CONFIG_FLAG_AUTORUN

I'm deffinitively missing something...
How should I enable/disable TOBOOT_CONFIG_FLAG_AUTORUN ??

Tomu always returns to programming mode.
How can I make my program runs when inserting Tomu?

Thanks

Can't get U2F working

Hi,

I've flashed and reflashed the U2F(built and rebuilt) firmware but I can't get it to run on Tomu.
I just get a solid red light, no HID is detected and I have to restart in bootloader mode to make it usable again.
Touching the buttons has no effect.
I've also tried this FW:
https://github.com/gl-sergei/u2f-token
I am thinking there is an incompatibility either with the bootloader FW(v2.0-rc7) or worse a hardware issue.
I got my Tomu this week so it's brand new, all I did was flash the latest bootloader with dfu-util on it.

I've also tested the sample which wiggles the mouse pointer back and forth and that works so maybe the hardware is ok, it's just an issue with the U2F code.

Nothing builds with Ubuntu 18.04

This isn't your fault, but you should know about it. Something broke in the gcc toolchain between Ubuntu 16.04 and 18.04, and many programs you build and try to flash to your Tomu will fail to load. The miniblink example works, but u2f and usb-audiostream don't. They all work if built with 16.04.

I think this was happening with GnuK as well.

I worked around this by starting up a Google Compute Engine instance with 16.04 and scping stuff back and forth. It scratched my itch, but it's pretty annoying.

I hope someone narrows down exactly what's wrong and files a good bug with whichever tool is broken. I haven't had time to compare generated object files, which is what I'd do to start with.

arm-none-eabi/bin/ld: cannot find -lstdc++ error when running make

On Linux Mint 18.3 (based on Ubuntu 16.04) I kept getting the following error trying to run make:

$ make
  CC       miniblink.c	miniblink.o
  LD       miniblink.elf
/usr/lib/gcc/arm-none-eabi/4.9.3/../../../arm-none-eabi/bin/ld: cannot find -lstdc++
collect2: error: ld returned 1 exit status
../Makefile.common:59: recipe for target 'miniblink.elf' failed
make: *** [miniblink.elf] Error 1

I had installed the listed tools using sudo apt-get install gcc-arm-none-eabi libnewlib-arm-none-eabi make dfu-util but it seems there is one more that is required (at least for my system). After installing the libstdc++-arm-none-eabi-newlib package I was able to build the example files.

Didn't see much detail about this error online, so figured I would add a note here. May want to update the docs.

Thanks!

cbmbasic loaded onto tomu freezes after first keystroke

Steps to reproduce on macOS:

  • Run make to build cbmbasic.dfu
  • Run dfu-util -D cbmbasic.dfu
  • Run minicom -D /dev/tty.usbmodemC641
  • Pressing any key freezes cbmbasic

I also tried another serial terminal to exclude minicom as the culprit.

This is as far as I get:

image

Build error on USB HID example

I'm running arch linux and I have installed the ARM cross-compiler and dfu-utils.

$ cd usb-hid/
$ make
  CC       usb-hid.c	usb-hid.o
In file included from ../libopencm3/include/libopencm3/cm3/common.h:23,
                 from usb-hid.c:28:
/usr/lib/gcc/arm-none-eabi/8.1.0/include/stdint.h:9:16: fatal error: stdint.h: No such file or directory
 # include_next <stdint.h>
                ^~~~~~~~~~
compilation terminated.
make: *** [../Makefile.common:86: .obj/usb-hid.o] Error 1

program persistence after unplugging

Whenever I unplug my tomu and plug it back in, the program I had loaded on it disappears and I return to the bootloader which blinks between red and green quickly. Is there a way to keep the program I had loaded?
I load the program with:

$ make
$ dfu-util -D captouch.dfu 

I'm on macOS, running dfu-util -l before I download the program gives me

$ dfu-util -l
dfu-util 0.9

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2016 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/

Deducing device DFU version from functional descriptor length
Found Runtime: [05ac:8289] ver=0149, devnum=12, cfg=1, intf=3, path="20-3.3", alt=0, name="UNKNOWN", serial="UNKNOWN"
Found DFU: [1209:70b1] ver=0101, devnum=17, cfg=1, intf=0, path="20-2", alt=0, name="Tomu Bootloader (5) v2.0-rc7", serial="UNKNOWN"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.