Go Down

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

leo72

Here they are...

PS:
I was talking with a friend of mine this afternoon and he tried ArduinoISP under Ubuntu 11.10.
He found that it's not working too. But he has more electr. tools than me and he investigated on the problem and finally he told me that it seems that there is a timings problem: he misured a difference of 8% on the serial speed of the ArduinoISP, not too much but enough to let the timings go wrong...

leo72


Coding Badly

#17
Nov 08, 2011, 10:24 am Last Edit: Nov 08, 2011, 10:26 am by Coding Badly Reason: 1

It's clear the compilers are different.  This is the top of loop from the NOT working...

Code: [Select]
000009ca <loop>:
    9ca: 80 91 30 02 lds r24, 0x0230
    9ce: 90 91 31 02 lds r25, 0x0231
    9d2: 00 97       sbiw r24, 0x00 ; 0


From WORKING...

Code: [Select]
00000956 <loop>:
    956: 80 91 1e 01 lds r24, 0x011E
    95a: 90 91 1f 01 lds r25, 0x011F
    95e: 89 2b       or r24, r25


The way they are used, the sbiw instruction and the or instruction are interchangeable so the code is fine.  But, the code is different.

The linker must also be different.  Data and code chunks are in a different order.

I think the code in the NOT working spi_transaction sets up an exception handler stack frame (the "rcall .+0")...

Code: [Select]
00000244 <_Z15spi_transactionhhhh>:
    244: df 93       push r29
    246: cf 93       push r28
    248: 00 d0       rcall .+0       ; 0x24a <_Z15spi_transactionhhhh+0x6>
    24a: 0f 92       push r0
...
    27c: 0f 90       pop r0
    27e: 0f 90       pop r0
    280: 0f 90       pop r0
    282: cf 91       pop r28
    284: df 91       pop r29
    286: 08 95       ret


I wonder if some default compiler option changed?

write_flash in the NOT working version is short a few machine instructions from the WORKING version.  And at least one of the instructions is significant.  I wonder if the NOT working version was built by a NOT working compiler?

leo72

The NOT working version was built on a machine (ubuntu 11.10) that apparently DO work, compiling sketchs that run. If I compile any kind of sketch and upload it onto my Arduino or my Luigino328, it work perfectly. But if I try ArduinoISP it does NOT work.
A friend of mine told me that he found different timings (8% diff) between serial timings of the working ArduinoISP and the NOT working ArduinoISP. I cannot confirm this 'cause I don't have a DSO.

You can check that ArduinoISP does not work if it's compiled under Ubuntu 11.10 just installing it from scratch and then compiling on that system ArduinoISP. This sketch won't work even on Ubuntu 11.10 nor on other Linux systems nor on Windows nor on nothing else.

Coding Badly

Quote
different timings (8% diff) between serial timings


Serial?  As in, the TTL serial port?  Or as in, Serial Peripheral Interface (SPI) bus?

leo72

I don't know exactly.
The post is this one:
http://arduino.cc/forum/index.php/topic,75619.msg588805.html#msg588805

I translate it for you:
Quote
Lo confermo pure io, oggi ho trovato un pochino di tempo per provare e con Ubuntu 11.10 non c'è verso di far funzionare lo sketch isp.
Il problema è la velocità della seriale, dello sketch isp, che non è corretta, se non ho sbagliato a misurare ha un errore maggiore del 8%, quanto basta per far fallire la comunicazione tra avrdude e lo sketch.


Quote

I confirm it [the issue]. Today I found a bit of time to make a test and with Ubuntu 11.10 I didn't find a way to let the ISP sketch working.
The problem is the serial speed, the ISP sketch speed, that is non correct: if I did no mistakes to make misurerements, it has an error that is more than 8% [of the correct speed], that is enough to let the communication between Avrdude and the sketch fail.

The user is astrobbed. Try to contact him.

Coding Badly

Quote
The user is astrobbed. Try to contact him.


You'd like me to contact him?  Unless he can read and write Texan, I'm afraid that is not going to go very well.  The only non-English I know is a very very tiny bit of French from High School.  That was, well, let's say a few years ago and I didn't take the class to learn French.   :D

Which version of the Arduino IDE are you using?  1.0 beta?  0022?

leo72

The 0022 downloaded from Arduino.cc but I got the same issue using Arduino from Ubuntu's repos.
Same for Arch, using the binaries from Arduino.cc or the Arduino package from repos.

Coding Badly


The elf files you posted are dramatically different from the ones I generated here (Windows Vista, Arduino 0022 and rc2).  I'd like to make certain we're starting from the same point.  Please attach a copy of your ArduinoISP sketch.

leo72

This is the ArduinoISP sketch in my installation (as I said before, it comes from Arduino.cc).

leo72

Any news... (sorry for the UP but I'm very interested in this thing, as I would like to upgrade my OS)

Coding Badly


leo72


Coding Badly


So much for that theory.  When I have time, I'll take another look at the files you sent.

leo72

Thank you. I appreciate the time you spend for me  ;)

Go Up