How to program the arduino sketch for ZPUino to the spi flash ?


Lstout

Recommended Posts

Hi,

 

How can i program an arduino sketch for ZPUino to the spi flash ?

 

Is it by creating a merged .bit file with the firmawre ? but how to do this ?

The papilio loader offer the posibility to do this merging with the .bmm and .hex file, but how to get the hex file form the Arduino ide ?

 

thanks

Link to comment
Share on other sites

You can either upload it through the IDE (it will be written persistently to flash) or you can create a fpga bitfile+sketch that can be burned with papilioprog.

 

Are you having trouble uploading using IDE or you want to generate a composite (FPGA bitfile+sketch) file that can be burned into the SPI flash ?

Link to comment
Share on other sites

Both in fact, I 'd like to generate a composit fpga+sketch file.

 

And i also have a problem with the IDE: i can only load my sketch once after having burned the bit file. The second time and following there is some verify errors. To make it work again i have to do a global erease with the papilio loader and then burn again the bit file. But its quit long each time...

 

It looks like the IDE does not erease the memory space of the sketch before writing. Because if i try to load the sketch twice without any change it's ok, but if i do a change i have to reburn every thing. Have you face that before ?

Link to comment
Share on other sites

i am using a papilio-pro board with the ide arduino-0102.

 

Below is what i get if i try to load twice the sketch without ereasing and re-burning the bit file.

An other thing is I understood that the IDE was suppose to burn the sketch, but if i do a OFF - ON on the board the program is lost.

 

 

Board: Unknown board @ 96000000 Hz (0xa4041700)

Verification failed at 0x00060000!
05 18 02 ca 31 0a fa de a4 04 17 00 0b 0b 0b ae 80 04 00 00 0b 0b 0b 0b 88 08 0b 0b 0b ad d1 2d 0b 0b 0b 0b 88 0c 04 00 00 00 00 00 04 02 fc 05 0d 81 0b 80 e4 80 80 88 0c 80 e0 51 ae c1 2d 02 84 05 0d 04 02 fc 05 0d 82 0b 80 e4 80 80 88 0c 80 e0 51 ae c1 2d 02 84 05 0d 04 02 f4 05 0d 74 84 11 08 71 08 29 82 b0 0a 0c 53 80 e0 51 ae c1 2d 02 8c 05 0d 04 02 f8 05 0d 73 75 84 12 0c 51 a0 d7 2d 02 88 05 0d 04 02 f0 05 0d 75 77 54 54 86 d0 74 0c 80 52 72 51 ad d0 2d 81 52 72 51 ad dc 2d 72 10 10 84 80 05 53 8c 0b 81 90 0a 14 0c 87 e8 52 73 51 a0 f2 2d 73 51 a0 a9 2d 02 90 05 0d 04 02 fc 05 0d 72 84 11 08 88 0c 51 02 84 05 0d 04 80 e4 80 80 84 08 88 0c 04 72 82 2b 88 0c 04 02 f4 05 0d 75 52 74 51 a1 d7 2d bc 52 88 08 51 bb 81 2d 80 0b 88 08 24 8a 38 88 08 51 b9 b1
05 1c a3 db 31 0a fa de a4 04 17 00 0b 0b 0b ae c0 04 00 00 0b 0b 0b 0b 88 08 0b 0b 0b ad d3 2d 0b 0b 0b 0b 88 0c 04 00 00 00 00 00 04 02 fc 05 0d 81 0b 80 e4 80 80 88 0c 80 e0 51 ae d1 2d 02 84 05 0d 04 02 fc 05 0d 82 0b 80 e4 80 80 88 0c 80 e0 51 ae d1 2d 02 84 05 0d 04 02 f4 05 0d 74 84 11 08 71 08 29 82 b0 0a 0c 53 80 e0 51 ae d1 2d 02 8c 05 0d 04 02 f8 05 0d 73 75 84 12 0c 51 a0 d7 2d 02 88 05 0d 04 02 f0 05 0d 75 77 54 54 86 d0 74 0c 80 52 72 51 ad d4 2d 81 52 72 51 ad de 2d 72 10 10 84 80 05 53 8c 0b 81 90 0a 14 0c 87 e8 52 73 51 a0 f2 2d 73 51 a0 a9 2d 02 90 05 0d 04 02 fc 05 0d 72 84 11 08 88 0c 51 02 84 05 0d 04 80 e4 80 80 84 08 88 0c 04 72 82 2b 88 0c 04 02 f4 05 0d 75 52 74 51 a1 d7 2d bc 52 88 08 51 bb 85 2d 80 0b 88 08 24 8a 38 88 08 51 b9 b9
Programming completed WITH ERRORS in 1.88 seconds.

