Electronics > FPGA

Programming Lattice MachXO2: "Password key required"?

(1/3) > >>

jrx07:
Hi everyone,

I am running into an issue programming a Lattice MachXO2 LCMXO2-1200ZE. I am using Lattice Diamond 3.12 and an FTDI C232HM-DDHSL-0 cable to program over JTAG.

Context: I made a data acquisition PCB using the LCMXO2-1200ZE CPLD (I loved using the TinyFPGA AX2 and wanted to make something with lower standby power consumption). I was able to successfully program the board initially, but when I modified the Verilog and tried to reprogram the chip, I received the following error:


--- Quote ---"A Password Key is required. Please select a different operation in the Advanced Security Programming Mode."
ERROR: pgr_program failed.
ERROR - Process Operation Failed.

--- End quote ---

If I change the Programmer "Access Mode/Operation" to "Advanced Security File Programming/Security Read Status Register" I find that "PWD Enable" is set to '1' and "PWD Protect" is also set to '1'

I did not intentionally enable these and I don't have/can't find a password key.

My questions:

* Is it possible to disable the PWD protection?
* Where in Lattice Diamond are these settings controlled? If I bricked this chip, I just want to make sure I don't repeat this mistake in the future :-BROKE

laugensalm:
If you're using a third party JTAG cable, make sure that signal integrity is met, i.e. TCK has a very fast rise time (< 6 ns) and that the cable length is very short.
To do a cheap signal integrity check, you might poll the device IDCODE for a few hours and see if a bit flips.

Unfortunately, there is no real protection against accidental misconfiguration on the MachXO* devices, I've seen a few cases getting the wrong settings by a funny sequence caused by their JTAG daemon 'lserver', however those device were in a chain of the MachXO3 types.
The internals for XO2 are documented a little sparse, but you should find the details in the Lattice tech notes describing the 'Feature Row'.
I don't recall the exact procedure, but I think I got recovery for the XO3 problem just by issueing a full 'ISC_ERASE' sequence. As long as you haven't messed with any OTP fuses, I wouldn't consider it 'bricked'.



jrx07:
Thanks for the tips laugensalm. I did double check the signal integrity with a scope, and the signals seem OK. I like your idea of polling the IDCODE for a few hours though.

I'm a bit new to JTAG debugging. Do you have any recommendations for software tools to issue commands/read back data over JTAG?

laugensalm:
From the OpenSource world, I'd check for OpenOCD or urjtag derivatives, at least OpenOCD should allow some TCL-scriped IDCODE polling.
That should probably suffice for the paranoia check, plus could also help you with issuing the proper erase sequences in a more low level controlled environment than the sometimes flaky Diamond Programmer. Did you succeed in restoring the feature row?

SiliconWizard:

--- Quote from: jrx07 on January 11, 2022, 04:14:15 pm ---My questions:

* Is it possible to disable the PWD protection?
* Where in Lattice Diamond are these settings controlled? If I bricked this chip, I just want to make sure I don't repeat this mistake in the future :-BROKE
--- End quote ---

I've never used the protection features on MachXO2, so I may be missing something. That said, according to the "MachXO2 Programming and Configuration Usage Guide" (TN1204):

--- Quote ---ONE_TIME_PROGRAM
The MachXO2 has One Time Programmable (OTP) fuses that can be used to prevent the on-chip memory from
being erased or programmed. The MachXO2 device has three OTP security fuses, one for each of the following
memory sectors: SRAM, Configuration Flash, and UFM. This preference provides options to set the OTP security
for each memory sector.
--- End quote ---

If you ever set those security bits by mistake, there's nothing you can do, as they are OTP.

As to how to avoid doing this, I guess if you never use any of the advanced programming modes, you should be fine. What was the programming mode you used?

Navigation

[0] Message Index

[#] Next page

There was an error while thanking
Thanking...
Go to full version