Code Monkey home page Code Monkey logo

Comments (23)

dhowland avatar dhowland commented on August 19, 2024

Yeah I don't distribute dfu-programmer with the source code. You have to install it yourself if you want to program directly through the keymapper. Otherwise, you can just use it the old fashioned way: save a binary and program it with your tool of choice.

from easyavr.

hschraep avatar hschraep commented on August 19, 2024

But it is installed:
$ whereis dfu-programmer dfu-programmer: /usr/bin/dfu-programmer /usr/share/man/man1/dfu-programmer.1.gz

from easyavr.

dhowland avatar dhowland commented on August 19, 2024

Oh, actually I think it's not constructing the command line correctly for linux. Ugh, supporting windows and linux with one tool... not fun. Especially when you can't test one of them.

from easyavr.

8carlosf avatar 8carlosf commented on August 19, 2024

oh, I also had that problem, but assumed that it was my setup's fault. What I end up doing is generating the .hex file and using the dfu-programmer by hand in the terminal (no big deal). I assumed it was because I need sudo to use dfu-programmer and I don't want to use EasyAVR with sudo, I don't think I even tried that.

from easyavr.

dhowland avatar dhowland commented on August 19, 2024

pretty sure the problem is the quotes, which are for protection in Windows, but wouldn't be useful for *nix

from easyavr.

hschraep avatar hschraep commented on August 19, 2024

Witch quotas you mean:
programming.py:
loader_tools = [ 'dfu-programmer.exe', 'dfu-programmer', ]
or
this:
cmd = ('"%s" %s erase') % (self.tool_path, self.info.device.lower())

from easyavr.

dhowland avatar dhowland commented on August 19, 2024

I have committed a probable fix. If you download the latest code from the Master branch you can try it

from easyavr.

hschraep avatar hschraep commented on August 19, 2024

The double quotas i have also tryed
Same problem:
error2

from easyavr.

dhowland avatar dhowland commented on August 19, 2024

Well then, you probably need to either fix permissions (chown) or make it executable (chmod +x)

from easyavr.

hschraep avatar hschraep commented on August 19, 2024

I have updated the link.

from easyavr.

hschraep avatar hschraep commented on August 19, 2024

Which file did you mean that i should set with chown or chmod?

from easyavr.

dhowland avatar dhowland commented on August 19, 2024

/usr/bin/dfu-programmer

from easyavr.

hschraep avatar hschraep commented on August 19, 2024

Hi,
dfu-programmer needs no chmod +x because it could be exec as normal user. So i have figured out that the ATm32U4DFU usb device is the problem why we need sudo to programm the keyboard.
Now i have defined a udev rule sudo vim /etc/udev/rules.d/50-atmel-dfu.rules
with inside:

# Atmel ATMega32U4
SUBSYSTEMS=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2ff4", MODE:="0666"

get the above atributes from dmesg:

[ 1292.718521] usb 1-1.1: new full-speed USB device number 5 using ehci-pci
[ 1292.829457] usb 1-1.1: New USB device found, idVendor=03eb, idProduct=2ff4
[ 1292.829460] usb 1-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1292.829470] usb 1-1.1: Product: ATm32U4DFU
[ 1292.829471] usb 1-1.1: Manufacturer: ATMEL
[ 1292.829472] usb 1-1.1: SerialNumber: 1.0.0

and now it is possible to programm the keyboard without sudo:

dfu-programmer atmega32u4 erase
dfu-programmer atmega32u4 flash EasyAVR/keymapper/my_gh60.hex
dfu-programmer atmega32u4 start

But we have still the error on EasyAVR:
error3

from easyavr.

hschraep avatar hschraep commented on August 19, 2024

I have try this to test if it works:
vim call.py:

#!/usr/bin/env python
import os
cmd = os.popen("dfu-programmer --help").readlines()
print cmd

this prints me with python call.py:

Usage: dfu-programmer target[:usb-bus,usb-addr] command [options] [global-options] [file|data]

global-options:
        --quiet
        --debug level    (level is an integer specifying level of detail)
        Global options can be used with any command and must come
        after the command and before any file or data value

commands:
        configure {BSB|SBV|SSB|EB|HSB} [--suppress-validation] data
        dump
        dump-eeprom
        dump-user
        erase [--suppress-validation]
        flash [--suppress-validation] [--suppress-bootloader-mem]
                     [--serial=hexdigits:offset] {file|STDIN}
        flash-eeprom [--suppress-validation]
                     [--serial=hexdigits:offset] {file|STDIN}
        flash-user   [--suppress-validation]
                     [--serial=hexdigits:offset] {file|STDIN}
        get     {bootloader-version|ID1|ID2|BSB|SBV|SSB|EB|
                 manufacturer|family|product-name|
                 product-revision|HSB}
        getfuse {LOCK|EPFL|BOOTPROT|BODLEVEL|BODHYST|
                 BODEN|ISP_BOD_EN|ISP_IO_COND_EN|
                 ISP_FORCE}
        setfuse {LOCK|EPFL|BOOTPROT|BODLEVEL|BODHYST|
                 BODEN|ISP_BOD_EN|ISP_IO_COND_EN|
                 ISP_FORCE} data
        setsecure
        reset
        start
