Hi,
my CPLD dev board finally arrived and I'm wondering, has anybody managed so far to programme this with linux and the bus pirate?
I have come coolrunner II test board I got from xilinx and I have not managed to program it from linux. I ordered busbluster v2 (http://http://www.seeedstudio.com/depot/bus-blaster-v2-jtag-debugger-p-807.html) and will try with it when it arrives.
Hi Georg,
The programmer application is very simple - it just sends the XSVF file to the Bus Pirate in chunks. The source is here:
http://code.google.com/p/the-bus-pirate ... XSVFPlayer (http://code.google.com/p/the-bus-pirate/source/browse/#svn%2Ftrunk%2Fscripts%2FBPXSVFPlayer)
It may compile under linux with no changes, I'm not sure. If you make a compile, would you please share it, I will include it in the next release.
Hi Ian,
thanks for the link! I checked it out and tried to compile it. It works, however one has to change a few windows specific things. For example, gcc does not know about HANDLE and does also not like to assign TRUE and FALSE to int. Also, the redifinition of usleep(x) to Sleep(x) does not work. After fixing that the thing compiles fine. Because of the problem with HANDLE I had to uncomment lines 289-293 in serial.c, I'm not exactly sure what they do. I will have a closer look into that.
I also have not tested it so far but will do so when I have time.
Georg
I tried with one of the demo files and get that:
./xsvplayer -p /dev/ttyUSB0 -s 115200 -f sch-CPLDintro1LEDon.xsvf
-----------------------------------------------------------------------------
BusPirate XSVF Player V.01
http://www.dangerousprototypes.com (http://www.dangerousprototypes.com)
-----------------------------------------------------------------------------
File is 22846 bytes, Read 22846 bytes
Opening Bus Pirate on /dev/ttyUSB0 at 115200bps, using XSVF file sch-CPLDintro1LEDon.xsvf
Entering XSVF Player Mode
Waiting for first data request...ok
Sending 4096 Bytes (1000)...ok
Sending 4096 Bytes (2000)...ok
Sending 4096 Bytes (3000)...ok
Speicherzugriffsfehler
So it seems there is a segfault somewhere. Do I need another firmware for the buspirate? I already have the newest version I think.
There is a specific xsvf firmware that needs to be loaded in the bus pirate. It is in the cpld dev board download on our google code downloads page.
Of course, you are right! I have uploaded the new firmware and it now works! Programming went smoothly, however, after it is finished it crashes...but the design is on the CPLD
./xsvplayer -p /dev/ttyUSB0 -f sch-CPLDIntro2Ledbutton.xsvf
-----------------------------------------------------------------------------
BusPirate XSVF Player V.01
http://www.dangerousprototypes.com (http://www.dangerousprototypes.com)
-----------------------------------------------------------------------------
File is 22846 bytes, Read 22846 bytes
Opening Bus Pirate on /dev/ttyUSB0 at 115200bps, using XSVF file sch-CPLDIntro2Ledbutton.xsvf
Entering XSVF Player Mode
Waiting for first data request...ok
Sending 4096 Bytes (1000)...ok
Sending 4096 Bytes (2000)...ok
Sending 4096 Bytes (3000)...ok
Sending 4096 Bytes (4000)...ok
Sending 4096 Bytes (5000)...ok
Sending 2366 Bytes (593E)...ok
End of operation reply: XSVF_ERROR_NONE
Success!
Thank you for playing! :-)
*** glibc detected *** ./xsvplayer: double free or corruption (!prev): 0x0000000001f73080 ***
======= Backtrace: =========
/lib/libc.so.6(+0x774b6)[0x7efffbd814b6]
/lib/libc.so.6(cfree+0x73)[0x7efffbd87c83]
/lib/libc.so.6(fclose+0x14d)[0x7efffbd719ed]
./xsvplayer[0x40186f]
/lib/libc.so.6(__libc_start_main+0xfe)[0x7efffbd28d8e]
./xsvplayer[0x400d09]
======= Memory map: ========
00400000-00403000 r-xp 00000000 08:01 529716 /home/gkrocker/buspirate/trunk/scripts/BPXSVFPlayer/xsvplayer
00603000-00604000 r--p 00003000 08:01 529716 /home/gkrocker/buspirate/trunk/scripts/BPXSVFPlayer/xsvplayer
00604000-00605000 rw-p 00004000 08:01 529716 /home/gkrocker/buspirate/trunk/scripts/BPXSVFPlayer/xsvplayer
01f73000-01f94000 rw-p 00000000 00:00 0 [heap]
7efff4000000-7efff4021000 rw-p 00000000 00:00 0
7efff4021000-7efff8000000 ---p 00000000 00:00 0
7efffbaf4000-7efffbb09000 r-xp 00000000 08:01 948 /lib/libgcc_s.so.1
7efffbb09000-7efffbd08000 ---p 00015000 08:01 948 /lib/libgcc_s.so.1
7efffbd08000-7efffbd09000 r--p 00014000 08:01 948 /lib/libgcc_s.so.1
7efffbd09000-7efffbd0a000 rw-p 00015000 08:01 948 /lib/libgcc_s.so.1
7efffbd0a000-7efffbe84000 r-xp 00000000 08:01 692 /lib/libc-2.12.1.so
7efffbe84000-7efffc083000 ---p 0017a000 08:01 692 /lib/libc-2.12.1.so
7efffc083000-7efffc087000 r--p 00179000 08:01 692 /lib/libc-2.12.1.so
7efffc087000-7efffc088000 rw-p 0017d000 08:01 692 /lib/libc-2.12.1.so
7efffc088000-7efffc08d000 rw-p 00000000 00:00 0
7efffc08d000-7efffc0ad000 r-xp 00000000 08:01 892 /lib/ld-2.12.1.so
7efffc282000-7efffc285000 rw-p 00000000 00:00 0
7efffc2aa000-7efffc2ad000 rw-p 00000000 00:00 0
7efffc2ad000-7efffc2ae000 r--p 00020000 08:01 892 /lib/ld-2.12.1.so
7efffc2ae000-7efffc2af000 rw-p 00021000 08:01 892 /lib/ld-2.12.1.so
7efffc2af000-7efffc2b0000 rw-p 00000000 00:00 0
7ffff6139000-7ffff615a000 rw-p 00000000 00:00 0 [stack]
7ffff61ff000-7ffff6200000 r-xp 00000000 00:00 0 [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]
Abgebrochen
Thanks for the update, glad you got it. We're moving all the little apps over to a well-tested serial interface that is proven on multiple platforms. I think that might help a little. If you have any other bug fixes I'll add them to the app.
Hi,
I had a bit more time to play with the code and made my quick and dirty hack a bit more sane ... see the attached files. I now compiles with gcc under Ubuntu 10.10 by simply do
gcc main.c buspirate.c serial.c -o xsvfplayer
However, it does not compile with g++ (g++ is a bit more strict regarding code sanity and some work is needed on the original code to make it comply).
Ian, maybe you can check if it still works with Windows and put it to the release.
Cheers,
Georg
Thank you, we'll try a windows test-compile.
The serial library we're moving too is attached. It is well tested on all platforms. It is used in this Logic Sniffer application:
https://github.com/robots/ols-fwloader (https://github.com/robots/ols-fwloader)
We have permission from robots and the original author pppd to release the source into the public domain.
We had hoped to make the move and have a Windows/Linux compile last week, but we are always behind :)
Thanks for your feedback, I updated the wiki instructions to be clear about the firmware swap and usage instructions.
Just a question that is a bit off-topic: Is there a clear reason why this XSVF playing can't go to the normal firmware (e.g., it needs a lot of memory)? Or is it just that nobody had the time yet to include it to the bus pirate firmware?
The player is pretty huge, and we're already out of space in the Bus Pirate firmware :) I would prefer to integrate it, and probably will for the v4 hardware that has 4 times more flash space.
[quote author="Georg"]
Ian, maybe you can check if it still works with Windows and put it to the release.
[/quote]
The source file compiles without a problem in windows 7 under codeblocks 10.05 IDE . It compiles also under my debian 5, using codeblocks for debian too, and we can safely ignore the unused param_bytechunks variable.
I Posted it back to svn.
thanks Georg!