OSX USB Serial Driver

489 views
Skip to first unread message

Wolfram Niessen

unread,
May 31, 2013, 2:58:50 PM5/31/13
to lufa-s...@googlegroups.com
Hi,

I have the source code for a special USB Serial Interface Driver.
Can Anyone help me to compile it for OSX?

Thanks
Wolfram

Rodolphe Pineau

unread,
May 31, 2013, 8:40:06 PM5/31/13
to lufa-s...@googlegroups.com
I can probably help. We might need more detail though.
Is it a OS X driver ? If you have the source code , did you try compiling it in XCode ?
Or do you have the source for another OS and you want to port it to OS X ?

Regards, Rodolphe


--

| Rodolphe Pineau RTI-Zone |
| http://www.rti-zone.org/ |
| Robotics / Unix / Mac OS X / Astronomy |


Wolfram Niessen

unread,
Jun 1, 2013, 5:26:19 PM6/1/13
to lufa-s...@googlegroups.com
Hi,

well I'm not really a programmer. I have written a small Program in Basic to send a File over a Special RS422 Interface.
This Interface as just a Windows driver and the source Code of it.  ...Is not much Code
Now I want to use this on OSX.
You can download the Source of the Diver here EMuSer_v1_00_3 and the old LUFA version for that here
LUFA-090924 and I think you need this Library avr-libc-1.7.2rc2252.tar.bz2.

Thank you very much!

Rodolphe Pineau

unread,
Jun 1, 2013, 7:06:07 PM6/1/13
to lufa-s...@googlegroups.com

On Jun 1, 2013, at 14:26, Wolfram Niessen <mrwoo...@gmail.com> wrote:

> Hi,
>
> well I'm not really a programmer. I have written a small Program in Basic to send a File over a Special RS422 Interface.
> This Interface as just a Windows driver and the source Code of it. ...Is not much Code
> Now I want to use this on OSX.
> You can download the Source of the Diver here EMuSer_v1_00_3 and the old LUFA version for that here
> LUFA-090924 and I think you need this Library avr-libc-1.7.2rc2252.tar.bz2.
>
> Thank you very much!
>

The driver is not really a driver.. it's a Windows INF file to let window recognize the AVR as a " Windows USB CDC ACM" device.
OS X has native support for ACM device. The need to report the proper CDC class.
I flashed the firmware (USBtoSerialEmu_Teensy2_0.hex) on one of my teensy 2.0 board and it does show up as a serial port (/dev/tty.usbmodem1d1141 and /dev/cu.usbmodem1d1141 in my case).

There is no code to compile from the OS X side of things as this is a standard ACM device.

BUT .. from the doc, it looks like the device is expecting to be set at a non standard baud rate for a serial port (500000). OS X relies on standard RS232 BSD speed and 500000 is not a valid speed. To be able to do this it would require us to get the OS X CDC ACM kernel extension code a rewrite part of it to allow unsupported speed via extra ioctl.

Have you try with a teensy flashed with this firmware to use it ? What software uses this EMuSer ?

I can't recompile the firmware as some files are missing :
EMuSer_v1_00_3/Sourcecode/LUFA 090924/Demos/Device/LowLevel/USBToSerialEmu
Issues with filename… makefile and c files reference USBtoSerialEmu.* but the actual name are USBToSerialEmu (capital T) : this break on Unix and OS X
USBToSerialEmu.c inclide USBToSerialEmu.h .. which doesn't exists

EMuSer_v1_00_3/Sourcecode/LUFA 090924/Demos/Device/LowLevel/USBToSerialEmu_AVRNoLeds :
empty dirs… nothing in there

EMuSer_v1_00_3/Sourcecode/LUFA 090924/Demos/Device/LowLevel/USBToSerialEmu_TEENSY
empty dirs… nothing in there

EMuSer_v1_00_3/Sourcecode/LUFA 090924/Demos/Device/LowLevel/USBToSerialEmu_TEENSY_plus :
empty dirs… nothing in there


Are you the author ? if yes, some file are missing so add them to http://users.skynet.be/emxp/EMuSer_v1_00_3.zip and I can try recompiling them but this has nothing to do with OS X (by this I mean the firmware).

Regards, Rodolphe


>
>
> On Saturday, June 1, 2013 2:40:06 AM UTC+2, rpineau wrote:
>
> On May 31, 2013, at 11:58, Wolfram Niessen <mrwoo...@gmail.com> wrote:
>
> > Hi,
> >
> > I have the source code for a special USB Serial Interface Driver.
> > Can Anyone help me to compile it for OSX?
> >
> > Thanks
> > Wolfram
> >
>
> I can probably help. We might need more detail though.
> Is it a OS X driver ? If you have the source code , did you try compiling it in XCode ?
> Or do you have the source for another OS and you want to port it to OS X ?
>
> Regards, Rodolphe
>
>
> --
>
> | Rodolphe Pineau RTI-Zone |
> | http://www.rti-zone.org/ |
> | Robotics / Unix / Mac OS X / Astronomy |
>
>
>
> --
> You received this message because you are subscribed to the Google Groups "LUFA Library Support List" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to lufa-support...@googlegroups.com.
> To post to this group, send email to lufa-s...@googlegroups.com.
> Visit this group at http://groups.google.com/group/lufa-support?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Wolfram Niessen

