Page 1 of 2

Ubuntu 10.04 SAM-BA GUI problem

Posted: Tue Apr 06, 2010 8:10 am
by onurakdemir
I was able to use SAM-BA 2.9 and 2.8 with Ubuntu 8.04 . I now upgraded to 10.04 release , and SAMBA-GUI hangs after selection board and connection type , after pressing connect button. Do you know anything about this ?
Thanks.

Re: Ubuntu 10.04 SAM-BA GUI problem

Posted: Tue Apr 06, 2010 1:13 pm
by velik
Hm! I have install today kubuntu 10.4 and now have a same problem :? Before in other linux distribution was without such problem. Did you find already a solution? :roll:

Re: Ubuntu 10.04 SAM-BA GUI problem

Posted: Tue Apr 06, 2010 9:25 pm
by onurakdemir
Not yet:(

Re: Ubuntu 10.04 SAM-BA GUI problem

Posted: Tue Apr 06, 2010 9:44 pm
by onurakdemir
this is error ( when I run on shell).

sam-ba /dev/ttyUSB0 AT91SAM9260-EK ./at91sam9260_demo_linux_dataflash.tcl
-I- Waiting ...
-I- TCL platform : Linux
-I- SAM-BA CDC 2.9 rc6 on : linux
-I- Retrieved arguments from command line :
-I- argv 0 : /dev/ttyUSB0
-I- argv 1 : AT91SAM9260-EK
-I- argv 2 : ./at91sam9260_demo_linux_dataflash.tcl
-I- Connection : /dev/ttyUSB0 (target(comType) = 1)
-I- Board : at91sam9260-ek
-I- Traces Level : 4
-I- target(handle) : file5
expected integer but got ""
while executing
"format "%d" $data"
(procedure "TCL_Read_Int" line 8)
invoked from within
"TCL_Read_Int $target(handle) $cidr_addr err_code"
("foreach" body line 5)
invoked from within
"foreach cidr_addr $addresses {
#Check the processor ID
set err_code 0
set version_mask 0xFFFFFFE0
set chip_id [format ..."
invoked from within
"if {$target(board) != "no_board"} {
set srcDevId [file join $libPath(extLib) "devices" "devices.tcl"]
if {[catch {source "$srcDevId"} errMsg]}..."
(file "/opt/sam-ba_cdc_2.9.linux_cdc_linux/sam-ba/lib/tkcon.tcl" line 4893)
invoked from within
"source [file join $starkit::topdir lib/tkcon.tcl]"
(file "/usr/local/bin/sam-ba/main.tcl" line 7)

Re: Ubuntu 10.04 SAM-BA GUI problem

Posted: Thu May 06, 2010 12:34 pm
by nick_lee
We're getting the same problem after upgrading from Ubuntu 9.10 to 10.04. Now the flash process freezes at "loading applet at 0x200000". This is obviously quite a problem as we can't flash our boards any more!

Re: Ubuntu 10.04 SAM-BA GUI problem

Posted: Thu May 06, 2010 1:22 pm
by velik
Ye, really interesting what is the problem. I started with 10.04 Alpha-Versions and today decided not to update my host, but reinstall it complete. Interesting, but this problem I didn't see direct after installation, but when I've install eclipse, I got this problem again :|

Probably I don't need eclipse :wink:

Re: Ubuntu 10.04 SAM-BA GUI problem

Posted: Fri May 07, 2010 10:33 am
by nick_lee
I uninstalled Eclipse and that hasn't helped me... and one of our machines never had it either.

I've tried connecting to the board via USB and via serial, and in both cases, the GUI hangs after connect.

Re: Ubuntu 10.04 SAM-BA GUI problem

Posted: Fri May 07, 2010 11:43 am
by llherb
same problem here.
I have investigated a little bit the problem and this is what I found.

Below some traces from a sam-ba 2.9 with a working kernel:

c007f880 591065755 S Bo:1:003:1 -115 64 = 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
c007f880 591068387 C Bo:1:003:1 0 64 >
c007f880 591074819 S Bo:1:003:1 -115 64 = 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
c007f880 591079793 C Bo:1:003:1 0 64 >
c007f880 591084848 S Bo:1:003:1 -115 29 = 00000000 00000000 00000000 00000000 00000000 00000000 04000000 0a
c007f880 591091312 C Bo:1:003:1 0 29 >
c007f880 591092832 S Bo:1:003:1 -115 11 = 57323030 3030342c 30230a
c007f880 591094357 C Bo:1:003:1 0 11 >
c007f880 591094818 S Bo:1:003:1 -115 11 = 57323030 3030632c 31230a
c007f880 591098555 C Bo:1:003:1 0 11 >
c007f880 591099731 S Bo:1:003:1 -115 11 = 57323030 3031302c 34230a

and the same from a non-working kernel:

e3bc5100 812606209 S Bo:5:018:1 -115 64 = 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
e3bc5100 812607206 C Bo:5:018:1 0 64 >
e3bc5100 812607209 S Bo:5:018:1 -115 64 = 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
e3bc5100 812608206 C Bo:5:018:1 0 64 >
e3bc5100 812608209 S Bo:5:018:1 -115 64 = 00000000 00000000 00000000 00000000 00000000 00000000 04000000 0a573230
e3bc5100 812609206 C Bo:5:018:1 0 64 >
e3bc5100 812609209 S Bo:5:018:1 -115 63 = 30303031 342c3123 0a573230 30303138 2c30230a 57323030 3031632c 3230230a

as you can see with recent kernel usbserial-generic try to send URB as full as possible (64 max). This should not be a problem, but I think (maybe I am wrong ;) ) that on the other side, romboot is using USB protocol to identify the end of a request.
As we cannot modify romboot, we should be able to modify drivers/usb/serial/generic.c to come back to the old behavior of usb_serial_generic_write. (this is what I try to do)

Re: Ubuntu 10.04 SAM-BA GUI problem

Posted: Tue May 25, 2010 1:08 pm
by Microbit
Hi All,

I just came across this problem too with Ubuntu 10.04, freezes after connecting to a SAM9260 with V1.9rc6

I fixed this by recompiling the 2.6.31.6 kernel driver, but by NOT using the (filp) args in the actual open() and generic_open() calls.
This works fine for me, hope it works for you too.
Attached module needs to be replaced into /lib/modules/2.6.32-21-generic/kernel/drivers/usb/serial ...
(of course make sure you back up your usbserial.ko)

Appreciate some feedback.

Best regards, 73s
Kris

Re: Ubuntu 10.04 SAM-BA GUI problem

Posted: Thu May 27, 2010 1:20 am
by ralley
Thanks for that Kris, I used your usbserial.ko with a Ubuntu 10.04 2.6.32-22-generic kernel and it works nicely with my 9260-ek board.

My 9g20-ek board is still no go, sam-ba reports an " Error during external RAM initialization." - the applet is returning a status of f. This is different to the previous behavior whereby sam-ba would just hang.

Interestingly the first time I tried your module with the 9G20 is appeared to program ok but would not boot, failed at the u-boot step. Since then I haven't been able to get past the external RAM init.

Board is still ok - I've confirmed by reprogramming using sam-ba under Windows.

Rob.

Re: Ubuntu 10.04 SAM-BA GUI problem

Posted: Thu May 27, 2010 5:10 pm
by Microbit
Hi Rob,

I'm glad it works for you too - good to see it's of some help.
I only have an Olimex SAM9-L9260 board so I can't reproduce your problem.
In case I still need to fall back on XP for sam-ba, I was used to coLinux which worked great.., but with 10.04's EXT4 file system it's broken of course. Waiting for coLinux to support ext4 :-(

PS : If you want to modilfy at source level, I compiled usb-serial.c, generic.c and usb_debug.c into the module. The open() calls just have the 3rd param, filp, removed and it compiles fine then.
(against the 2.6.31.6 headers/kernel, of course)
If you need the source, I'll post it.

B rgds
Kris

Re: Ubuntu 10.04 SAM-BA GUI problem

Posted: Fri May 28, 2010 7:43 pm
by tbosserman
Just in case this is useful to anyone else....

My solution was to add this line after line 274 of usb-serial.c:

serial->type->max_in_flight_urbs = 1;

I'm running kernel rev 2.6.32.22-generic. It should be noted that this change could impact performance with other devices, but since I'm not using the generic usb-serial driver for any other devices this solved my problem nicely.

Re: Ubuntu 10.04 SAM-BA GUI problem

Posted: Mon May 31, 2010 10:07 pm
by ralley
Thanks Kris, I'll give compiling from source a try and see what I track down. A side effect I noted from your module is that my FTDI USB to serial converter no longer works.

I'll also try tbosserman's approach.

Regards, Rob.

Re: Ubuntu 10.04 SAM-BA GUI problem

Posted: Tue Jun 01, 2010 5:43 am
by Microbit
Hi Bob / "tbosserman" /all,

I'm curious to see if the urb solution mentioned last works for you - I hope so.
I personally don't use any other CDC/ACM devices on Linux (many tools/devices that rely on the FTDI approach don't actually work properly anyway :-( )
Just yesterday, I flashed in a 100 MB rootfs into SAM9260 system with my quick 'n dirty driver and it worked 100%, so I'm in no hurry to change it.
("don't muck with it" :-)).

When I have a gap again however, I;'ll be trying the other approach too, for curiosity. I do have an eval board with CP1101 or some such (from Cygnal days IIRC) kicking around somewhere, dunno if that can be of help for testing, we'll see. It goes on "must do one day list".

Cheers,
Kris

Re: Ubuntu 10.04 SAM-BA GUI problem

Posted: Tue Jun 08, 2010 4:02 am
by ralley
Update: I just recompiled my host system kernel for 2.6.32.11 and made the modifications by usb-serial.c as suggested by tbosserman. This version seems to work fine with my 9260 board but still fails with the 9G20, I get "Error during external RAM initialization." from sam-ba.

I'll raise an issue with Atmel and see what comes of it.

Rob.