Jack Gassett

Introducing ZAP IDE - ZPUino and AVR8 together at last!

Recommended Posts

After weeks and weeks of intense collaboration Alvie and I are excited to release the first version of the ZAP (ZPUino Arduino Papilio) Soft Processor IDE.

 

The ZAP IDE puts the AVR8 and the ZPUino Soft Processors together in the latest and greatest Arduino IDE (1.5.2) and makes using either one super easy. We've cleaned up all of the source code for both the ZAP IDE and the ZPUino HDL and pulled it all together with new documentation. The goal is to make the ZPUino extremely useful for anyone who uses a Papilio, whether you are just starting or an old hat. This is a new beginning for Soft Processors on the Papilio and the first step in making Open Source System on Chip designs as easy as using an Arduino.

 

New Features:

  • All soft processors together in one release, the ZPUino and AVR8 together and a framework for any future Soft Processors.
  • ZPUino board types are associated with their corresponding bit file. Just select, "Burn Bootloader" and the ZPUino version you need is loaded to your Papilio board. No more searching the website and trying to figure out what ZPUino bit file you need.
  • Code Examples built in that are specific to what Soft Processor you are using.
  • ZPUino code examples specify what kind of board type/ZPUino variant is required. Just select the required board type, burn the bootloader, and run the code.
  • ZPUino documentation for:

Whats next?

The next steps are to improve the documentation, release more variants,  and release more advanced Wishbone Peripherals.

 

Planned Documentation:

  • How to synthesize your custom ZPUino System on Chip design using VHDL.
  • How to make a Wishbone peripheral using VHDL templates.
  • Ongoing documentation for variants, libraries, and peripherals.

Planned Variants:

  • Apollo variant - Audio based variant that has SID audio, YM2149, and others. This is what the RetroCade Synth will run on.
  • Spectrum ZX VGA - A variant that implements a light weight VGA output based on the Spectrum ZX computer. Will run on Papilio One 250K and up.

Planned Wishbone Peripherals:

  • Audio chips - SID, YM2149, POKEY
  • VGA - ZX Spectrum
  • Convert the Sump Logic Analyzer core to Wishbone
  • Publish a working Signal Generator core that can do square, saw, sin, cos waves.

 

 

 

Share this post


Link to post
Share on other sites

First Post to the forum. Hope this is okay.

 

New Papilio Pro Owner - with the Plugin Boards Arcade Megawing and RetroCade Synth.

New to FPGA development  but this is great fun. learning VHDL no previous experience.

Some prior SW development and testing experience however.

 

Thank you for the work on this as it was quite difficult to get this working for me earlier.

   HW - Cable issues - free supplied cable didnt work so using my USB flatbed scanner cable.

   SW - USB COM port Driver Issues - had to read forums to get the solution.

            Rectrocade Synth was the way to get sketches working with my board earlier according to a forum post.

           

Zap Quick Start Guide 2.0.0 my experiences

 

Local setup : Papilio Pro with Arcade Megawing and old Windows XP based PC (Can do linux as well).

clicking the hyper text link you are directed to the 2.0.0 version of ZAP IDE download page

 

Minor point: looking on the photo next to the  link clicked you see 1.5a as version

After agreeing to the download you see 2 install versions

 

The one labeled (Required) zap-2.0.0-windows.zip was installed on c:\zap location as guide suggested or expert.

 

just curious what is the difference between versions?


skipped the AVR8 testing as had my goal of getting the Arcade Megawing  VGA output going.

Chose the Zpuino 1.0 on papilio pro (LX9), Hyperion with 8-bit HQVGA on Arcade MegaWing
Clicked Papilio programmer
Clicked Burn Bootloader - okay it worked fine.

 

Unpluged USB on board and inserted my Arcade Megawing.

Plugged megawing VGA and audio out into my KVM switch.

reconnected USB cable.

selected quickstart example - removed the pinset and LED code.

compiled
uploaded
serial monitor showed the ascii table - working okay so far great

try another example the VGA Hello world  - compiling fails with errors

#1 - VGA class has no member named setBackgroundColor
Tried just comment this line out in sketch
 

recompile

 

#2 - In file
c:/zap/hardware/zpuino/zpu/libraries/VGA/VGA.h

#error No support for your board

stopped in my tracks at this point unfortunately.

 

Unsure why this happens - does it mean lacking support for the Papilio Pro board?

 

Any help is appreciated

Share this post


Link to post
Share on other sites

Arghhh, I blew it, I missed committing the code change that added our new board types to the VGA library. Here is a fix:

 

