SAM3U SAM-BA communication issues

Microchip in-system programming solution: SAM-BA

Moderators: nferre, fab

bunni
Posts: 6
Joined: Thu Jul 22, 2010 7:18 am

SAM3U SAM-BA communication issues

Wed Aug 04, 2010 3:54 am

I am working on a SAM3U based board and am having issues getting any communication over SAM-BA. I do not have a sam3u-ek dev board but wired up my pcb with almost the same connections and am able to run USB based demo software with no problem. I have so far been just programming using a J-Link.

When I try to connect SAM-BA to the device in Windows or linux either with CDC or the other driver I do not always get communication. I use say my board is a sam3u[234]-ek it will instantly fail and say invalid board, but if i say it is a sam3u1-ek board it just hangs my system and eats CPU. I can open up a terminal emulator with the proper settings for USB CDC (115200,8n1) when I connect my device but I get no response from any commands (not even V#).

Is there some specific connection on the sam3u I need to make in order for USB CDC SAM-BA to work properly?

-Kris
bunni
Posts: 6
Joined: Thu Jul 22, 2010 7:18 am

Re: SAM3U SAM-BA communication issues

Fri Aug 06, 2010 6:07 am

Update:

I got past the issue of the device not being recognized (it was a stupid error on my part) I am now seeing something else. I can communicate with my device as a standard tty device and can issue commands over a terminal emulator. As a test I just wrote something in to internal RAM and made sure I could read it back. I now am unable to connect to the device with SAM-BA only. I have been trying in both Windows and linux, the Windows version just eats up RAM and CPU and does nothing. In linux I was actually able to do an strace and got the following output:

...
open("/dev/ttyUSB0", O_RDWR|O_CREAT|O_TRUNC|O_LARGEFILE, 0666) = 5
fcntl64(5, F_SETFD, FD_CLOEXEC) = 0
ioctl(5, SNDCTL_TMR_TIMEBASE or TCGETS, {B9600 -opost -isig -icanon -echo ...}) = 0
ioctl(5, SNDCTL_TMR_TIMEBASE or TCGETS, {B9600 -opost -isig -icanon -echo ...}) = 0
ioctl(5, SNDCTL_TMR_TIMEBASE or TCGETS, {B9600 -opost -isig -icanon -echo ...}) = 0
ioctl(5, SNDCTL_TMR_STOP or TCSETSW, {B9600 -opost -isig -icanon -echo ...}) = 0
ioctl(5, SNDCTL_TMR_TIMEBASE or TCGETS, {B9600 -opost -isig -icanon -echo ...}) = 0
ioctl(5, SNDCTL_TMR_TIMEBASE or TCGETS, {B9600 -opost -isig -icanon -echo ...}) = 0
ioctl(5, SNDCTL_TMR_TIMEBASE or TCGETS, {B9600 -opost -isig -icanon -echo ...}) = 0
ioctl(5, SNDCTL_TMR_STOP or TCSETSW, {B115200 -opost -isig -icanon -echo ...}) = 0
ioctl(5, SNDCTL_TMR_TIMEBASE or TCGETS, {B9600 -opost -isig -icanon -echo ...}) = 0
fcntl64(5, F_GETFL) = 0x8002 (flags O_RDWR|O_LARGEFILE)
fcntl64(5, F_SETFL, O_RDWR|O_LARGEFILE) = 0
fcntl64(5, F_GETFL) = 0x8002 (flags O_RDWR|O_LARGEFILE)
write(5, "N#\n", 3) = 3
...
...
...
read(5, "\n\r", 4096) = 2
...
...
...
write(5, "w400e0640,4#\n", 13) = 13
read(5, "\0\0\0\0", 4096) = 4
write(1, "Read device Chip ID at 0x400e064"..., 54) = 54
write(5, "w400e0740,4#\n", 13) = 13
read(5, "`\5\t(", 4096) = 4
write(1, "Read device Chip ID at 0x400e074"..., 54) = 54
brk(0x9705000) = 0x9705000
write(1, "-I- Found processor : at91sam3u1"..., 57) = 57
...
...
...
write(5, "S2007e800,8c8#\n", 15) = 15
write(5, "\374\37\10 9\360\7 \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2249) = 2249
close(6) = 0
write(5, "W2007e840,0#\n", 13) = 13
write(5, "W2007e848,3#\n", 13) = 13
write(5, "W2007e84c,4#\n", 13) = 13
write(5, "W2007e850,0#\n", 13) = 13
write(5, "G2007e800#\n", 11) = 11
write(5, "w2007e840,4#\n", 13) = 13
read(5,

And this is where it hangs. It would appear the device is no longer responding. It looks like its trying to send the start of the .bin file over xmodem, they first few bytes of the file are: FC 1F 08 20 39 F0 07 20 which is the "\374\37...\7 " in the write() above, it wrote a total of 2249 bytes, which is the entire length of the .bin file.

Does anyone know what that read() is waiting for, and why the sam3u1 is not responding to it?

-Kris

Return to “SAM-BA”

Who is online

Users browsing this forum: No registered users and 1 guest