SAM-BA (Linux) over USB to AT91SAM9260 is terribly slow

Microchip in-system programming solution: SAM-BA

Moderators: nferre, fab

Posts: 10
Joined: Thu May 14, 2009 8:26 am

SAM-BA (Linux) over USB to AT91SAM9260 is terribly slow

Thu May 14, 2009 8:44 am


I'm using the Linux port of SAM-BA ( ... twareTools) on an Olimex SAM9-L9260 board with an AT91SAM9260 controller and NAND flash on it.

While erasing and flashing NAND works, the USB connection is terribly slow (9600 bps).
For this reason even flashing small memory images takes ages.

Unfortunately, I'm not able to change the speed of the serial USB device:

Code: Select all

$ stty -F /dev/ttyUSB0
speed 9600 baud; line = 0;
min = 1; time = 5;
ignbrk -brkint -icrnl -imaxbel
-opost -onlcr
-isig -icanon -iexten -echo -echoe -echok -echoctl -echoke

$ sudo stty -F /dev/ttyUSB0 speed 115200
stty: /dev/ttyUSB0: unable to perform all requested operations

I know that SAM-BA also works using the RS232 serial port, but I would prefer to rather not use it since the serial console of the board is on the RS232 port as well.
  • Is there a way to speed up the USB connection, so that flashing NAND doesn't take ages ?
  • If so, are they faster ?
Posts: 10
Joined: Thu May 14, 2009 8:26 am

Re: SAM-BA (Linux) over USB to AT91SAM9260 is terribly slow

Sat May 16, 2009 4:51 pm


I though I give you a little update on my findings.

Even though stty tells me that the speed of /dev/ttyUSB is 9600bps, it seems to be a lot faster.
I noticed that the amount of data I'm transferring is larger than I thought.
While transferring all data still takes a lot of time, there doesn't seem to be a way to further speed it up.

I also tried out the cdc-acm driver (which works well will Sam_I_Am and the patch provided by davidm in another post on this forum (samphpbb/viewtopic.php?f=12&t=5252&p=29310#p29310).
There doesn't seem to be any speed difference between the usbserial and the cdc-acm driver.
However, sam-ba (Linux4Sam) only worked with usbserial for me.

Also, Sam_I_Am does not support NAND flashing.
However, one can write data to SRAM/SDRAM with it similar to openocd.
(The difference is that Sam_I_Am does this over the sam-ba usb connection with the cdc-acm driver and openocd uses a JTAG dongle instead).

Davidm also mentioned (see link above) that it is possible to just boot into a linux kernel/rootfs and then do the NAND flashing from there.

My setup uses multiple stages of bootloaders.
First AT91SAM9260's internal rom bootloader starts.
Then at91bootstrap is executed which in turn loads u-boot from SD-RAM.
Once u-boot is up, it may load the linux kernel.

For this reason my idea would be to use Sam_I_Am, openocd or even sam-ba (Linux4SAM) to boot into u-boot.
From there one can boot over networks using DHCP/BOOTP, automatically download a kernel over TFTP and mount a rootfs over NFS.


Return to “SAM-BA”

Who is online

Users browsing this forum: No registered users and 1 guest