Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

more reliable with sector retry, ulx3s boad, other small improvements #16

Closed
wants to merge 90 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
9b71b91
improved reliability using sector erase,write,verify retry
emard Jul 28, 2018
6798b2a
--no-boot option
emard Jul 28, 2018
6f02602
delete last "," before ")" to fix verilog syntax error
emard Jul 28, 2018
c623c0d
reset input resets LED fade state, making reset visible
emard Jul 28, 2018
ac2741b
ulx3s board support
emard Jul 28, 2018
934d3f1
initial WIP for future HID/vendorspecific transfer
emard Jul 29, 2018
fcaadee
ulx3s board support for future HID
emard Jul 29, 2018
35533d3
DATA_OUT accepted and shown on debug LED
emard Jul 29, 2018
75bc3c3
simplified vendor-specific descriptor
emard Jul 29, 2018
bf31241
increase packet size to 64, which is max for endpoint0
emard Jul 29, 2018
32506fa
descriptor: increase endpoint 0 max packet size and cleanup
emard Jul 29, 2018
73933b9
rename hid to asp (usbasp)
emard Jul 29, 2018
9df3a11
remove usbserial from usbasp project
emard Jul 29, 2018
ec3713f
return max endpoint size to 32 bytes, looks like max that works
emard Jul 29, 2018
6757d15
reading works (vendorspec DATA_IN)
emard Jul 29, 2018
8789907
cleanup
emard Jul 29, 2018
e813363
in/out buffering works
emard Jul 29, 2018
3f84bf7
host to device (direction out) buffering works
emard Jul 29, 2018
ff5ccbc
cleanup, simplify
emard Jul 29, 2018
426c8eb
added spi shifting but not yet used
emard Jul 29, 2018
a46cb51
connecting SPI chip
emard Jul 29, 2018
9768e7f
SPI cleanup but it doesn't work (0xff returned)
emard Jul 29, 2018
98b21a5
spi flash started to respond to read command 0x03
emard Jul 29, 2018
b9c8d4e
starts to read correct value, slowed down for blink leds to be visible
emard Jul 29, 2018
ceb2dde
works fast, remoove SPI slowdown
emard Jul 29, 2018
6159aa8
cleanup and spi_continue added
emard Jul 30, 2018
eb66269
continue fix, seems to work
emard Jul 30, 2018
1c06824
small todo
emard Jul 30, 2018
6bca77e
remove nak interface
emard Jul 30, 2018
2271867
debounce and prolong reset, after programming board is normally recog…
emard Jul 30, 2018
ce6c01a
blink debug LED on spi overruns
emard Jul 30, 2018
1f3d48b
cleanup, add state to read SPI status
emard Jul 30, 2018
eeccbfe
todo update
emard Jul 30, 2018
d442907
change to circular spi out buffering, slowed down works
emard Jul 30, 2018
cc3bfd5
circular spi buffering works at full speed
emard Jul 30, 2018
5db407e
debug led counts spi overruns
emard Jul 30, 2018
0889fec
check for IN data stage when reading SPI status
emard Jul 30, 2018
3fc933a
descriptor USB version 2.0 -> 1.10
emard Jul 30, 2018
20ada1a
cleanup from serial code,
emard Jul 30, 2018
4afd870
sample libusb application "usbasp", currently only reads flash
emard Jul 30, 2018
f1d5265
read flash id
emard Jul 30, 2018
a0c8709
sector erase works
emard Jul 31, 2018
3241550
flash write
emard Jul 31, 2018
81c14d0
cleanup
emard Jul 31, 2018
191049b
simple progress bar
emard Jul 31, 2018
ae1eb22
progress bar cleanup and use for flash read to file
emard Jul 31, 2018
522f788
small todo
emard Jul 31, 2018
242c1b8
erase sector size calculation
emard Jul 31, 2018
45967bf
calculate restore begin/end
emard Jul 31, 2018
d968fcd
programming - reading file
emard Jul 31, 2018
a581e57
sector to write assembled, not yet erased, not yet written
emard Jul 31, 2018
8b1bf7a
starting with mapping of sectors
emard Jul 31, 2018
dd702ed
hopfully creating sector map, erase, write or leave as-is
emard Jul 31, 2018
f06e8f2
disable sector erase logic
emard Jul 31, 2018
ead87ca
prepare for sequential file read
emard Jul 31, 2018
904f132
simplify with 4K sectors
emard Aug 1, 2018
5d678fe
erase and write commanded, but verify fail, write seems to not work
emard Aug 1, 2018
fa9098d
write must be split into max 256 bytes, now it works
emard Aug 1, 2018
0d7723f
cleanup (junk code deleted)
emard Aug 1, 2018
dbd0949
cleanup, optional lseek to determine flash file length
emard Aug 1, 2018
e98a19f
enable all warnings - see stuff to be cleaned
emard Aug 1, 2018
0f759a2
clenup, flashed bitstreams work
emard Aug 1, 2018
a11d81b
fixed file redaing with retry logic,
emard Aug 2, 2018
da8c0c2
basic command line options
emard Aug 2, 2018
b708ac7
renamed to tinyfpgasp
emard Aug 3, 2018
57bc2f9
renaming mistake fixed
emard Aug 3, 2018
df99232
cmdline takes device=vid:pid argument
emard Aug 3, 2018
1c1c6a6
tinyfpgasp 85k bitstreams
emard Aug 26, 2018
f2ff47d
tinyfpgasp 45k v1.7patched update (more blinky)
emard Aug 26, 2018
9797753
ulx3s updated
emard Aug 26, 2018
7e30217
ulx3s 25k tinyfpgasp
emard Aug 26, 2018
600b434
ulx3s 25F fix flashing 128-mbit ISSI flash
emard Sep 12, 2018
286966d
ulx3s 25F correct chip name 45F->25F
emard Sep 12, 2018
d9438e9
ulx3s 85f issi is25lp128f flasher with verify (slow)
emard Sep 14, 2018
62730a8
ulx3s 12/25/45/85 flashing with wpn=1 and holdn=1 works
emard Sep 15, 2018
56060d6
ulx3s 12,45: fix is25lp128f xcf files
emard Sep 15, 2018
b72ad4b
ulx3s v2.0 makefiles: ddtcmd opetions to make quad mode multiboot work
emard Sep 23, 2018
f448ec0
ulx3s v2.0 toplevels: exit from bootloader by pulling user_programn low
emard Sep 23, 2018
d68b1d3
ulx3s v2.0 makefiles: removing misplaced -quad 4 option
emard Sep 24, 2018
437edfe
ulx3s v2.0 openocd ft231x support
emard Sep 24, 2018
250ddd9
ulx3s v2.0 openocd related cosmetic update
emard Sep 25, 2018
70d0660
ulx3s v2.0 makefile updates, variable openocd executable
emard Sep 25, 2018
85aea32
ulx3s v2.0 enable openocd progress
emard Sep 25, 2018
d3bd8d4
ulx3s v2.0 openocd programming quiet with progress indicator
emard Sep 25, 2018
1c49c9b
tinyfpgasp.c: comments cleanup
emard Oct 26, 2018
2184050
ulx3s v2.0 85F makefile update
emard Oct 26, 2018
e08c8d8
bootloader btn0 to programn action for 12F and 85F
emard Feb 24, 2019
e2eeafc
universal make for the bootloader un ulx3s
emard Feb 24, 2019
a402c7b
ecpmulti early support
emard Feb 24, 2019
35417cf
ulx3s 12f multiboot example
emard Mar 1, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 75 additions & 0 deletions boards/ulx3s-universal-make/clocks/clk_200M_48M.v
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
/* Verilog netlist generated by SCUBA Diamond (64-bit) 3.7.0.96.1 */
/* Module Version: 5.7 */
/* /mt/lattice/diamond/3.7_x64/ispfpga/bin/lin64/scuba -w -n clk_200M_48M -lang verilog -synth synplify -bus_exp 7 -bb -arch sa5p00 -type pll -fin 200.00 -fclkop 48.00 -fclkop_tol 0.0 -phase_cntl STATIC -fb_mode 1 -fdc /home/guest/src/fpga/usbserial-core/TinyFPGA-Bootloader/boards/ulx3s/clock/clk_200M_48M/clk_200M_48M.fdc */
/* Wed Jul 11 00:10:22 2018 */


