Arduino 0021 for Windows, Mac, Linux (fixes PWM bug on Uno)

David MellisOctober 2nd, 2010

I just posted Arduino 0021 to the download page. It’s a quick release to fix the problems with analogWrite() (PWM) on pins 9 and 10 on the Arduino Uno.

This release also includes Linux (32-bit) support for the Uno and Mega 2560 (as well as the rest of the Arduino boards). The RXTX library was patched to support /dev/ttyACM* devices (which is what the ATmega8U2 on the Uno and Mega 2560 shows up as). Apologies for the delay in getting this out. Please note that there’s some weirdness when uploading to an Uno or Mega 2560 that’s running a program that sends data over the serial port. I’m not sure exactly what’s going on, but if you unplug and replug your board, or hold down the reset button, or manually delete the ACM0 lock file in /var/lock, you should be able to get it to work. Any suggestions on how to fix this properly are welcome.

Update: A 64-bit Linux version and a source archive for Arduino 0021 are now up on the download page (under “also available from Arduino.cc”).

29 Responses to “Arduino 0021 for Windows, Mac, Linux (fixes PWM bug on Uno)”

  1. Joby Taffey Says:

    One source of weirdness with USB CDC serial in Linux is that data must be flushed with tcdrain() by every application using /dev/ttyACM*. This affects LUFA.

    http://groups.google.com/group/myusb-support-list/browse_thread/thread/e264ef273191a4a0?pli=1

    Not sure if this is what you’re hitting or not…

  2. Steve Spence Says:

    The new 0021 with the Mega 2560 is working great on Linux (Ubuntu 10.04LTS). Thank you!

  3. chemicaloliver Says:

    If you remove the librxtxSerial.so from the lib folder and install the version of librxtx that comes with your distro then it will work with most recent 64 bit versions of Linux.

  4. Michael M. Says:

    Any chance of getting a 64bit build?

  5. @matthearn Says:

    arduinoblog that is brilliant news, I can now program my uno from my laptop thanks for getting that out there. :D

  6. mac Says:

    Nice… but what should 64bit linux users do? :(

  7. dcuartielles Says:

    please check the download page, it is online now

  8. bigbodynobrain Says:

    i have linux but pins 9 & 10 still don’t work using pwm

  9. dcuartielles Says:

    Hej,

    we are working on this, could you please tell me which version you are using?

    0021, 32b or 64b?

    /d

  10. x64 Says:

    i’m using it on ubuntu 9.10 but here i can’t see any /dev/ttyACMx on the selection in the IDE..i’m on 64 bit with 32 bit IDE cause 64 bit IDE says:

    classe ELF errata: ELFCLASS32 (Possible cause: architecture word width mismatch

    in 32 bit IDE if i upload on the board (linking /dev/ttyUSBx with /dev/ttyACMx)
    something who talks to serial it gives me some troubles.

    so i hope someone will write something about fixing this.
    sorry for bad english.

  11. bigbodynobrain Says:

    0021 32 bit

  12. dcuartielles Says:

    ok, I am installing that version and will come back to you (I run 64b myself), if anybody can reproduce this problem please report here

    /d

  13. x64 Says:

    i have found the problem with 0021 and ELFCLASS32
    32 bit IDE and 64 bit IDE was in the same directory.

    now is almost solved all the trouble, but i can’t use the serial monitor (32 and 64 bit on /dev/tty/ACMx) when i use to upload analogReadSerial to arduino (arduino UNO) the IDE seems to freeze but is not freezed is only much slow and to upload another sketch i must press much times the upload
    button and reset also much times arduino.
    so i can’t use serial communication with the computer.
    i hope you fix also this or tell me how to fix.

    thank you and sorry for bad english.

  14. dcuartielles Says:

    Hej x64,

    yes, this is the problem we have also found in linux. It is our believe the problem has to do with the ttyACM driver in linux. We are trying to get that fixed at the core of the linux distro while we try to roll out our own patch in our IDE. This is the reason why the IDE for linux was delayed, because there is a software issue that goes beyond our responsibility.

    We just want all of you, Linux users, to know that we re doing our best to get a good solution for this asap. Of course any suggestions are welcome.

    /d

  15. x64 Says:

    i found gtkterm a serial monitor in the ubuntu repo, with it i can read the values from arduino UNO if i run “rm /dev/ttyACMx” before using it.

    i also found a way to erase the sketch uploaded to arduino:
    by pressing reset button for 3 seconds and turning arduino off always pushing the reset button then turning arduino power on always pushing reset button for 3 seconds (sorry for bad english, i hope you understand)
    i’ll write it in italian maybe someone could translate in a better english:

    premendo il tasto reset per circa 3 secondi e spegnendo arduino e sempre tenendo premuto il tasto reset lo si riaccende e lo si tiene premuto altri 3 secondi arduino non “ricorda” lo sketch precedentemente caricato.

    so linux people can use arduino in a temporary “survival mode” :)

  16. bigbodynobrain Says:

    dcuartielles thanks for the help but i it figured out turns out i have to run the arduino program as root so it is most likely an OS proplem

  17. Michael M. Says:

    Looks like I’m still out of luck. I’m using a pure 64bit system and am unable to upload sketches due to the 64 bit build including a 32bit version of avrdude :( this wasn’t a problem with my duemilanove since I could just delete it and link to my version of avrdude but latest version (5.10) doesn’t seem to work with the uno.

  18. tony Says:

    Im running ubuntu 64 and the 21 version with mega 2560 and Uno and it works fine until i use serial communication.
    Found that it still works fine if i use a delay but no shorter than 500millisek. Anything below that looks the IDE. So a tip is to always put a delay of at least 500 until there is a better solution.
    But if you do (like me) upload a example like the ASCII send i can confirm that x64s solution works eg plug in in you board with the reset button pushed down, press upload and once you see the rx light on the board, release the reset button.

  19. iso_gee Says:

    I’m running Ubuntu 10.04 64-bit with arduino-0021. The uno just burns TX-light and wont accept anything from the IDE. Any chance of fixing this in 0022 and when might it be coming for 64-bit linuxes?

  20. uffek Says:

    There is at least a temporary solution which has to be added to serial communication code at:
    http://h00s.net/site/ubuntu/solved-problem-with-arduino-serial-communication-on-lucid-lynx-arduino-0021/
    uffek

  21. uffek Says:

    The solution at my previous reply is not working properly on Ubuntu 10.04 LTS /Arduino Uno with software 0021. Any previous software is not supporting Uno.
    So Ubuntu lovers need to use Duemilanove/0018 software as long as Duemilanove is available. On dual boot Ubuntu/Xp machine the XP/0021 software is working properly.
    If someone has found a solution for Ubuntu please post it here.

  22. smartroad Says:

    How do I get 0021 installed on 32bit Ubuntu 10.10?! The instructions say to go to the software center but that only has 0018. I have downloaded 0021 but don’t know what to do with it. :(

  23. iso_gee Says:

    The only solution that seems to be 100% working with uno and 64-bit 10.10 Ubuntu is using usbtinyisp to to program the chip via icsp. I’m not sure whether the problem is the linux kernel or the arduino IDE — but one thing is for sure, the 0021 version + linux does not work even with the delay-solution suggested earlier in the comments.

  24. dee Says:

    I have this problem also. Ubuntu 10.10 32bit. Arduino-Uno.
    Transmit light stayed on solid, IDE acted all squirrelly and sluggish, ttyACM0 would only show up at random. Did what x64 said above with the reset button and it was healed.
    This should be fixable. Wouldn’t the Arduino be able to tell when the transmit light is on solid? Could it be made to give up transmitting when that happens?
    PS. PPA is an old version that does not have Uno option.

  25. d0ct0r Says:

    i’m using mint and arduino UNO without the IDE: avrdude and i can use it without
    problems. just resetting the board via serial i use perl for this.

    about the serial monitor i’m using screen with the same method.

    imho is not the kernel the problem, Arduino needs only
    a multiple serial “reset”.

    in IDE if i reset Arduino with perl in Arduino.sh it works fine, but when it
    refreshes the serial data (opening another sketch etc) it goes to be slow.
    so i think is here the problem.

  26. Arduino 0021 on openSuSE 11.2 Says:

    [...] found an Ubuntu thread (may or may not be relevant), which mentioned the rxtx library package. This blog mentions it as well. Maybe you need to install it first. A quick search of openSUSE software [...]

  27. petrescs Says:

    It’s been reported here http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1286088093/30 (comment #34) that the new firmware fixes this – anybody tried that yet?

  28. Antonio Martos Says:

    This simple solution works well in Debian.

    First, include experimental repositories in /etc/sources.list

    #Experimental
    deb http://ftp.ch.debian.org/debian/ experimental main contrib non-free
    deb-src http://ftp.ch.debian.org/debian/ experimental main contrib non-free

    Then upgrade arduino, arduino core and librxtx-java:

    > sudo aptitude -t experimental upgrade arduino arduino-core librxtx-java

    And relauch arduino IDE. /dev/ttyACM0 should appear as an option now.
    Then you may want to comment out the experimental lines in sources.list to avoid other packages to be proposed for updates.

  29. Arduino serial port contention Says:

    [...] [...]