Go Down

Topic: Linux Kernel 3.0 stopped ArduinoISP working (Read 15609 times) previous topic - next topic

bperrybap



Now the curious thing is that both of those systems use the relatively new Kernel 3.0.
If I try to use the Arduino as an ISP programmer from the terminal with avrdude, i strangely get that the sketch is written on the Arduino itself and not to the destination micro!



This sounds like a very big clue.
It seems to indicate an issue with AutoReset.
How are you disabling the autoreset on your UNO?

I'm wondering if the USB timing or virtual comm port timing
on the new kernel is such that it is now somehow causing auto reset to fail?

There are many things in the IDE and hardware related to autoreset and disabling autoreset
that are all working to together that kind of just barely work.

It would be very interesting to see a scope picture of the reset line on AVR in the
UNO being used for the ISP.

I bet it looks different in the cases where it is not working.

--- bill







leo72


This sounds like a very big clue.
It seems to indicate an issue with AutoReset.
How are you disabling the autoreset on your UNO?

I'm using Optifix/Optiboot 4.4 loaded on my Arduino.

Quote

I'm wondering if the USB timing or virtual comm port timing
on the new kernel is such that it is now somehow causing auto reset to fail?

This as alien stuff for me  :smiley-sweat:

Quote

There are many things in the IDE and hardware related to autoreset and disabling autoreset
that are all working to together that kind of just barely work.

It would be very interesting to see a scope picture of the reset line on AVR in the
UNO being used for the ISP.

I bet it looks different in the cases where it is not working.

Sorry, I don't have an oscilloscope in my toolset.
I just know that I have to use an old version of Linux to let the ArduinoISP sketch working.

bperrybap



This sounds like a very big clue.
It seems to indicate an issue with AutoReset.
How are you disabling the autoreset on your UNO?

I'm using Optifix/Optiboot 4.4 loaded on my Arduino.



But how are you disabling auto reset on your Arduino?

--- bill

leo72

With Optifix 4.4 I don't need to disable the auto-reset.
But to be sure that this was not the problem, I remember that when I did those tests I tried with a capacitor between RST e V5 too, but it didn't solve.

Bu

kfreak

I'm having the same problem, can't use Arduino ISP to burn bootloader using Ubuntu 11.10.

Luckily I have a mobile computer with 2.6.35 kernel and it works with that (arduino 021). The master is a duemilanove board (Atmega on that board either with Duemilanove or Uno bootloader) and the target is an Uno board. Cabling as described here http://arduino.cc/en/Tutorial/ArduinoISP

I don't need to burn bootloader often, but this has to be fixed asap, or at least arduino should check for kernel version and show a warning, so users don't get frustrated.

kfreak

This also affects this method of uploading arduino code to AtTinys: http://hlt.media.mit.edu/?p=1229

With kernel 3.0+ => Errors
With kernel 2.6.35 => works as described

leo72


I'm having the same problem, can't use Arduino ISP to burn bootloader using Ubuntu 11.10.

So I'm not the only one having this problem, now  :smiley-sweat:

Quote

Luckily I have a mobile computer with 2.6.35 kernel and it works with that (arduino 021).

I chose to install 11.04 because I didn't have a PC with an older version of Linux.

Quote

I don't need to burn bootloader often, but this has to be fixed asap, or at least arduino should check for kernel version and show a warning, so users don't get frustrated.

Best thing is that Arduino team fixes this issue  :smiley-sweat:
I discovered the problem just after the release of the new Ubuntu but since then no official fix for this has been released/announced.

bperrybap


With Optifix 4.4 I don't need to disable the auto-reset.
But to be sure that this was not the problem, I remember that when I did those tests I tried with a capacitor between RST e V5 too, but it didn't solve.

Bu

using a cap or resistor to disable autoreset doesn't always work.
The autoreset circuit is quite fragile and there are issues with the design such as
ringing on the line that can cause issues.

The only way to really diagnose the issue is to look at the reset signal going into the AVR chip
and that requires a scope.
My guess is that the timing or behavior of the DTR signal has slightly changed and is now causing
the autoreset circuit to go bonkers.

--- bill

leo72

I think the issue isn't in the autoreset. Let me explain you.

When I use the Arduino with the ArduinoISP sketch directly via a terminal window (I'm talking about Linux), I use avrdude to flash the sketch on the standalone micro, the operation DOES fail if:
1) the ArduinoISP sketch has been compiled and flashed under a Linux machine with kernel 3.0 (i.e. Kubuntu 11.10 or ArchLinux)

The operation DOES NOT fail if:
1) the ArduinoISP sketch has been compiled and flashed under a Linux machine with a kernel <=2.26.xx (i.e. Kubuntu 11.04)
2) the ArduinoISP sketch has been compiled and flashed under a Windows machine (tried with Windows XP)

Let me add some more infos.
I also have an USBtinyISP from Adafruit.
This programmer has NEVER failed both under Linux kernel 3.0 or Linux kernel 2.26.xx because its firmware has been compiled and flashed byt Ladyada and I never changed it. So it's the original firmware and it works correctly with any OS I tried.

bperrybap

#39
Dec 31, 2011, 07:53 pm Last Edit: Dec 31, 2011, 07:57 pm by bperrybap Reason: 1
That is not enough information to reach the conclusion that it is a kernel issue.

There is also the version of avrdude and what commandline options you are using
particularly given that when using avrdude from the commandline vs from the IDE
the behavior of the signals used for driving the AutoReset (DTR and RTS) signal lines
will behave differently. (IDE toggles the lines before calling avrdude)