`timescale 1 ns / 1 ps
module clk_200M_48M (CLKI, CLKOP, LOCK)/* synthesis NGD_DRC_MASK=1 */;
input wire CLKI;
output wire CLKOP;
output wire LOCK;

wire REFCLK;
wire CLKOP_t;
wire scuba_vhi;
wire scuba_vlo;

VHI scuba_vhi_inst (.Z(scuba_vhi));

VLO scuba_vlo_inst (.Z(scuba_vlo));

defparam PLLInst_0.PLLRST_ENA = "DISABLED" ;
defparam PLLInst_0.INTFB_WAKE = "DISABLED" ;
defparam PLLInst_0.STDBY_ENABLE = "DISABLED" ;
defparam PLLInst_0.DPHASE_SOURCE = "DISABLED" ;
defparam PLLInst_0.CLKOS3_FPHASE = 0 ;
defparam PLLInst_0.CLKOS3_CPHASE = 0 ;
defparam PLLInst_0.CLKOS2_FPHASE = 0 ;
defparam PLLInst_0.CLKOS2_CPHASE = 0 ;
defparam PLLInst_0.CLKOS_FPHASE = 0 ;
defparam PLLInst_0.CLKOS_CPHASE = 0 ;
defparam PLLInst_0.CLKOP_FPHASE = 0 ;
defparam PLLInst_0.CLKOP_CPHASE = 11 ;
defparam PLLInst_0.PLL_LOCK_MODE = 0 ;
defparam PLLInst_0.CLKOS_TRIM_DELAY = 0 ;
defparam PLLInst_0.CLKOS_TRIM_POL = "FALLING" ;
defparam PLLInst_0.CLKOP_TRIM_DELAY = 0 ;
defparam PLLInst_0.CLKOP_TRIM_POL = "FALLING" ;
defparam PLLInst_0.OUTDIVIDER_MUXD = "DIVD" ;
defparam PLLInst_0.CLKOS3_ENABLE = "DISABLED" ;
defparam PLLInst_0.OUTDIVIDER_MUXC = "DIVC" ;
defparam PLLInst_0.CLKOS2_ENABLE = "DISABLED" ;
defparam PLLInst_0.OUTDIVIDER_MUXB = "DIVB" ;
defparam PLLInst_0.CLKOS_ENABLE = "DISABLED" ;
defparam PLLInst_0.OUTDIVIDER_MUXA = "DIVA" ;
defparam PLLInst_0.CLKOP_ENABLE = "ENABLED" ;
defparam PLLInst_0.CLKOS3_DIV = 1 ;
defparam PLLInst_0.CLKOS2_DIV = 1 ;
defparam PLLInst_0.CLKOS_DIV = 1 ;
defparam PLLInst_0.CLKOP_DIV = 12 ;
defparam PLLInst_0.CLKFB_DIV = 6 ;
defparam PLLInst_0.CLKI_DIV = 25 ;
defparam PLLInst_0.FEEDBK_PATH = "CLKOP" ;
EHXPLLL PLLInst_0 (.CLKI(CLKI), .CLKFB(CLKOP_t), .PHASESEL1(scuba_vlo),
.PHASESEL0(scuba_vlo), .PHASEDIR(scuba_vlo), .PHASESTEP(scuba_vlo),
.PHASELOADREG(scuba_vlo), .STDBY(scuba_vlo), .PLLWAKESYNC(scuba_vlo),
.RST(scuba_vlo), .ENCLKOP(scuba_vlo), .ENCLKOS(scuba_vlo), .ENCLKOS2(scuba_vlo),
.ENCLKOS3(scuba_vlo), .CLKOP(CLKOP_t), .CLKOS(), .CLKOS2(), .CLKOS3(),
.LOCK(LOCK), .INTLOCK(), .REFCLK(REFCLK), .CLKINTFB())
/* synthesis FREQUENCY_PIN_CLKOP="48.000000" */
/* synthesis FREQUENCY_PIN_CLKI="200.000000" */
/* synthesis ICP_CURRENT="5" */
/* synthesis LPF_RESISTOR="16" */;

assign CLKOP = CLKOP_t;


// exemplar begin
// exemplar attribute PLLInst_0 FREQUENCY_PIN_CLKOP 48.000000
// exemplar attribute PLLInst_0 FREQUENCY_PIN_CLKI 200.000000
// exemplar attribute PLLInst_0 ICP_CURRENT 5
// exemplar attribute PLLInst_0 LPF_RESISTOR 16
// exemplar end

endmodule
75 changes: 75 additions & 0 deletions boards/ulx3s-universal-make/clocks/clk_25M_200M.v
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
/* Verilog netlist generated by SCUBA Diamond (64-bit) 3.7.0.96.1 */
/* Module Version: 5.7 */
/* /mt/lattice/diamond/3.7_x64/ispfpga/bin/lin64/scuba -w -n clk_25M_200M -lang verilog -synth synplify -bus_exp 7 -bb -arch sa5p00 -type pll -fin 25.00 -fclkop 200.00 -fclkop_tol 0.0 -phase_cntl STATIC -fb_mode 1 -fdc /home/guest/src/fpga/usbserial-core/TinyFPGA-Bootloader/boards/ulx3s/clock/clk_25M_200M/clk_25M_200M.fdc */
/* Wed Jul 11 00:09:44 2018 */


`timescale 1 ns / 1 ps
module clk_25M_200M (CLKI, CLKOP)/* synthesis NGD_DRC_MASK=1 */;
input wire CLKI;
output wire CLKOP;

