Giter Club home page Giter Club logo

arduino-lufa's People

Contributors

crazyredmachine avatar dak0r avatar ifreilicht avatar palatis 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

arduino-lufa's Issues

installation instuctions outdated

I stumbled upon this repo while trying to get lufa working on a leonardo board and decided to give it a shot.

with the 1.6.12 version of arduino studio, the files mentioned in the installation section changed:

HID.cpp doesn't exist anymore
the line numbers in Arduino.h and main.cpp are off
the lines meant for main.cpp are already there
Platform.h doesn't exist anymore

I'm not sure what route I'll go from here to get lufa working, if it is relevant to this repo, there will be a pull request, if you or anyone else knows how to do it now before that that'd be even better.

Unable to upload project

Hi,

Followed the instructions and compiled for the Arduino Leonardo. Uploaded and everything worked fine using the LUFA_DualVirtualSerial example.

I wanted to makes some changes, but have been unable to upload the modified project.
I get:

avrdude: butterfly_recv(): programmer is not responding

I get the same result on PORT6 and PORT7.

I've tried hitting the reset switch once the PORTS string appears, but this doesn't help.

Any thoughts on what I'm missing?

Full log here:
https://pastebin.com/j0VtwK5Y

Cheers,
Matt.

Error when verifying

Not 100% sure as I'm a newbie but here is the error message. I'm trying to use lufa in order to combine hid and mass storage onto one board/bootloader which is impossible with the Arduino libraries.

lufa_Arduino_error

Edit: For error output clarification. Added pic instead of copy and pasting the error output text.

Implement "activate" and "deactivate" script for easier and reversible installation

From #4:

Additionally, it seems to me like there is little reason to actually execute step 3 of the installation instructions. Step 4 seems to be enough. I could see the argument of wanting to give more accurate error messages to people who accidentally import libraries using the USB core.
Either way, it would be enough to just append .removed to the filenames of these files and to enclose the lines in step 4 with #if 0 and #endif or /* and */. This way it would also be easier to activate and deactivate LUFA in a regular Arduino installation. To implement this, I'd write a simple script that does exactly what I described above, and another one to reverse these changes.

To make these two scripts cross-platform, I'd implement them in Python. The deactivate script would import the activate one for all paths, so it can be guaranteed that it always perfectly reverses what the activate script did.

Maybe "activate" and "deactivate" aren't prefect names for these yet, I'm open to suggestions on that front.

Another idea would be to ship the LUFA.h file with an #error directive that gets commented out by the activate script to give a descriptive error message when a user tries to include the LUFA library without activating first. In the same vein, instead of renaming the USB-related files, we could just insert an #error directive at the top of each of them, so when a user tries to compile another project that uses the Arduino USB stack, they get a descriptive error message as well.

Thoughts?

Just question can i use dis on window

I’m an armature wen it come to this things and I wanted to know if I can use this in windows.if it is imposible it’s fine because a can use and raspberry pi but I don’t know if installation process is the same

Example is not compatible with LUFA

In the latest version of LUFA - 170418 - a very old bug in the signature of CALLBACK_USB_GetDescriptor was fixed.

As a result, the DualVirtualSerial example is not compatible with this version. I'll create a pull request to fix this.

Better libary / custom boards handling

Changes have been made so that LUFA could be enabled/disabled by selecting a board type after running the new "install.py" python script.

While this enhances the workflow, there is still room for improvement as the Arduino IDE has a "board manager" which is meant for new boards installation (as used by Adafruit and other third party boards manufacturers), which would allow the end user to install the new boards without having to install python or even use the commandine at all.

I've got a PoC working on this branch : https://github.com/CrazyRedMachine/Arduino-Lufa/tree/library

Workflow from a fresh arduino IDE install

Install LUFA library

Library is now installed

Install custom boards

  • in arduino IDE, add a new URL to File -> Preferences -> Additional Boards Manager URLs : https://github.com/CrazyRedMachine/Arduino-Lufa/raw/library/custom_boards/package_arduino-lufa_index.json

image

  • Restart Arduino IDE
  • in arduino IDE, go to Tools > Board > Boards Manager, wait for the list to load then type LUFA in the search box

image

  • Click install

Boards are now in the board list

From PoC to prod

  • (WIP) bump the library to 1.5 format by adding a library.properties file
  • create a "release" from github menu so that LUFA can appear directly in the arduino library manager rather than having to use the "add ZIP library"
  • change package_arduino-lufa_index.json contents to reflect the Palatis repo rather than my fork
  • update README to reflect the new install procedure

also a nice to have feature would be a generate.py script to automatically generate a new custom boards zip with new version number and the relevant data to be appended to the index.json... but i'm not sure yet if that's a good idea because it might break stuff and sometimes making changes to that might require further human intervention anyways...

