Papilio & Raspberry PI - Ideas?


eelcor

Recommended Posts

Hi everybody,

Jack and I have been tinkering with getting papilio-prog working on Raspberry Pi. Jack found a strange bug in getopt(), but also a workaround and now we are able to upload bitfiles from the raspberry pi to the arduino.

Having accomplished this wonderful feat, it is now time for ideas how to combine the Papilio with the Raspberry Pi.

How to install (forgive me if I am not complete):

Before you begin. I have a raspberry pi loaded with the default (19/04/2012) firmware.

First: install the following packages libusb-dev, libftdi-dev, automake, pkg-config and verify whether you have a /dev/ttyUSB0 and /dev/ttyUSB1 after connecting the papilio (and probably rebooting).

Second: Clone the papilio-prog source code using Git: https://github.com/GadgetFactory/Papilio-Loader

Third:    Go to directory Program within the repository and find "

while (((c = getopt (argc, argv, "hb:f:s:jvcCr")) != -1))" in butterfly.cpp and replace it with "

while (((c = getopt (argc, argv, "hb:f:s:jvcCr")) != -1) && (c != 255))"

Fourth: Run 'sudo ./autogen.sh' followed by 'sudo ./configure' and finally 'sudo make' and a new papilio-prog should be generated. You have to "sudo" this executable, but now you're able to upload bitfiles.

Jack and I had some problems with the connection and it seems to be a power related issue. It is recommended to have a powered USB hub ready.

I have been tinkering with AVR8 and arduino and although I manage to compile code for the papilio, I do not have an open source alternative for "data2mem" and am therefore unable to merge the bitfiles.

I hope someone has some nice ideas regarding the possibilities of this setup, but somehow I have the feeling we could do something really cool with it. (combining the GPIO pins of the Raspberry with the papilio).

Kind regards,

Eelco

Link to comment
Share on other sites

Those packages match what I remember, and it was weird, I had to do a reboot too before it started compiling correctly. That's unusual for linux...

My ideas for pi/papilio are:

  • Since there is no JVM and we can't use the Arduino IDE maybe we can setup a Makefile based setup and choose a nice C++ editor. For the AVR8 we would need to make a data2mem replacement, or we can use ZPUino.
  • I would like to get the OpenBench Logic Sniffer clients working with the Papilio under linux, same problem with JVM. But I think there are some native linux ports of the client.
  • I'd like to look into making the Papilio act as an ISA bus for the raspberry pi, then wings are like 8-bit isa cards...
  • Find a linux equivalent of the Synthmaker application that will let us make a MIDI dashboard for the RetroCade Synth.

Jack.

Link to comment
Share on other sites

Actually, there is a JVM!

I have been able to install the arduino software. It is slow as hell, but it works!

Just sudo apt-get install arduino and voila!

Unfortunately the flash option of the modified IDE relies on mem2data, a Xilinx proprietary program to merge bitfiles. Jack, is there an alternative way to do this?

Kind regards,

Eelco

Link to comment
Share on other sites

We would have to figure out where in the bit files the BRAM portions live, then make an app that loads the data to those bit files. I don't really have time to work on that right now. I think the solution for now is to use the ZPUino. Alvie has everything working under linux and no requirements for data2mem.

That is great news to hear about the JVM!

Jack.

Link to comment
Share on other sites

Hi Jack,

That's an excellent idea! If the Zpuino IDE lives in the JVM it would be great. Do we need to crosscompile the toolchain, or is it plain gcc?

Oh and by the way, if you want to experiment with X11, I recommend installing Cygwin and enabling tunneling within the config file of ssh (works best with openssh) and enabling X11 forwarding in Putty. I currently have a nice setup, which works like a charm ;-)

Regards, Eelco

Link to comment
Share on other sites

I was also pondering whether the combination of OLS, together with Raspberry Pi and a touchscreen would make a beautiful logic analyzer. What about Benchy?

One of the things I was thinking about was to make a multi peripheral, which can be driven by the native SPI interface of the RPi and can be a combination of PWM, GPIO, UART, Timer etc. etc. Once I get the hang of it with C on the RPi, that would be great.

Your synth idea also sounds wonderful and maybe we could also use Jeri's SDR platform to create a software defined radio.

We haven't barely scratched the surface of the combination!

Kind regards, Eelco

Link to comment
Share on other sites

eelcor,

All great ideas, very much along the lines of what I've been thinking too.

I installed the OLS client over the weekend and did a capture. It works but it is too slow to be usable... There is a python based OLS client that I was going to try, but I ran out of time...

Might be cool to make Arduino code run on the RasPi through the Papilio as a collection of peripherals... Compiled with RasPi tools but communicates with Papilio and gives access to peripherals transparently to the end user.

Jack.

Link to comment
Share on other sites

Hi Jack,

It's a pity that Jazelle is closed for developers, it should dramatically enhance performance of Java programs. Python should run well though. It would be great to combine the OLS with the RasPi and a touchscreen and use the papilio as an oscilloscope (you should check KNJN flashy).

Have you already tried the wiringPi library? It should be fairly easy to port Arduino code to wiringPi. Unfortunately I haven't had the time to bake my own kernel, because I want SPI/I2C support and there is a kernel driver for that. (and some ready made kernels without the wireless support I need).

I also revisited my Beagleboard, but somehow the distribution seems to be less transparent than the RasPi's. I do have figured out to combine sgx acceleration with the dsp, which should make up for a nice combo.

The only thing I can say that these are "great times for tinkerers!". You also hit a sweet spot with the papilio!

Kind regards,

Eelco

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.