wire REFCLK;
wire LOCK;
wire CLKOP_t;
wire scuba_vhi;
wire scuba_vlo;

VHI scuba_vhi_inst (.Z(scuba_vhi));

VLO scuba_vlo_inst (.Z(scuba_vlo));

defparam PLLInst_0.PLLRST_ENA = "DISABLED" ;
defparam PLLInst_0.INTFB_WAKE = "DISABLED" ;
defparam PLLInst_0.STDBY_ENABLE = "DISABLED" ;
defparam PLLInst_0.DPHASE_SOURCE = "DISABLED" ;
defparam PLLInst_0.CLKOS3_FPHASE = 0 ;
defparam PLLInst_0.CLKOS3_CPHASE = 0 ;
defparam PLLInst_0.CLKOS2_FPHASE = 0 ;
defparam PLLInst_0.CLKOS2_CPHASE = 0 ;
defparam PLLInst_0.CLKOS_FPHASE = 0 ;
defparam PLLInst_0.CLKOS_CPHASE = 0 ;
defparam PLLInst_0.CLKOP_FPHASE = 0 ;
defparam PLLInst_0.CLKOP_CPHASE = 2 ;
defparam PLLInst_0.PLL_LOCK_MODE = 0 ;
defparam PLLInst_0.CLKOS_TRIM_DELAY = 0 ;
defparam PLLInst_0.CLKOS_TRIM_POL = "FALLING" ;
defparam PLLInst_0.CLKOP_TRIM_DELAY = 0 ;
defparam PLLInst_0.CLKOP_TRIM_POL = "FALLING" ;
defparam PLLInst_0.OUTDIVIDER_MUXD = "DIVD" ;
defparam PLLInst_0.CLKOS3_ENABLE = "DISABLED" ;
defparam PLLInst_0.OUTDIVIDER_MUXC = "DIVC" ;
defparam PLLInst_0.CLKOS2_ENABLE = "DISABLED" ;
defparam PLLInst_0.OUTDIVIDER_MUXB = "DIVB" ;
defparam PLLInst_0.CLKOS_ENABLE = "DISABLED" ;
defparam PLLInst_0.OUTDIVIDER_MUXA = "DIVA" ;
defparam PLLInst_0.CLKOP_ENABLE = "ENABLED" ;
defparam PLLInst_0.CLKOS3_DIV = 1 ;
defparam PLLInst_0.CLKOS2_DIV = 1 ;
defparam PLLInst_0.CLKOS_DIV = 1 ;
defparam PLLInst_0.CLKOP_DIV = 3 ;
defparam PLLInst_0.CLKFB_DIV = 8 ;
defparam PLLInst_0.CLKI_DIV = 1 ;
defparam PLLInst_0.FEEDBK_PATH = "CLKOP" ;
EHXPLLL PLLInst_0 (.CLKI(CLKI), .CLKFB(CLKOP_t), .PHASESEL1(scuba_vlo),
.PHASESEL0(scuba_vlo), .PHASEDIR(scuba_vlo), .PHASESTEP(scuba_vlo),
.PHASELOADREG(scuba_vlo), .STDBY(scuba_vlo), .PLLWAKESYNC(scuba_vlo),
.RST(scuba_vlo), .ENCLKOP(scuba_vlo), .ENCLKOS(scuba_vlo), .ENCLKOS2(scuba_vlo),
.ENCLKOS3(scuba_vlo), .CLKOP(CLKOP_t), .CLKOS(), .CLKOS2(), .CLKOS3(),
.LOCK(LOCK), .INTLOCK(), .REFCLK(REFCLK), .CLKINTFB())
/* synthesis FREQUENCY_PIN_CLKOP="200.000000" */
/* synthesis FREQUENCY_PIN_CLKI="25.000000" */
/* synthesis ICP_CURRENT="5" */
/* synthesis LPF_RESISTOR="16" */;

assign CLKOP = CLKOP_t;


// exemplar begin
// exemplar attribute PLLInst_0 FREQUENCY_PIN_CLKOP 200.000000
// exemplar attribute PLLInst_0 FREQUENCY_PIN_CLKI 25.000000
// exemplar attribute PLLInst_0 ICP_CURRENT 5
// exemplar attribute PLLInst_0 LPF_RESISTOR 16
// exemplar end

endmodule
Loading