URL / project is not working

I entered the following url https://github.com/Palatis/Arduino-Lufa/raw/master/package_arduino-lufa_index.json as the additional board within the preferences.

Your URL within the package_arduino-lufa_index.json file is not working. You don't have a version tagged under this Git repo.

Try for example this link yourself: https://github.com/Palatis/Arduino-Lufa/archive/refs/tags/1.0.zip (it's not found!)

This will most likely gives a lot of problems, since I think the Arduino IDE 2 won't download or install this project. For example I'm also missing the examples (only see built-in examples):

image

error compilation

i install the older arduino version and the newer ,i hav the same error

Arduino : 1.8.3 (Windows 10), Carte : "Arduino/Genuino Uno"

In file included from C:\Program Files (x86)\Arduino\libraries\LUFA/LUFA/LUFA/Drivers/USB/USB.h:383:0,

             from C:\Program Files (x86)\Arduino\libraries\LUFA/LUFA.h:11,

             from C:\Program Files (x86)\Arduino\libraries\LUFA\examples\LUFA_DualVirtualSerial\LUFA_DualVirtualSerial.ino:9:

C:\Program Files (x86)\Arduino\libraries\LUFA/LUFA/LUFA/Drivers/USB/Core/USBMode.h:260:7: error: #error USB_DEVICE_ONLY is not available for the currently selected microcontroller model.

  #error USB_DEVICE_ONLY is not available for the currently selected microcontroller model.

   ^

C:\Program Files (x86)\Arduino\libraries\LUFA/LUFA/LUFA/Drivers/USB/Core/USBMode.h:271:6: error: #error The currently selected device, USB mode or architecture is not supported.

 #error The currently selected device, USB mode or architecture is not supported.

  ^

In file included from C:\Program Files (x86)\Arduino\libraries\LUFA/LUFA/LUFA/Drivers/USB/Core/USBController.h:150:0,

             from C:\Program Files (x86)\Arduino\libraries\LUFA/LUFA/LUFA/Drivers/USB/Core/USBTask.h:47,

             from C:\Program Files (x86)\Arduino\libraries\LUFA/LUFA/LUFA/Drivers/USB/USB.h:386,

             from C:\Program Files (x86)\Arduino\libraries\LUFA/LUFA.h:11,

             from C:\Program Files (x86)\Arduino\libraries\LUFA\examples\LUFA_DualVirtualSerial\LUFA_DualVirtualSerial.ino:9:

C:\Program Files (x86)\Arduino\libraries\LUFA/LUFA/LUFA/Drivers/USB/Core/AVR8/USBController_AVR8.h:114:5: error: #error No PLL prescale value available for chosen F_USB value and AVR model.

#error No PLL prescale value available for chosen F_USB value and AVR model.

 ^

exit status 1
Erreur de compilation pour la carte Arduino/Genuino Uno

Ce rapport pourrait être plus détaillé avec
l'option "Afficher les résultats détaillés de la compilation"
activée dans Fichier -> Préférences.

thank for your help

Error compiling for sparkfun pro micro

I am on Ubuntu 18.04 and using Arduino 1.8.3 since the activate.py script seems to want this version.
I am trying to compile the example program. I have run activate.py and it's output was all successes.

Here is the error message:
Archiving built core (caching) in: /tmp/arduino_cache_770586/core/core_SparkFun_avr_promicro_cpu_16MHzatmega32U4_4ec126580105bbcfef3f91ee9bd9669d.a USBCore.cpp.o (symbol from plugin): In function RxLEDPulse':
(.text+0x0): multiple definition of __vector_11' sketch/LUFA.c.o (symbol from plugin):(.text+0x0): first defined here USBCore.cpp.o (symbol from plugin): In function RxLEDPulse':
(.text+0x0): multiple definition of __vector_10' sketch/LUFA.c.o (symbol from plugin):(.text+0x0): first defined here collect2: error: ld returned 1 exit status exit status 1 Error compiling for board SparkFun Pro Micro.

Build with LUFA and SD/SdFat libraries fail

Hi!,
I'm trying to include SD or SdFat library on a LUFA project but I get build errors.

The project corretly build with "Arduino Leonardo" board, but fail with the "Arduino Leonardo (LUFA)" board:
In file included from C:\Program Files (x86)\Arduino\libraries\SD\src/SD.h:21:0, from C:\Users\frolando.DLC0YLZW2\Desktop\SD-1.2.4\examples\Files\Files.ino:3: C:\Program Files (x86)\Arduino\libraries\SD\src/utility/SdFatUtil.h: In function 'void SerialPrint_P(const char*)': C:\Program Files (x86)\Arduino\libraries\SD\src/utility/SdFatUtil.h:63:5: error: 'Serial' was not declared in this scope Serial.write(c); ^~~~~~

