Chronobox: Difference between revisions
Line 18: | Line 18: | ||
-rwxr-xr-x 1 olchansk users 47256 Aug 16 15:26 srunner_cb.exe | -rwxr-xr-x 1 olchansk users 47256 Aug 16 15:26 srunner_cb.exe | ||
-rwxr-xr-x 1 olchansk users 20732 Aug 16 15:26 test_cb.exe | -rwxr-xr-x 1 olchansk users 20732 Aug 16 15:26 test_cb.exe | ||
</pre> | |||
= Install chronobox quartus firmware project = | |||
<pre> | |||
cd online/git | |||
git clone https://bitbucket.org/teamalphag/chronobox_firmware.git | |||
cd chronobox_firmware | |||
cat timestamp.v | |||
ls -l output_files/*.jic | |||
</pre> | </pre> | ||
Revision as of 23:46, 31 August 2018
Chronobox
Links
- https://daq.triumf.ca/DaqWiki/index.php/DE10-Nano
- https://bitbucket.org/teamalphag/chronobox_firmware
- https://bitbucket.org/teamalphag/chronobox_software
Install chronobox software
git clone https://bitbucket.org/teamalphag/chronobox_software.git cd chronobox_software make clean make ls -l *.exe -rwxr-xr-x 1 olchansk users 18808 Aug 16 15:26 reboot_cb.exe -rwxr-xr-x 1 olchansk users 47256 Aug 16 15:26 srunner_cb.exe -rwxr-xr-x 1 olchansk users 20732 Aug 16 15:26 test_cb.exe
Install chronobox quartus firmware project
cd online/git git clone https://bitbucket.org/teamalphag/chronobox_firmware.git cd chronobox_firmware cat timestamp.v ls -l output_files/*.jic
Firmware update
If FPGA is not running compatible firmware srunner_cb will not work. To proceed, load the correct SOF file via JTAG (https://daq.triumf.ca/DaqWiki/index.php/DE10-Nano#JTAG_load_sof_file), then srunner_cb should work and will be able to load the jic or rpd file into the FPGA boot flash memory.
Different revisions of the DE10-Nano board have different FPGA boot flash chips, some have EPCQ128 (use the "-128" option), some have the EPCQ64 chip (use the "-64" option). Use "srunner_cb -id" per example below to identify which flash chip is present on each specific chronobox. Note that the DE10-Nano documentation and the firmware quartus project generally refer to the EPCS64/EPCQ64 chip. The only practical difference is the use of "-128" or "-64" srunner_cb options.
./srunner_cb.exe -id -64 /dev/null # identify EPCS64 flash ./srunner_cb.exe -id -128 /dev/null # identify EPCQ128 flash ./srunner_cb.exe -read -128 test.rpd # read flash contents into a file ./srunner_cb.exe -program -128 /home/olchansk/git/chronobox_firmware/output_files/DE10_NANO_SoC_GHRD_auto.rpd # write firmware rpd file into flash ./reboot_cb.exe # reboot the fpga into the new firmware
Chronobox firmware registers
reg | rw/ro | quartus name | firmware | description 0 | ro | sof_revision_in | all | firmware revision timestamp code 0 | wo | latch_scalers_out, zero_scalers_out | all | write bit 0: latch_scalers, bit 1: zero scalers 1 | rw | reg1_led_out | all | DE10-Nano LED output 2 | ro | switches_in | all | read DE10-Nano switches 3 | ro | buttons_in | all | read DE10-Nano buttons 4 | rw | reg4_test | all | 32-bit read-write test register 5 | rw | flash_programmer_in, reg5_flash_programmer_out | 0x5b6de806 | 0xABCD srunner flash programmer 6 | ro | ecl_in | all | read state of ECL inputs 7 | ro | reg7_test_in | all | ??? 8 | rw | scaler_addr_out, reg8_scaler_data_in | all | top 16 bits of address becomes scaler bus address, 32 bit read is the corresponding scaler data 9 | ro | lemo_in | all | read state of LEMO inputs A | ro | gpio_in | all | read state of GPIO inputs B | rw | regB_lemo_out | all | LEMO output data C | rw | regC_gpio_out | all | GPIO output data D | rw | regD_out_enable_out | all | enable output tristates: [31:24] - LEMO_OUT, [17:0] - GPIO_OUT E | rw | regE, reconfig_out | 0x5b6de806 | FPGA reboot: write inverted firmware revision (reg0) to reboot the FPGA
test_cb.exe
test_cb.exe is the general test program for the chronobox.
- test_cb.exe 0 # read chronobox register 0
- test_cb.exe 4 0x1234 # write to chronobox register 4
- test_cb.exe reboot # reboot the FPGA (the ARM CPU keeps running)
- test_cb.exe scalers # read all scalers in a loop