Replace the VGA.h file located in zap-2.0/hardware/zpuino/zpu/libraries/VGA/ with the one attached to this message.

 

Or, wait a little bit and I will get a new release out with the correction.

 

Sorry for the hassle,

Jack.

VGA.zip

Share this post


Link to post
Share on other sites

removed ZAP 2.0 installation

 

left old bootloader installed on Papilio Pro

 

installed ZAP 2.0.1

 

was able to compile and upload all the VGA example sletches

worked but Zetris had no sound.

 

2# wanted to try and install a new zpuino instance on bootloader because unsure if old one had ym2149 chip support

chose Zpuino on Papilio pro LX9 Retrocade on Retrocade Megawing.

got error

 C:\zap\hardware\tools\papilio\papilio_loader\Papilio_Programmer.bat\..\Papilio_Programmer.sh: line 4: $'\r': command not found

 

now this function appears to not work anymore for original hyperion board selection as well.

 

#2 error with VGALCD Demo sketch compile

 

 

C:/zap/hardware/zpuino/zpu/libraries/VGALiquidCrystal/VGALiquidCrystal.h:48: error: conflicting return type specified for `virtual void VGALiquidCrystal::write(uint8_t)'

 

 

Share this post


Link to post
Share on other sites

Ok,

 

So the bootloader problem was caused by git automatically trying to fix line endings. I had redownloaded the git repository and it added the wrong line endings, so I disabled that behavior.

 

The VGALiquidCrystal issue was caused by, once again, I made changes in the work directory and did all my testing in that directory and then they didn't get commited to the source directory... It is corrected now.

 

As far as sound on the Zetris example, my goal for this release was just to get the VGA functionality working properly. I took a quick try at fixing the audio for Zetris but something is going wrong, I suspect the audiomixer needs to be updated. My next major release of ZAP will focus on audio functionality and will include variants for Apollo/RetroCade and libraries for the SID and YM2149 chips. When I get all of that working I will also fix audio for Zetris.

 

I'm generating a 2.02 release now which should be ready in 10-15 minutes.

 

Jack.

Share this post


Link to post
Share on other sites

Thanks for your quick response. It is great that you could quickly fix the major issues.

The sound was just a minor point. Glad to know it was not an issue with my HW or setup here.

Will wait for the upcoming releases.  Testing new 2.02 now.

Share this post


Link to post
Share on other sites

Hi all,

 

I'm almost unable to choose "tools" from the menu All other menuitems respond but tools doesn't show up. After a while I kill the IDE with the taskmanager. No difference wether the board is plugged in or not.

Any ideas?

 

Edit found that at http://arduino.cc/de/Guide/Troubleshooting#toc14

 

Why does do the Arduino software and the Tools menu take a long time to open (on Windows)?

If the Arduino software takes a long time to start up and appears to freeze when you try to open the Tools menu, there by a conflict with another device on your system. The Arduino software, on startup and when you open the Tools menu, tries to get a list of all the COM ports on your computer. It's possible that a COM port created by one of the devices on your computer slows down this process. Take a look in the Device Manager. Try disabling the devices that provide COM ports (e.g. Bluetooth devices).

Share this post


Link to post
Share on other sites

After I took a look into the device manager I was amazed ::) round about 15 Bluetooth Device COM Ports.. Some from Toshiba some from a bluetooth controlled panoramci head. After disabling all of them the menu is much more responsive. Now I have to wait 5 to 10 seconds, before it lasted 10 minutes or more.

 

Greetings

Peter

Share this post


Link to post
Share on other sites
Has anyone encountered this error with the ZAP IDE?:
 
Programming External Flash Memory with "\zap-2.0.2/hardware/zpuino/zpu/bootloaders/lx9/zpuino-1.0-PapilioPro-S6LX9-Hyperion-HQVGA-LogicStart-MegaWing.bit".
Found Macronix Flash (Pages=32768, Page Size=256 bytes, 67108864 bits).
Erasing    :
Doing Partial Erase
......Ok
Verifying  :
......Pass
Programming :
......Ok
Verifying  :
Using devlist.txt
......Pass
Done.
SPI execution time 17432.3 ms
USB transactions: Write 6858 read 6689 retries 0
JTAG chainpos: 0 Device IDCODE = 0x24001093 Desc: XC6SLX9
Using devlist.txt
 
ISC_Done       = 0
ISC_Enabled    = 0
House Cleaning = 1
DONE           = 0
 
 
Cannot get programmer version, aborting

 

Thanks.

Share this post


Link to post
Share on other sites

Yes, I too am blocked by the "Cannot get programmer version, aborting" error.  I'm running Windows 7, and I can't seem to get the COM port recognized from the ZAPide.  I know I had a regular Arduino IDE (1.02 I think) up and running fine a few months ago.  I'll try dragging that out of the closet and see if it still works. Part of me suspects there may be a conflict between the two (they may not be happy co-existing).  Another option is uninstalling the previous Arduino IDE.

 

Note that the Papilio Loader works fine for me, so I do have some level of connectivity to my Papilio One 500, but the USB COM port serial emulation is the issue. I'm not sure if I should be using the FTDI drivers included with the Papilio Loader, or try to get presumably newer ones from http://www.ftdichip.com/Drivers/VCP.htm 

Share this post


Link to post
Share on other sites

Hey professorpacs and markhu,

 

Sorry for the late response on this one, I somehow missed this post. That error message is generated when the ZPUino Soft Processor is not running on the Papilio board. With the AVR8 a bit file that contains the AVR8 and merged code is generated and the whole thing is loaded to the board. With the ZPUino you have to load the ZPUino Soft Processor bit file to the board first before you do anything. Then when you upload code the ZAP IDE communicates with the ZPUino Soft Processor on the Papilio over the serial port and puts it into a special mode where it can load your code to the SPI Flash chip and then triggers a reboot to load and run that code.

 

Please take a look at the ZAP IDE Getting Started Guide - ZPUino section. It shows you how to use the Bootloader functionality in the ZAP IDE to load the required ZPUino bit file to the board before you start.

 

Thanks,

Jack.

Share this post


Link to post
Share on other sites

I have a Papilio One 250 which I'm trying to use with ZAP 2.0.7. I've followed the direction at ZAP IDE Getting Started Guide - ZPUino section and have had partial success. When attempting to program the bootloader I can see that the SPI programmer bit file is successfully downloaded. However, after that the ZAP IDE gives a message that the SPI prom type is not recognized. When I look at the SPI flash chip it appears to be an ST Micro 25P40VP. The board rev info is:

 

Papilio Platform

Papilio One

www.GadgetFactory.net

USB FPGA REDe

BPC3003 V2.04

250K silkscreen square is marked with permanent marker (and matches FPGA marking)

 

The info from the log window is pasted below.

 

JTAG chainpos: 0 Device IDCODE = 0x11c1a093    Desc: XC3S250E

Using built-in device list
ISC_Done       = 1
ISC_Enabled    = 0
House Cleaning = 1
DONE           = 1
Programming to SPI Flash
Using devlist.txt
Programming a Papilio One 250K
JTAG chainpos: 0 Device IDCODE = 0x11c1a093    Desc: XC3S250E
Using devlist.txt

Uploading "bscan_spi_xc3s250e.bit". Done.
Programming time 111.5 ms

Programming External Flash Memory with "C:\projects\Papilio\loader\zap-2.0.7/hardware/zpuino/zpu/bootloaders/p1_250k/zpuino-1.0-PapilioOne-S3E250-Vanilla-1.0.bit".
Unknown Numonyx/Micron Flash Type (0x20)
Error: SPI Status Register [0x00] mismatch (Wrong device or device not ready)..
Error occured.
USB transactions: Write 44 read 8 retries 0
JTAG chainpos: 0 Device IDCODE = 0x11c1a093    Desc: XC3S250E

Using devlist.txt
ISC_Done       = 1
ISC_Enabled    = 0
House Cleaning = 1
DONE           = 1
processing.app.debug.RunnerException: the selected serial port DONE           = 1
 does not exist or your board is not connected
    at processing.app.debug.BasicUploader.burnBootloader(BasicUploader.java:321)
    at processing.app.Editor$47.run(Editor.java:2540)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

 

 

Another issue: I was able to successfully compile and load the Papilio_QuickStart sketch to the Papilio One 250K "Shifty AVR8" board without errors. However, I don't see the ASCII chart echoed to the Arduino serial port monitor. I can see the Papilio One RX LED blinking, but the TX LED never has any activity. I would expect the TX light to blink when the ASCII chart is sent out the serial port.

 

Here's the log window when attempting the AVR8 load.

 

Executing  C:\projects\Papilio\loader\zap-2.0.7\hardware\tools\avr\bin\avr-size -A C:\Users\PAULUR~1\AppData\Local\Temp\build2428522038982300145.tmp/Papilio_QuickStart.cpp.hex
Binary sketch size: 3,076 bytes (of a 16,384 byte maximum) - 18% used
make: Entering directory `C:/Users/PAULUR~1/AppData/Local/Temp/build2428522038982300145.tmp'