Here a project created for the tests:

#include <SPI.h>
#include <SD.h>

#include <LUFA.h>
#include <LUFACDCSerial.h>

File myFile;

void setup() {
if (!SD.begin(4)) {
while (1);
}

// open a new file and immediately close it:
myFile = SD.open("example.txt", FILE_WRITE);
myFile.close();
}

void loop() {
// nothing happens after setup finishes.
}

I've attached both logs.

Do you have any suggestions?

Thanks!

build_log_Arduino-Leonardo.txt
build_log_Arduino-Leonardo-(LUFA).txt

pull in LUFA as a git submodule for simplified install procedure

These are the installation instructions as of today:

  1. clone the repository, drop it in your arduino-x.x.x_LUFA/libraries (for instance, you should have arduino-x.x.x_LUFA/libraries/LUFA/LUFA.h after this step.
  2. download [LUFA], put everything under LUFA/ to arduino-x.x.x_LUFA/libraries/LUFA/LUFA (for instance, you should have arduino-x.x.x_LUFA/libraries/LUFA/LUFA/Drivers/USB/USB.h after this step)
  3. delete the stock USB stack from Arduino environment, there are 7 files to be deleted:
    1. arduino-x.x.x_LUFA/hardware/arduino/avr/cores/arduino/CDC.cpp
    2. arduino-x.x.x_LUFA/hardware/arduino/avr/cores/arduino/PluggableUSB.cpp
    3. arduino-x.x.x_LUFA/hardware/arduino/avr/cores/arduino/PluggableUSB.h
    4. arduino-x.x.x_LUFA/hardware/arduino/avr/cores/arduino/USBApi.h
    5. arduino-x.x.x_LUFA/hardware/arduino/avr/cores/arduino/USBCore.cpp
    6. arduino-x.x.x_LUFA/hardware/arduino/avr/cores/arduino/USBCore.h
    7. arduino-x.x.x_LUFA/hardware/arduino/avr/cores/arduino/USBDesc.h
  4. edit the following files and remove the shown lines:
    1. arduino-x.x.x_LUFA/hardware/arduino/avr/cores/arduino/Arduino.h
    * 233: #include "USBAPI.h"
    * 234: #if defined(HAVE_HWSERIAL0) && defined(HAVE_CDCSERIAL)
    * 235: #error "Targets with both UART0 and CDC serial not supported"
    * 236: #endif
    2. arduino-x.x.x_LUFA/hardware/arduino/avr/cores/arduino/main.cpp
    * 39: #if defined(USBCON)
    * 40: USBDevice.attach();
    * 41: #endif

I think a few things could be improved about this. First, it would be helpful to allow using LUFA as a git submodule instead of manually copying it. This way a user can just use git clone --recursive to get everything they need.

Additionally, it seems to me like there is little reason to actually execute step 3 of the installation instructions. Step 4 seems to be enough. I could see the argument of wanting to give more accurate error messages to people who accidentally import libraries using the USB core.
Either way, it would be enough to just append .removed to the filenames of these files and to enclose the lines in step 4 with #if 0 and #endif or /* and */. This way it would also be easier to activate and deactivate LUFA in a regular Arduino installation. To implement this, I'd write a simple script that does exactly what I described above, and another one to reverse these changes.

This would mean that to install LUFA for Arduino, this command would be enough:

$ git clone --recursive https://github.com/Palatis/Arduino-Lufa.git LUFA; ./LUFA/activate

I'd be willing to implement this myself, any thoughts on the general idea?

DualVirtualSerial sample half-working

Hello; thanks for your work here. When I upload the sample to a Leonardo board, on the serial console I see only partial messages, as if only the first byte of each print/println actually made it through:

Capture d’écran 2020-03-29 à 17 12 31

This happens with the Arduino IDE 1.8.12 on both Linux (Ubuntu 19.10) and macOS 10.15.4. Am I missing something ? I tried all baud rates available.

NodeMCU support?

Hi,

I'm pretty new to microprocessor development. I have a NodeMCU board, however, it doesn't seem to work with Arduino-Lufa. It's ESP-12/ESP8266-based, and with that being a different architecture, compiling this software for that board without extensive modification is out of the question, correct? Or am I missing something? My Arduino IDE can compile other Arduino software onto my NodeMCU just fine.

Thanks!

This doesn't work in my side

I have tried your example(DualVirtualSerial) but it doesn't work.

In the device manager, 2 new COM ports are shown. But I can't receive any data by use serial port utility(one sending and one receiving).

I'm not sure if I have missed any thing.

Thanks a lot.

Changing EP0 size

I was wondering what would be required for me to implement different endpoint 0 sizes, where in existing code would the changes have to be implemented.

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.