uarduno - FreeBSD® Kernel Driver
for the Arduino Uno


The 'uarduno' FreeBSD kernel driver was primarily designed for use with the i386 and AMD64 platforms on FreeBSD 7.x and 8.x (and, reportedly, 9.x). Use on other platforms and other versions of FreeBSD has not been verified, but is likely to work.

LICENSE: This code has been published under a BSD-like license, similar to that of the existing FreeBSD source, with appropriate licenses for the NetBSD® code on which the FreeBSD drivers were based. Both of the stated NetBSD and FreeBSD licenses apply. No additional restrictions apply, other than those that are similar to the BSD license. Therefore, free use has been granted, provided that existing licenses and copyright notices are included in any distributed version of the code. A copy of the actual license has been included in each of the applicable source files ('.c' and '.h'). Additional files (such as 'Makefile') may be used under the same license as the source.

PROJECT STATUS (as of 07/05/2011)

Driver features

Credits:


Usage

Following installation to the appropriate kernel directory, the 'uarduno' driver module must be dynamically loaded into the kernel prior to connecting the Arduino Uno to a USB port. On a FreeBSD system, this can be accomplished as follows:

    kldload uarduno

Once it is no longer in use, the module may be removed by the following command:

    kldunload uarduno




HISTORY

2010-12-03Initial release
2010-12-17Resolved compile and coding issues for 8.x
2011-01-06Tested on x86 platform for 7.3-STABLE with up-to-date ports tree
2011-01-13Submitted to FreeBSD ports, ports/153963
2011-02-22Added to FreeBSD ports, comms/uarduno
2011-05-02Revision 1.01, minor update to build on 9.0-CURRENT
2011-05-08Update to FreeBSD port submitted for Rev 1.01
2011-07-05Additional update to FreeBSD port submitted for Rev 1.02
  


Current (related) Issues

Arduino IDE 1.0 and avrdude version 5.11

The Version 1.0 IDE for Arduino has had a port available on FreeBSD for some time, and it works well in versions of FreeBSD since 7-STABLE. Unfortunately in 8-STABLE, there is STILL a problem with avrdude, but the problem is VERY easy to correct. I wrote a simple patch that simply increases the time delay during the RTS/DTR reset process from 50msec to 250msec. For more information, see the avrdude web site bug report (now resolved in the latest version), and the FreeBSD bug tracker report, which still appears to be active according to freshports.org . The port maintainer is most likely waiting to release the newest version rather than patching (and thoroughly testing) the old one. Note that the patch at the END of the FreeBSD bug report is the most correct one (the previous patch 'sort of' worked until I tested the problem further and came up with the better solution).

And, for your convenience, you can download THE SECOND patch from HERE. You will need to save it as

    /usr/ports/devel/avrdude/files/patch-arduino.c

Then 'make clean' and re-build/re-install avrdude to apply the patch (applies to version 5.11 only, dated 12/14/2011, expected to be fixed in the next version).


Arduino Uno and Mega Rev 3 - vendor and product ID

It has been reported to me by 2 different people that the newest (rev 3) Arduino uses a DIFFERENT product ID than its predecessor. Additionally, I have recently obtained an Arduino 'Mega' (rev 3) and it also uses a different product ID (but uses the same vendor ID). After some testing I have verified that the Mega appears to work with FreeBSD 8.0's 'umodem' driver, and it has been reported that the Uno (rev 3) works with FreeBSD 9.0's 'umodem' driver (so uarduno may not be needed for Rev 3 models). In the mean time I will continue to maintain the uarduno port for earlier Arduino Uno models, and will add the corresponding model numbers for any new devices that I become aware of.
Until the port is updated, you can add the following definitions to the /usr/ports/comms/uarduono/files/ids.txt file (at the point where it says to):

     { 0x2341, 0x0042 }, // Arduino MEGA (rev 3), vendor 2341H, product 0042H
     { 0x2341, 0x0043 }, // Arduino UNO (rev 3), vendor 2341H, product 0043H
     { 0x2341, 0x0010 }, // Arduino MEGA 2560 R3, vendor 2341H, product 0010H
     { 0x2341, 0x8037 }, // Arduino Micro


Then clean and re-build the port normally. You may have to re-add this new line if you update your ports tree. (The next revision of uarduno will include these two new lines in 'ids.txt').



Previous (resolved) Issues

Initially I was having some issues with respect to getting the Arduino IDE to work properly with FreeBSD. Even though the kernel module appears to be working properly, the Arduino IDE was crashing whenever I attempted to open the serial console. Additionally, whenever I attempted to program the device with the most recent 'avrdude' application, the board's ID wasn't being recognized. The bugs in the comms/rxtx library have ALREADY been corrected in the most recent port (as of 1/5/2011), and I have contacted the port maintainer for devel/avrdude and the developers of the rxtx library, so in time these issues should be completely resolved. As of this writing, the issues with rxtx have been corrected, and the Arduino port NOW uses an updated version of this library.

In the mean time, a temporary solution to the PREVIOUS avrdude problem can be found in a patch file that I am making available here, as a tarball (see below). The patch applies to the devel/avrdude port as of 1/6/2011. In the meain time, you might want to check the update history for devel/avrdude on freshports.org . Additionally, for the Arduino Uno, the arduino-0021 IDE version is required (available from the Arduino web site), and the most recent port (at the time of this writing) is only at 0019 (the port maintainer is working on it). Still, you should be able to build the newer version from source, and with a little creativity you should be able to install the new 0021 version over the top of the 0019 version without much difficulty. Some hacking may be required, however, to get it to work. In my case I had to delete a couple of symbolic links that were in the installed (-0019) version (/usr/local/arduino/lib/RXTXComm.jar and /usr/local/lib/librxtxSerial.so).

You can download the OBSOLETE patch for the PREVIOUS devel/avrdude port (prior to Dec 2011) as a tarball. Better still, update it to the latest version (and apply the OTHER patch, see above).

DISCLAIMER:  These were recommended by me to ports maintainers, are NOT officially sanctioned, are provided as-is and without any kind of warrantee, and should ONLY be used at your own risk. Additionally, if you apply either of the patches, you should make backup copies of the existing port(s) first, and make sure the port versions and patch files match one another. If anything gets damaged as a result of using any of these patches it's not my fault. If you agree, and want to take the risk, you may download and use the patch file(s) as you see fit.
Affected port and version: devel/avrdude 5.10 (available from freshports.org via cvsweb as a tarball).





Official site for the Arduino Uno
'Playground' wiki site for Arduino on Freebsd

Download the uarduno driver (source tarball)
  • 12/17/2010 Rev 1.0 - Original release
  • 05/02/2011 Rev 1.01 - minor fix for 9.0-CURRENT
  • 07/05/2011 Rev 1.02 - minor fix for 8.2 (after 5/7/2011)
Back to S.F.T. Inc. home page

FreeBSD® is a registered trademark of the FreeBSD Foundation.
NetBSD® is a registered trademark of the NetBSD Foundation

©2010-2018 by Bob Frazier and Stewart~Frazier Tools, Inc. - all rights reserved
last updated: 3/08/2018

Community projects are generally good, but socialism, in all of its forms, is always evil.