Problems with Teensy++ 2.0 and LUFA

Status
Not open for further replies.

poxyran

Member
Hi!,

I want to start a project based on one of the examples included in LUFA but I'm having some troubles making it work with my Teensy++ 2.0.

The specific example is the RNDIS Demo.

What I did is this:

1) I cloned the LUFA lib branch from https://github.com/adafruit/lufa-lib
2) I compiled the RNDISEthernet demo from Demos/Device/LowLevel/RNDISEthernet using the Atmel Toolchain from here: http://www.atmel.com/tools/ATMELAVRTOOLCHAINFORLINUX.aspx the one I used was tmel AVR 8-bit Toolchain 3.4.5 - Linux 64-bit
3) Once I had the corresponding .elf file, I generated the .hex file using the following command: avr-objcopy -O ihex -R .eeprom -R .fuse -R .lock -R .signature main.elf main.hex
4) I uploaded the .hex file to the teensy board using the Teensy loader.

But when I plugged it in my Windows 7 SP1 Ultimate x64 nothing happened.

The LUFA doc says:

"""
* Remote Network Driver Interface demonstration application.
* This gives a simple reference application for implementing
* a CDC RNDIS device acting as a simple network interface for
* ethernet packet exchange. RNDIS is a proprietary Microsoft
* standard; this demo will only work on Windows 2000 (manually
* patched with the Microsoft RNDIS hotfix) and above (with no
* manual patches), or on the latest Linux kernels.
*
* Before running, you will need to install the INF file that
* is located in the RNDISEthernet project directory. This will
* enable Windows to use its inbuilt RNDIS drivers, negating the
* need for special Windows drivers for the device. To install,
* right-click the .INF file and choose the Install option. If
* Windows 2000 is used, the Microsoft INF file in the hotfix
* will need to be altered to use the VID/PID of the demo and
* then chosen instead of the LUFA RNDIS INF file when prompted.
*
* When enumerated, this demo will install as a new network
* adapter which ethernet packets can be sent to and received
* from. Running on top of the adapter is a very simple TCP/IP
* stack with a HTTP webserver and TELNET host which can be
* accessed through a web browser at IP address 10.0.0.2:80 or
* through a TELNET client at 10.0.0.2:25. This device also supports
* ping echos via the ICMP protocol.
*
"""

I tried to install the .inf provided by the project but is doen't work, it produce an error: "The INF file you selected does not support this method of installation".

So, I tried it on a Linux box (Ubuntu 14.04 LST x64) but is doesn't worked either. No other network interface is created.

The question is: What I'm doing wrong?. I feel very frustrated.

Btw, I posted the same issue in the LUFA support mailing list but no one answered.
 
I can't help much with LUFA, and I definitely can not help at all with Windows installation issues using LUFA's INF files!

But I can suggest running "tail -f /var/log/syslog" in a terminal window when you try with Linux. If the LUFA code is working at all, Linux will log kernel messages about what type of device is sees.

It's possible Teensy might be "working" with LUFA, but something is misconfigured in the code, causing LUFA to give wrong into to Linux & Windows. In the case of Teensy actually managing to communicate but sending wrong info, those Linux kernel messages are the quickest way to at least see basic info. If it does up come, running "lsusb -v" might give more detailed info. Maybe the info you see can help you compare with the LUFA code to deduce what's wrong?

It's also possible LUFA could be not working at all, or working only so far as turning on the USB presence resistor, but then not actually doing any communication. If Linux logs nothing, of course try plugging in known-good devices (or just press the button on Teensy++) so you can see examples of what Linux prints when it sees working USB devices. If Linux logs messages that is saw a device appear but then communication errors and no device ID, that's probably a good sign LUFA is turning on the resistor but then getting hung up on actually using the USB. In that scenario, check the settings in the makefile, especially to verify LUFA is compiling for Teensy's 16 MHz crystal and not the 8 MHz crystal used on some other boards.

That's about all the help I can give regarding LUFA. I know it's frustrating, but I simply haven't used LUFA much... and the few times I did, it seemed like an incredible mountain of complex abstraction layers to dig though to figure out pretty much anything.

Maybe this will help replace "nothing happens" with more detailed info, when you try posting again on Dean Camera's LUFA support group. That's really the only place to get any support for LUFA.
 
Hi Paul!,

as always, thanks for the answer.

Well, the "tail -f /var/log/syslog" command does not say anything related to the teensy nor the "lsusb -v". There isn't any descriptor related to the ones used in demo example. Could be this possible?. As you mentioned, maybe the LUFA code is not working at all.

Just for you to know, this is the make file used when compiled the demo code: http://pastebin.com/LGgtiGiF

I just changed the MCU parameter to at90usb1286 to match the teensy.
 
Btw, is the code from LUFA the only available on how to "use" RNDIS on a micro-controller?. I didn't find much information about this. All the references point to LUFA-only code.

Btw, I only have teensy 2/3 and some Arduinos. Maybe there is other boards/APIs that make this task easier for non micro-controllers guys like me?.
 
@paul: the makefile of the rndis project included in LUFA has a parameter named F_CPU. The docs say: This parameter indicates the target microcontroller's main CPU clock frequency, in Hz. This is used by many libraries (and applications) for timing related purposes, and should reflect the actual CPU speed after any prescaling or adjustments are performed.

The current value is 8000000 but maybe it should be 16000000?
 
Hi Paul!,

me again.

I'm still having some problems with this demo.

With the changes I mentioned before, the RNDIS device is recognized by the OS and a new network adapter is shown in the "Network Connections" panel on Windows. But a message saying "Network cable unplugged" is shown. I configured the interface as Dean explains in the example, with a static IP of 10.0.0.1 but if I ping it now answer is received, host unreachable.

I found this message in the mailing list that may be related to this issue: https://groups.google.com/forum/#!searchin/lufa-support/rndis/lufa-support/b2e6uhxdPps/MBvlKrmUpagJ

If you look at it, Dean ask: "Have you got a TCP/IP stack hooked to the RNDIS interface, such as the uIP library?". What does this mean?. I thought that the TCP library included with LUFA has already implemented a small TCP/IP stack. Why do I need another lib?.

Btw, I'm using Windows 7.

UPDATE: another ref to the problem: http://fourwalledcubicle.com/blog/2008/07/brain-unplugged/ but is seems very old, from the early days Dean was coding the example. I supposed this has to be fixed in the latest LUFA release.
 
Last edited:
Well, finally the demo is working. I don't know which was the error but I plugged in a VMware and worked!. Maybe some update, or something in the driver is different in my physical machine. I really don't know.
 
Status
Not open for further replies.
Back
Top