FX2 microcontroller firmware can work in several modes. To switch between modes used combination of COM port baudrate and parity parameters.
Scroll Title |
---|
|
Mode | Enter | Description | Exit |
---|
COM | Power cycle or exit from CLI mode | Default mode. Provide Virtual COM port interface to FPGA. | Change Baudrate/Parity (CLI / EEPROM Write / Flash Write) | CLI | Baudrate = 123456 | Command Line Interface. Provide set of module management commands. | Power cycle (COM). Change Baudrate/Parity (EEPROM Write / Flash Write). 'quit' command (COM) | EEPROM Write | Baudrate = 222222 Parity = Odd | Received data written by I2C interface to EEPROM. | Power cycle (COM). Change Baudrate/Parity works, but not recommended. | Flash Write | Baudrate = 333333 Parity = Even | Received data written to SPI Flash. | Power cycle (COM). Change Baudrate/Parity works, but not recommended. |
|
...
Anchor |
---|
| __RefHeading__1617_1528585909 |
---|
| __RefHeading__1617_1528585909 |
---|
|
Command Line Interface modeCLI mode provide wide set of commands to manipulate module.
To enter CLI mode, switch COM port "Baudrate" to "123456".
In this mode firmware read user input and process commands. Commands is case sensitive and should be lower-case. "Backspace" can be used for command line correction. "Enter" with empty command line cause re-execution of previous command.
Scroll Title |
---|
title | CLI mode command set |
---|
|
Command | Description |
---|
ver | Print firmware version | power off | Disable FPGA power supply | power on | Enable FPGA power supply | flash status | Print SPI Flash Status registers | flash id | Print SPI Flash IDCODE | flash erase | SPI Flash "Bulk erase" | flash unlock | Clear SPI Flash "Status register" | flash read | Read data from SPI Flash | fpga status | Print status of FPGA pins | fpga reset | Reset FPGA | quit | Quit from CLI mode to COM mode |
|
Table 3: CLI mode command set
Anchor |
---|
| __RefHeading__1619_1528585909 |
---|
| __RefHeading__1619_1528585909 |
---|
|
"ver" commandThe "ver" command print firmware version and build date.
Example:
> ver
1.01 beta
Build Oct 12 2012 13:02:34
Anchor |
---|
| __RefHeading__1621_1528585909 |
---|
| __RefHeading__1621_1528585909 |
---|
|
"power off" commandThe "power off" command disable FPGA power supply.
Example:
> power off
OK
Anchor |
---|
| __RefHeading__1623_1528585909 |
---|
| __RefHeading__1623_1528585909 |
---|
|
Anchor |
---|
| __RefNumPara__1115_1528585909 |
---|
| __RefNumPara__1115_1528585909 |
---|
|
"power on" commandThe "power on" command enable FPGA power supply
Example:
> power on
OK
Anchor |
---|
| __RefHeading__1625_1528585909 |
---|
| __RefHeading__1625_1528585909 |
---|
|
"flash status" commandThe "flash status" command read and print SPI Flash "Status register 1" and "Status register 2" values. Please refer your Flash datasheet to registers bit layout.
...
To get full control on SPI bus firmware disable FPGA power supply before this operation. After each flash command, use "power on" command and "fpga reset" command to run FPGA. |
Example:
> flash status
SR1 00 SR2 00
Anchor |
---|
| __RefHeading__1627_1528585909 |
---|
| __RefHeading__1627_1528585909 |
---|
|
"flash id" commandThe "flash id" command read and print first 3 bytes from result of SPI Flash "READ IDENTIFICATION" command.
Scroll Title |
---|
title | "READ IDENTIFICATION" result layout |
---|
|
Byte | Description |
---|
1 | Manufacturer ID | 2 | Memory Type | 3 | Memory Capacity |
|
Table 4: "READ IDENTIFICATION" result layout
For Trenz Electronic modules possible values is.
Scroll Title |
---|
|
Flash | Manufacturer ID | Memory Type | Capacity |
---|
M25P32 | 20h - Micron | 20h | 16h | W25Q64FV | EFh - Winbond | 40h | 17h |
|
...
Note |
---|
To get full control on SPI bus firmware disable FPGA power supply before this operation. After each flash command, use "power on" command and "fpga reset" command to run FPGA. |
Example:
> flash id
IDCODE EF4017
W25Q64FV
Anchor |
---|
| __RefHeading__1629_1528585909 |
---|
| __RefHeading__1629_1528585909 |
---|
|
"flash erase" commandThe "flash erase" command execute SPI Flash "Bulk Erase" command. Processing of this command usually require some time. User should wait command to complete before power off module or enter next command. Refer your Flash chip datasheet for maximum required time.
...
To get full control on SPI bus firmware disable FPGA power supply before this operation. After each flash command, use "power on" command and "fpga reset" command to run FPGA. |
Example:
> flash erase
Done
Anchor |
---|
| __RefHeading__1631_1528585909 |
---|
| __RefHeading__1631_1528585909 |
---|
|
"flash unlock" commandThe "flash unlock" command write zero value to status register. This command can be used to clear protection bits. Refer to your Flash chip datasheet for status register layout.
...
To get full control on SPI bus firmware disable FPGA power supply before this operation. After each flash command, use "power on" command and "fpga reset" command to run FPGA. |
Example:
> flash unlock
Done
Anchor |
---|
| __RefHeading__1633_1528585909 |
---|
| __RefHeading__1633_1528585909 |
---|
|
"flash read" commandThe "flash read" command read and print data from SPI Flash. Firmware read 8 bytes of data from current flash address and increment address to 8 after execution.
...
To get full control on SPI bus firmware disable FPGA power supply before this operation. After each flash command, use "power on" command and "fpga reset" command to run FPGA. |
Example:
> flash read
FF FF FF FF FF FF FF FF
>
FF FF FF FF FF FF FF FF
>
AA 99 55 66 30 A1 00 07
>
20 00 31 A1 06 28 31 41
>
3D 00 31 61 89 EE 31 C2
Anchor |
---|
| __RefHeading__1635_1528585909 |
---|
| __RefHeading__1635_1528585909 |
---|
|
"fpga status" commandThe "fpga status" command print FPGA pins information. Information printed in 6 chars sequence {d|D}{i|I}{s|S}{p|P}{|0}{|1}.
Scroll Title |
---|
title | "fpga status" FPGA pins information printed in 6 chars sequence |
---|
|
Char | Value | Description |
---|
1 | d | "Done" pin is 0 | | D | "Done" pin is 1 | 2 | i | "Init" pin is 0 | | I | "Init" pin is 1 | 3 | s | FPGA Power supply disabled | | S | FPGA Power supply enabled | 4 | p | "PROG_B" pin is 0 | | P | "PROG_B" pin is 1 | 5 | - | "Int0" pin is 0 | | 0 | "Int1" pin is 1 | 6 | - | "Int1" pin is 0 | | 1 | "Int1" pin is 1 |
|
Example:
> fpga status
DISP--
Anchor |
---|
| __RefHeading__1637_1528585909 |
---|
| __RefHeading__1637_1528585909 |
---|
|
Anchor |
---|
| __RefNumPara__1117_1528585909 |
---|
| __RefNumPara__1117_1528585909 |
---|
|
"fpga reset" commandThe "fpga reset" command execute FPGA reset sequence by driving FPGA PROG_B pin low and high after some delay. This command also disconnect FX2 microcontroller from SPI bus to allow FPGA boot from SPI Flash.
Example:
> fpga reset
Done
Anchor |
---|
| __RefHeading__1639_1528585909 |
---|
| __RefHeading__1639_1528585909 |
---|
|
"quit" commandThe "quit" command switch firmware to COM mode, which allow communication with FPGA. Use "power on" command and/or "fpga reset" command before this command if needed.
Anchor |
---|
| __RefHeading__1641_1528585909 |
---|
| __RefHeading__1641_1528585909 |
---|
|
EEPROM Write modeOn-board EEPROM chip contain FX2 microcontroller firmware. To update EEPROM content, several steps required:
...
For Windows OS this sequence can be done using "bat" file.
mode.com COM1: PARITY=O BAUD=222222
copy /b new_firmware.iic COM1:
This example write "new_firmware.iic" file content to EEPROM using COM1 port. Refer your OS information for right COM port numberWindows can work incorrectly with high port numbers. Change COM port number to COM1-COM4 if you face this problem..
Anchor |
---|
| __RefHeading__6341_408510174 |
---|
| __RefHeading__6341_408510174 |
---|
|
Flash Write modeOn-board Flash chip contain FPGA bitstream. To update Flash content, several steps required:
...
For Windows OS this sequence can be done using "bat" file.
mode.com COM1: PARITY=E BAUD=333333
copy /b new_project.bin COM1:
This example write "new_project.bin" file content to Flash using COM1 port. Refer your OS information for right COM port numberWindows can work incorrectly with high port numbers. Change COM port number to COM1-COM4 if you face this problem..
Firmware automatically provide sector erase before write data.
Image Removed Figure 2:
Scroll Title |
---|
title | Bitgen option for binary file generation. |
---|
|
Image Added |
To generate bitsream file in binary format use "-g Binary:yes" bitgen option. In Xilinx ISE it can be done by checking "Generate Programming File" → "Process properties" → "Create Binary Configuration File". In Xilinx XPS this option should be added to etc/bitgen.ut file.