Trying to use apio to program an Alchitry CU v2

I’ve been trying for weeks now to program my CU v2. I have a couple of other boards that work well with apio but no the Cu V2. I’m trying to keep the code as simple as possible, and it’s entirely possible that I’m leaving something out.

Here is the exact pcf file I’m using:

leds.pcf================================================

### LED Pins:

set_io -nowarn LED1 J11

set_io -nowarn LED2 K11

set_io -nowarn LED3 G12

set_io -nowarn LED4 H12

and here is the verilog code:

leds.v===================================================

module leds(

output LED1,   

output LED2, LED3, LED4

);

assign LED1 = 1’b1;

assign {LED2, LED3, LED4} = 3’b0;

endmodule

This works fine with my other dev boards (including the Cu v1) but not the Cu v2.

This is the error that I’m getting:

Found difference between flash and file!
ABORT.
scons: *** [upload] Error 3

Any hints about what I’m doing wrong?

There is an issue with the tool used by apio to program the flash chip used on the Cuv2 : it does not unlock the chip before trying to write it.

You can use apio to build the design, but you have to use the Alchitry loader or openfpgaloader to progam it.

More infos on this thread : Cu V2 and iceprog - #7 by gc74

I’m not sure if this is going to be permanent, but at least progress has been made.

I saw a post that said device manager must show two com ports, in my case I wasn’t seeing and com ports at all. FT suggested that I needed to load a device driver in order for the com ports to show specifically the suggestion was to load ‘CDM-v2.12.36.20-WHQL-Certified’. I did that and presto, the board now shows up in the alchitry loader app. I’ve been able to install a few verilog examples - so things are looking up.

Next problem - I can’t get xilinx/lattice to give me a working license. Without that license I can’t use the alchitry labs app.

The license is not mandatory if you use the opensource toolchain and Xilinx is only needed for Au ant Pt, not for Cu.

If you want to use iCEcube instead of the opensource toolchain, here is how : iCEcube2 Setup