Converting Intel hex file to Verilog Mem format:
./srec_cat Papilio_QuickStart.cpp.hex -Intel -Byte_Swap 2  -Data_Only -o tmp.mem -vmem 8
./gawk ' BEGIN{FS=" ";} { $1= ""; print}' tmp.mem > out.mem

Converting Intel hex file to Verilog Mem format:
./srec_cat Papilio_QuickStart.cpp.hex -Intel -Byte_Swap 2  -Data_Only -o tmp.mem -vmem 8
./gawk ' BEGIN{FS=" ";} { $1= ""; print}' tmp.mem > out.mem

Selecting Papilio One Bit file.

Merging Verilog Mem file with Xilinx bitstream:
./data2mem -bm bitstreams/AVR8_PapilioOne_bd.bmm -bt bitstreams/AVR8_PapilioOne.bit -bd out.mem -o b out.bit
#./data2mem -bm bitstreams/AVR8_PapilioOne_bd.bmm -bt out.bit -d > out.dmp    

Writing Bit file to the Hardware
./papilio-prog -v -f out.bit -v
JTAG chainpos: 0 Device IDCODE = 0x11c1a093    Desc: XC3S250E
Using devlist.txt
Created from NCD file: top_avr_core_v8.ncd;UserID=0xFFFFFFFF
Target device: 3s250evq100
Created: 2010/10/15 12:59:05
Bitstream length: 1353728 bits