unread,
Jun 2, 2013, 12:23:05 PM6/2/13
to lufa-s...@googlegroups.com
Hi,

of curse the inter face works by default withe the LUFA Demo driver as USB-Seriel Interface, but it dos not accept the 31250 and 500000 baud rate. Thats my Problem

I also write the guy from EMXP - EMUser and Dean from fourwalledcubicle.com a mail but I get no response till now.

Thank You

Wolfram

Dean Camera

unread,
Jun 2, 2013, 4:20:34 PM6/2/13
to LUFA Library Support List
Hi Wolfram,

Sorry I missed your first two emails and was late responding here -
I've had thirty something emails in the last week asking for help, so
it was stuck down in a queue a fair bit.

I just took a look and it does indeed seem like the author of the
project has been a bit too judicious in stripping out unnecessary
source code files, and has accidentally not included some of the
important ones. I had a quick go at getting it to compile, but it was
still breaking on some of the makefile dependencies. The best option
would be to get the author to give you a complete version of the code
-- the alternative would be to port his application specific changes
to the latest LUFA library release. Is there a reason you need his
special application code and can't use the generic USBtoSerial or CDC
device demos? The only code changed appears to be the USART
configuration in reponse to a line encoding change from the host,
which should be easily integrated into a more modern, complete version
of the USBtoSerial demo.

Cheers!
- Dean

On Jun 2, 6:23 pm, Wolfram Niessen <mrwoof1...@gmail.com> wrote:
> Hi,
>
> of curse the inter face works by default withe the LUFA Demo driver as
> USB-Seriel Interface, but it dos not accept the 31250 and 500000 baud rate.
> Thats my Problem
> Dose these Files help you...  Firmware for AT90USBKEY v01.00.01<http://users.skynet.be/emxp/Firmware_EmuComBox_AT90USBKEY_v1_00_1.zip>
>   and  Firmware for Teensy++ 2.0 v01.00.01<http://users.skynet.be/emxp/Firmware_EMuSer_TeensyPlus2_0_v1_00_1.zip>? Its
> fromhttp://users.skynet.be/emxp/EMuSer.htm.

Rodolphe Pineau

unread,
Jun 2, 2013, 7:52:11 PM6/2/13
to lufa-s...@googlegroups.com

On Jun 2, 2013, at 13:50, w.ni...@gmx.de wrote:

> Hi Dean,
>
> I need a 31250 and 50000 baut to communicate withe a old Music Instrument. At the moment I can't do that, I can use standard rats 300, 9600, 57000 ... .
>
> Many thanks for help!
>
>
>

The 31250 speed is for MIDI I assume.
The AVR can probably generate that speed easily on its serial port.
The key is to have the OS allow you to set that speed which is not possible on OS X as it only allows standard speed (aka the posix defined one).
If you try to set the speed using tcsetattr you get an error (EINVAL) as the speed value is "illegal" (I just tested it).
Which mean you would need the device to not register as a serial port and you would need to use different function than the posix one to access the port.
The other option is to use the device at 38400 and do the speed conversion to 31250 inside the AVR. The AVR has enough memory to buffer the data from the host as MIDI messages are not long. So when you get a message in EVENT_CDC_Device_LineEncodingChanged for a speed change, just set the speed on the AVR serial port to 31250 as the data speed between the AVR and the host is the USB speed and not the serial port speed.

Regards, Rodolphe

w.ni...@gmx.de

unread,
Aug 1, 2013, 7:14:23 PM8/1/13
to lufa-s...@googlegroups.com

Hi Rodolphe,

I'm a big step ahead. I can open the Serial port and send Data.
But not ever.
It seam so that there is a USB Buffer problem. Do you have any idea how to sniffer the Data between on the USB bus on OSX?

Regards
Wolfram

Rodolphe Pineau

unread,
Aug 1, 2013, 11:29:22 PM8/1/13
to lufa-s...@googlegroups.com

On Aug 1, 2013, at 16:14, w.ni...@gmx.de wrote:

>
> Hi Rodolphe,
>
> I'm a big step ahead. I can open the Serial port and send Data.
> But not ever.
> It seam so that there is a USB Buffer problem. Do you have any idea how to sniffer the Data between on the USB bus on OSX?
>
> Regards
> Wolfram
>

You will need to install USB Prober (available on apple dev site : https://developer.apple.com/downloads/index.action?q=IOUSB, you want the IOUSBFamily Log Release for OS X 10.8.4 package (or whatever match your current OS X version)).

Once you have usb prober running it'll log all the traffic in both direction.

If you can't access it because you don't have an Apple ID, contact me off list.

Could you describe the issues you're seeing with your buffering ? Is it a buffering issue inside the AVR or a buffering issue on OS X ?

Regards, Rodolphe

Wolfram Niessen

unread,
Aug 7, 2013, 9:14:32 AM8/7/13
to lufa-s...@googlegroups.com
Hi Rodolphe,

can you give me you E-Mail adress. It is hidden in the groop.
My Adress should be shown.

Thanks
Wolfram
Reply all
Reply to author
Forward
0 new messages