Ubuntu 10.04 SAM-BA GUI problem

Microchip in-system programming solution: SAM-BA

Moderators: nferre, fab

onurakdemir
Posts: 5
Joined: Tue Apr 06, 2010 7:56 am

Ubuntu 10.04 SAM-BA GUI problem

Tue Apr 06, 2010 8:10 am

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.
velik
Posts: 23
Joined: Thu Jan 14, 2010 12:30 pm

Re: Ubuntu 10.04 SAM-BA GUI problem

Tue Apr 06, 2010 1:13 pm

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:
onurakdemir
Posts: 5
Joined: Tue Apr 06, 2010 7:56 am

Re: Ubuntu 10.04 SAM-BA GUI problem

Tue Apr 06, 2010 9:25 pm

Not yet:(
Last edited by onurakdemir on Wed Apr 07, 2010 8:01 am, edited 1 time in total.
onurakdemir
Posts: 5
Joined: Tue Apr 06, 2010 7:56 am

Re: Ubuntu 10.04 SAM-BA GUI problem

Tue Apr 06, 2010 9:44 pm

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)
nick_lee
Posts: 2
Joined: Thu May 06, 2010 12:25 pm

Re: Ubuntu 10.04 SAM-BA GUI problem

Thu May 06, 2010 12:34 pm

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!
velik
Posts: 23
Joined: Thu Jan 14, 2010 12:30 pm

Re: Ubuntu 10.04 SAM-BA GUI problem

Thu May 06, 2010 1:22 pm

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:
nick_lee
Posts: 2
Joined: Thu May 06, 2010 12:25 pm

Re: Ubuntu 10.04 SAM-BA GUI problem

Fri May 07, 2010 10:33 am

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.
llherb
Posts: 3
Joined: Mon Aug 10, 2009 1:50 pm

Re: Ubuntu 10.04 SAM-BA GUI problem

Fri May 07, 2010 11:43 am

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)
Microbit
Contact:
Location: Melbourne, Australia
Posts: 22
Joined: Thu Dec 09, 2004 5:20 pm

Re: Ubuntu 10.04 SAM-BA GUI problem

Tue May 25, 2010 1:08 pm

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
Attachments
usbserial.ko.tar.gz
(18.74 KiB) Downloaded 502 times
Best regards,
Kris De Vos
Microbit Systems
ralley
Posts: 8
Joined: Tue Oct 27, 2009 3:59 am

Re: Ubuntu 10.04 SAM-BA GUI problem

Thu May 27, 2010 1:20 am

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.
Microbit
Contact:
Location: Melbourne, Australia
Posts: 22
Joined: Thu Dec 09, 2004 5:20 pm

Re: Ubuntu 10.04 SAM-BA GUI problem

Thu May 27, 2010 5:10 pm

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
Best regards,
Kris De Vos
Microbit Systems
tbosserman
Posts: 1
Joined: Fri May 28, 2010 7:36 pm

Re: Ubuntu 10.04 SAM-BA GUI problem

Fri May 28, 2010 7:43 pm

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.
ralley
Posts: 8
Joined: Tue Oct 27, 2009 3:59 am

Re: Ubuntu 10.04 SAM-BA GUI problem

Mon May 31, 2010 10:07 pm

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.
Microbit
Contact:
Location: Melbourne, Australia
Posts: 22
Joined: Thu Dec 09, 2004 5:20 pm

Re: Ubuntu 10.04 SAM-BA GUI problem

Tue Jun 01, 2010 5:43 am

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
Best regards,
Kris De Vos
Microbit Systems
ralley
Posts: 8
Joined: Tue Oct 27, 2009 3:59 am

Re: Ubuntu 10.04 SAM-BA GUI problem

Tue Jun 08, 2010 4:02 am

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.

Return to “SAM-BA”

Who is online

Users browsing this forum: No registered users and 2 guests