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

NX family tweaks #15

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
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
11 changes: 9 additions & 2 deletions ecpprog/ecpprog.c
Original file line number Diff line number Diff line change
Expand Up @@ -1121,7 +1121,9 @@ int main(int argc, char **argv)
// Reset
// ---------------------------------------------------------
fprintf(stderr, "reset..\n");

if(connected_device.type == TYPE_NX){
ecp_jtag_cmd(LSC_REFRESH);
}
ecp_jtag_cmd8(ISC_ENABLE, 0);
ecp_jtag_cmd8(ISC_ERASE, 0);
ecp_jtag_cmd8(LSC_RESET_CRC, 0);
Expand Down Expand Up @@ -1163,7 +1165,9 @@ int main(int argc, char **argv)
fprintf(stderr, "reset..\n");
/* Reset ECP5 to release SPI interface */
ecp_jtag_cmd8(ISC_ENABLE, 0);
usleep(10000);
ecp_jtag_cmd8(ISC_ERASE, 0);
usleep(10000);
ecp_jtag_cmd8(ISC_DISABLE, 0);

/* Put device into SPI bypass mode */
Expand Down Expand Up @@ -1291,8 +1295,11 @@ int main(int argc, char **argv)
}

if (reinitialize) {
fprintf(stderr, "rebooting ECP5...\n");
fprintf(stderr, "rebooting FPGA...\n");
ecp_jtag_cmd(LSC_REFRESH);
if(connected_device.type == TYPE_NX){
ecp_jtag_cmd(ISC_NOOP);
}
}

if (f != NULL && f != stdin && f != stdout)
Expand Down