You also have to be careful when using avrdude from the commandline because
the IDE will use the avrdude and config file supplied with the IDE and if avrdude from the
linux distribution is installed you can end up running that avrdude or a different config file
than the avrdude that gets used with the IDE.

It could also be a tool set issue on a particular distribution release.


For example, you have not stated were your gcc tools are coming from on the
two different linux verions.
This very important as the Arduino IDE on linux does not supply the avr gcc toolset
like it does on Windows.

The Windows avr gcc toolset (WinAVR) is updated fairly regularly
and is even available from Atmel, which is what the Arduino team uses.
Linux is left flapping in the wind and so the avr tools that are provided with
each distribution are different and typically are not up to date.

As a result, there are several linux distributions that contain bad avr-gcc toolsets in their
repositories that will generate non working code (easy to notice) or broken code that works incorrectly
(harder to detect)
This is especially the case on LTS releases which tend to have very stale versions
of software in general and especially for little used tools like the avr-gcc toolset.
A few years ago the avr-gcc in the Ubuntu repository didn't properly save registers on interrupts,
so interrupt routines that called a C function would corrupt registers.
There was another one where the compilers low level integer multiply routine
accidentally stomped on a register that it wasn't saving.
Neither of these were immediately obvious. You ended up with very subtle errors that only
occasionally showed up, depending on your code.
More recently the AVR libC had a broken set of low level delay routines and that made it out
to some of the debian packages.

I've been burned by this kind of stuff in the past and now I will not use any AVR toolset
provided by the linux distrubution, especially on Ubuntu.

Most linux avr-gcc packages are not updated with the latest bug patches and some
of the distributions are using very out of date sources to build their avr gcc tools.
The only way to ensure that you have an up to date avr-gcc toolset is to
avoid using the avr-gcc tools that are provided with the linux distribution
and instead either build the compiler from its sources or use a pre built
.deb package from a place that is maintained by the AVRfreaks user bingo.
See this AVRfreaks thread for more information on that:
http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=111691
He also provides a set of build scripts that can be used to build to the tools from
sources if you want to go that far or have a distribution that can't use a .deb image.


I went back and re read all the earlier posts and it seems to be pointing at the tools
or a interaction between the tools and the ArduinoISP sketch.
First it was reported as 3.0 is broken and 2.6.xx was working.
Then a 2.6.32 LTS from Arch was reported as broken.
Then there is a ArduinoISP sketch binary that works and one that doesn't.

All this seems to be pointing in direction of a toolset issue or at least a tool set interaction
with the ArduinoISP sketch.

There are few combinations of testing that are missing for example:

- once a "good" ArduinoISP sketch has been burned, can you use it
 from a 3.0 kernel, to successfully update another AVR chip?
  If it works, then it is not a kernel issue nor an avrdude issue and points to a sketch building issue
  more than likely related to the avr-gcc toolset.

- When avrdude from the commandine fails, does using the IDE work?


This should be tracked down, because if it is a avr-gcc toolset issue, it
won't necessarily be a problem for jujst the ArduinoISP sketch it
may affect other things as well.

--- bill

madworm

#40
Dec 31, 2011, 10:03 pm Last Edit: Dec 31, 2011, 10:07 pm by madworm Reason: 1
My machine runs the 3.1.4-1-default kernel and I don't have any issues with ArduinoISP (1.0 IDE) - after I increased the serial buffers to 128 bytes (HardwareSerial.cpp).

My avr toolchain is a self-compiled one using the build script from avrfreaks.net - I didn't get ATtiny4313 support via distribution repo back then - and the patches are still not in there after ... a year? I would like to help them, but the spec-files just creep me out.

leo72

The AVR toolchain I used is specified in one of my first posts:
http://arduino.cc/forum/index.php/topic,76138.msg588661.html#msg588661

BTW right now I'm using Kubuntu 11.04 with no issues and the AVR toolchain I use is the one from the official Ubuntu repos, nothing different. Same thing when I tried Ubuntu 11.10.

ArchLinux was a more complicated issue because I had to patch AVR tools found in the official repos to let them correctly work.

Martend

Hello, I was browsing as a new Arduino user this forum and was surprised
to see the topic, that Arduino is not working with the 3.0 Kernel.
Currently I am running Linux centauri 3.0.0-14-generic-pae #23-Ubuntu SMP Mon Nov 21 22:07:10 UTC 2011 i686 i686 i386 GNU/Linux
manix@centauri:~$ with an Arduino Uno.
I installed the Arduino IDE through my terminal, I did the first few tutorials (blink / knight rider) and everything is working fine.
Hope it helps a bit to solve the problem.

M

leo72

Sorry, but you misunderstood:

to see the topic, that Arduino is not working with the 3.0 Kernel.

It's: the sketch ArduinoISP isn't working, not the entire Arduino.

maniacbug

#44
Jan 14, 2012, 07:53 am Last Edit: Jan 14, 2012, 08:27 am by maniacbug Reason: 1

ArduinoISP_working.cpp.hex, compiled under Ubuntu 11.04 (librxtx 2.2pre2-3, gcc-avr 4.3.5-1, binutils-avr 2.20.1-1)
ArduinoISP_NOT_working.cpp.hex, compiled under Arch Linux (librxtx 2.2pre2-2, gcc-avr 4.6.0, binutils-avr 2.20.1)


I suspect avr-gcc here.  4.6.0 is known to have problems, like this one: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45263

EDIT: Er, nevermind.  I just built a whole new 4.6.2-based toolchain, and the problem remains.

Go Up