[]

But im not a developer so i hope only this helps here to solve the problem. If i can try something for you i could do it.

from easyavr.

dhowland avatar dhowland commented on August 19, 2024

Okay I re-read the python docs and found the problem. I should be able to fix it pretty quick.

from easyavr.

dhowland avatar dhowland commented on August 19, 2024

Alright, I've committed more changes to Master. This should work.

The Popen object works somewhat differently on Unix platforms. Thanks for doing the testing on Linux, I have no way to do it myself.

from easyavr.

hschraep avatar hschraep commented on August 19, 2024

now it looks better but "launch" needs to be replaced by "start"

Usage: dfu-programmer target[:usb-bus,usb-addr] command [options] [global-options] [file|data]

global-options:
        --quiet
        --debug level    (level is an integer specifying level of detail)
        Global options can be used with any command and must come
        after the command and before any file or data value

commands:
        configure {BSB|SBV|SSB|EB|HSB} [--suppress-validation] data
        dump
        dump-eeprom
        dump-user
        erase [--suppress-validation]
        flash [--suppress-validation] [--suppress-bootloader-mem]
                     [--serial=hexdigits:offset] {file|STDIN}
        flash-eeprom [--suppress-validation]
                     [--serial=hexdigits:offset] {file|STDIN}
        flash-user   [--suppress-validation]
                     [--serial=hexdigits:offset] {file|STDIN}
        get     {bootloader-version|ID1|ID2|BSB|SBV|SSB|EB|
                 manufacturer|family|product-name|
                 product-revision|HSB}
        getfuse {LOCK|EPFL|BOOTPROT|BODLEVEL|BODHYST|
                 BODEN|ISP_BOD_EN|ISP_IO_COND_EN|
                 ISP_FORCE}
        setfuse {LOCK|EPFL|BOOTPROT|BODLEVEL|BODHYST|
                 BODEN|ISP_BOD_EN|ISP_IO_COND_EN|
                 ISP_FORCE} data
        setsecure
        reset
        start
[]

from easyavr.

dhowland avatar dhowland commented on August 19, 2024

What version are you using?

D:\Code\EasyAVR\keymapper\easykeymap\exttools>dfu-programmer.exe --help
dfu-programmer 0.7.0
https://github.com/dfu-programmer/dfu-programmer
Usage: dfu-programmer target[:usb-bus,usb-addr] command [options] [global-options] [file|data]

global-options:
        --quiet
        --debug level    (level is an integer specifying level of detail)
        Global options can be used with any command and must come
        after the command and before any file or data value

command summary:
        launch       [--no-reset]
        read         [--force] [--bin] [(flash)|--user|--eeprom]
        erase        [--force] [--suppress-validation]
        flash        [--force] [(flash)|--user|--eeprom]
                     [--suppress-validation]
                     [--suppress-bootloader-mem]
                     [--serial=hexdigits:offset] {file|STDIN}
        setsecure
        configure {BSB|SBV|SSB|EB|HSB} [--suppress-validation] data
        get     {bootloader-version|ID1|ID2|BSB|SBV|SSB|EB|
                 manufacturer|family|product-name|
                 product-revision|HSB}
        getfuse {LOCK|EPFL|BOOTPROT|BODLEVEL|BODHYST|
                 BODEN|ISP_BOD_EN|ISP_IO_COND_EN|
                 ISP_FORCE}
        setfuse {LOCK|EPFL|BOOTPROT|BODLEVEL|BODHYST|
                 BODEN|ISP_BOD_EN|ISP_IO_COND_EN|
                 ISP_FORCE} data

additional details:
 launch: Launch from the bootloader into the main program using a watchdog
         reset.  To jump directly into the main program use --no-reset.
   read: Read the program memory in flash and output non-blank pages in ihex
         format.  Use --force to output the entire memory and --bin for binary
         output.  User page and eeprom are selected using --user and --eprom
  erase: Erase memory contents if the chip is not blank or always with --force
  flash: Flash a program onto device flash memory.  EEPROM and user page are
         selected using --eeprom|--user flags. Use --force to ignore warning
         when data exists in target memory region.  Bootloader configuration
         uses last 4 to 8 bytes of user page, --force always required here.
Note: version 0.6.1 commands still supported.

from easyavr.

hschraep avatar hschraep commented on August 19, 2024

This is the standard version on ubuntu 16.04 TLS:

~$ dfu-programmer --version
dfu-programmer 0.6.1

from easyavr.

dhowland avatar dhowland commented on August 19, 2024

WTF? Goddamn package managers over there are slacking. Version 0.7.0 is almost 3 years old

from easyavr.

dhowland avatar dhowland commented on August 19, 2024

okay i've committed what should be the last fix. I've tried it on Windows and it works

from easyavr.

hschraep avatar hschraep commented on August 19, 2024

Greate job now it works. If you have something to test within linux you can ask me ;-).
running

from easyavr.

dhowland avatar dhowland commented on August 19, 2024

Great, thanks.

from easyavr.

Related Issues (20)

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.