Uploading "out.bit". Done.
Programming time 268.0 ms
USB transactions: Write 90 read 6 retries 0
make: Leaving directory `C:/Users/PAULUR~1/AppData/Local/Temp/build2428522038982300145.tmp'

Share this post


Link to post
Share on other sites

I have a Papilio One 250 which I'm trying to use with ZAP 2.0.7. I've followed the direction at ZAP IDE Getting Started Guide - ZPUino section and have had partial success...

 

<snip>

 

Another issue: I was able to successfully compile and load the Papilio_QuickStart sketch to the Papilio One 250K "Shifty AVR8" board without errors. However, I don't see the ASCII chart echoed to the Arduino serial port monitor. I can see the Papilio One RX LED blinking, but the TX LED never has any activity. I would expect the TX light to blink when the ASCII chart is sent out the serial port.

 

<snip>

 

Using an oscilloscope, I can confirm that the sketch is running. To do this I made the following changes to the Papilio_QuickStart sketch.

 

1. Commented out the if statement that looks at the button pins to determine if the LED blinks or is driven on. This was done because I have only the Papilio One board with no wings and I if there are pullups enabled on the FPGA pins then the LED pins will be statically driven high. I wanted to see the toggle on the pins.

 

Result:  LED pins toggle every 250 ms.

 

2. Changed the delay between LED toggles in the main loop from 200 ms to 1 ms.

 

Result:  LED pins toggle every 45-48 ms. This tells me that the serial I/O is taking 44-47 ms. One byte from the ASCII chart is sent out of the serial port every LED toggle, and there are 26 characters sent out of the serial port for each ASCII byte. At 9600 baud that is approximately 1 char/ms = 26 ms, leaving approximately 20 ms for string conversions and loop overhead.

 

3. Changed the baud rate from 9600 baud to 19200

 

Result:  LED pins toggle every 25 ms. To first order this makes sense as the toggle time has been reduced by 20 mS and doubling the serial transmission speed accounts for 13 ms of the reduced toggle time.

 

After looking at the Papilio One schematic an probing further, the serial output from FPGA is visible on FPGA pin 90 and FTDI pin 39 on net USB_RXD. Based on this net name, one has to assume that the serial direction reference is the PC instead of the Papilio.

 

Does this mean I need new FTDI drivers? They are working enough to allow the JTAG loading over the first FTDI serial port.

Share this post


Link to post
Share on other sites

Using an oscilloscope, I can confirm that the sketch is running. To do this I made the following changes to the Papilio_QuickStart sketch.

 

1. Commented out the if statement that looks at the button pins to determine if the LED blinks or is driven on. This was done because I have only the Papilio One board with no wings and I if there are pullups enabled on the FPGA pins then the LED pins will be statically driven high. I wanted to see the toggle on the pins.

 

Result:  LED pins toggle every 250 ms.

 

2. Changed the delay between LED toggles in the main loop from 200 ms to 1 ms.

 

Result:  LED pins toggle every 45-48 ms. This tells me that the serial I/O is taking 44-47 ms. One byte from the ASCII chart is sent out of the serial port every LED toggle, and there are 26 characters sent out of the serial port for each ASCII byte. At 9600 baud that is approximately 1 char/ms = 26 ms, leaving approximately 20 ms for string conversions and loop overhead.

 

3. Changed the baud rate from 9600 baud to 19200

 

Result:  LED pins toggle every 25 ms. To first order this makes sense as the toggle time has been reduced by 20 mS and doubling the serial transmission speed accounts for 13 ms of the reduced toggle time.

 

After looking at the Papilio One schematic an probing further, the serial output from FPGA is visible on FPGA pin 90 and FTDI pin 39 on net USB_RXD. Based on this net name, one has to assume that the serial direction reference is the PC instead of the Papilio.

 

Does this mean I need new FTDI drivers? They are working enough to allow the JTAG loading over the first FTDI serial port.

 

A bit more detective work reveals something quite puzzling. As a reference, my Papilio One serial ports enumerate as COM23 and COM24. Based upon the ZAP instructions (at http://www.papilio.cc/index.php?n=Papilio.ZAPIDE#Section3), FTDI serial port B should enumerate as the second port (COM24) but instead it enumerates as COM23. I loaded the Papilio_QuickStart sketch then started up TeraTerm and tried COM24 but no joy. However, when I switched to COM23 I can now see the ASCII chart being written. If I select COM23 in the Arduino ZAP IDE - it works also!!!

 

After shutting down and restarting the Arduino AZP IDE, I can see the ASCII chart when the IDE is configured with COM23 (the lower numbered) serial port.

 

Any ideas on why these are swapped? Or is this just a documentation issue?

Share this post


Link to post
Share on other sites

Hello urbite,

 

That sounds like the wrong flash chip in your Papilio 250K, the chip that we use is the SST 25VF040B.

 

I've also never seen FTDI channel B show up before channel A... Something weird is going on...

 

Where did you purchase the board from? We've had some counterfeits with wrong parts before.

 

Thanks,
Jack.

Share this post


Link to post
Share on other sites

Guys, is there any easy way how to get the zap ide working under 64bit linux?


Since I started with papilio, I am facing that all the software is supporting only 32 bit linux (really don't know why....). I get everything working (the loader was pain...) except the zap ide due to rxtx libraries etc. I found some library on the forum but it didn't helped...-are there any steps what all needs to be done?


 


Many thanks! 


Share this post


Link to post
Share on other sites

I have ZPUino base version working in Debian 64-bit with no problems. But this is a newer version of the base Arduino IDE.

 

Let me check ZAP with 64-bit, and see what I can do.

Share this post


Link to post
Share on other sites

Ok this simple trick should do it:

 

Open a shell, move inside the "lib" folder, inside papilio-zap-ide, and issue the following commands:

mv librxtxSerial.so librxtxSerial32.soln -s librxtxSerial64.so librxtxSerial.so

Example with the directory name:

papilio-zap-ide/lib$ mv librxtxSerial.so librxtxSerial32.sopapilio-zap-ide/lib$ ln -s librxtxSerial64.so librxtxSerial.so

That should allow it to run, and hopefully work.

 

You might however need some 32-bit support for the compilers. Which distribution do you use?

Share this post


Link to post
Share on other sites

Ok this simple trick should do it:

 

Open a shell, move inside the "lib" folder, inside papilio-zap-ide, and issue the following commands:

mv librxtxSerial.so librxtxSerial32.soln -s librxtxSerial64.so librxtxSerial.so

Example with the directory name:

papilio-zap-ide/lib$ mv librxtxSerial.so librxtxSerial32.sopapilio-zap-ide/lib$ ln -s librxtxSerial64.so librxtxSerial.so

That should allow it to run, and hopefully work.

 

You might however need some 32-bit support for the compilers. Which distribution do you use?

 

Wow! Alvaro that was about thousand times simpler than I expected it to be :-D

Millions of thanks :)

 

I am now able to run the IDE but getting stuck on compiling a sketch:

processing.app.debug.RunnerException: Cannot run program "/opt/papilio-zap-ide/hardware/tools/zpu/bin/mksmallfs": java.io.IOException: error=2, No such file or directory

I checked the path and the file is there and executable... Do I miss some libs, links or whatever? (debian x64)

maara@fpdev:/opt/papilio-zap-ide/hardware/tools/zpu/bin$ file mksmallfsmksmallfs: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, BuildID[sha1]=0x2bd0b334117966d55f0209ce0519da52b14d1f76, stripped

Thanks for help!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now