Link to comment
Share on other sites

was this the one?

may have to pull the changes into mine too.

 

https://github.com/GadgetFactory/Papilio-Loader

 

1/4/2012  Version 2.4	Fixes from MagnusK		* New cmd-line option (-d) that allows you to specify the FTDI device.  This was asked for in this forum.		* Spartan-6 LX4 - LX45 parts are added to the built-in device list		* The fpga wait-code is put back		* The code now supports many more flash parts		* The number of pages in the Macronix part is corrected (32768, not 250000)		* Misc corrections here and there in the code		* The erase-before-programming is now handled by a new routine (Spi_PartialErase) that tries to be smarter about the erase. 	
12/3/2012 Version 2.3	Added support for larger bit files with Macronix chips.8/31/2012 Version 2.2	Added support for Macronix 64Mb SPI Flash chips.	Added ability to Erase Flash chip from Explorer context menu.
Link to comment
Share on other sites

  • 4 months later...

I'm having similar problem:

 

Board: Unknown board @ 96000000 Hz (0xa4041700)
 
I tried rebuilding zpuinoprogrammer from https://github.com/alvieboy/ZPUino-HDL/tree/master/zpu/hdl/zpuino/programmer but it still doesn't work for me.
 
Looking in boards.c it seems to have 0xA4031700 but not 0xa4041700. What should I do? Just change definition to match my board? Is that safe to do?
 
Update: after half day more, I managed to get everything working. I needed to compile my own ZAP IDE for Linux, replace zpuinoprogrammer with modified version as described below, and flash zpuino-1.0-PapilioPro-S6LX9-RetroCade-1.0.bit from zap-2.0.5 Windows installation.
 
This brings me to my next question: why bit files from git clone of ZAP--ZPUino-Arduino-Papilio--IDE don't work? I can see that they are much smaller than ones in Windows installation.

 

Also, zpuinoprogrammer from GadgetFactory branch doesn't work. But if you use the one from alvieboy's repo and just add additional board it works like charm.

dpavlin@blue:/blue-zfs/ZPUino/ZPUino-HDL/zpu/hdl/zpuino/programmer$ git diff boards.cdiff --git a/zpu/hdl/zpuino/programmer/boards.c b/zpu/hdl/zpuino/programmer/boards.cindex 6d901ec..3a9ea83 100644--- a/zpu/hdl/zpuino/programmer/boards.c+++ b/zpu/hdl/zpuino/programmer/boards.c@@ -13,6 +13,7 @@ static struct board_type boards[] = {        { 0xA4020F00, "GadgetFactory Papilio One 250 (extra RAM)" },        { 0xA4030E00, "GadgetFactory Papilio Plus LX4" },        { 0xA4031700, "GadgetFactory Papilio Pro LX9" },+       { 0xA4041700, "GadgetFactory Papilio Pro LX9" },        { 0x83010F00, "Spartan 3E Starter Kit S3E500" },        { 0x83011A00, "Spartan 3E Starter Kit S3E500 w/64MB DDR" },        { 0x83010E01, "Spartan 3E Starter Kit S3E500 w/ 8-bit HQVGA" },
Edited by dpavlin
Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.