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

Fix lattice bscan nexus in clearSRAM() #399

Merged
merged 3 commits into from
Nov 8, 2023

Conversation

bg-gsl
Copy link
Contributor

@bg-gsl bg-gsl commented Oct 26, 2023

For NEXUS family fpgas, the Bscan register is 362 bits long or 45.25 bytes => 46 bytes.
This error was already corrected in program_mem (to program the sram).

In our case, we were interested in programming the external SPI Flash memory.

Tests have been carried out successfully on Certus-NX Versa, Crosslink-NX Evalualtion, CertusPro-NX Versa and GR740mini.

On CertusPro-NX Evaluation board instead, results were mixed: if the spi flash was not already programmed, then things were going fine. Otherwise, openFPGALoader doesn't manage to read/talk to the SPI Flash memory. We've already had issues with such board when programming the spi flash, so it may be that the sample we have in office is not working well.

For NEXUS family fpgas, the Bscan register is 362 bits long
or 45.25 bytes => 46 bytes.

This error was already correct when programming the sram.
clearSRAM() is instead used when programming the spi flash memory.
memset(tx_buf, 0xff, 26);
wr_rd(0x1C, tx_buf, 26, NULL, 0);

wr_rd(0xFf, NULL, 0, NULL, 0);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This operation isn't required?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

more precisely wr_rdat line 712

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mmhh, I may have deleted it accidentally. I'll check tomorrow (I created an svf file from Radiant) and test it on a board.

Thanks for pointing it out!

Copy link
Contributor Author

@bg-gsl bg-gsl Nov 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tried with and without and I don't see differences in execution. I don't see it in the svf file that I create from Radiant, but who knows. If you prefer to keep it, then it's ok with me :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hej! :)
Just to avoid misunderstandings: is there something I need to do about this pull request?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry: my fault I have missed to answer.
In fact this code is used by all lattice devices so it's maybe more secure to keep/re-add 0xff instruction.

Copy link
Contributor Author

@bg-gsl bg-gsl Nov 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for answering.
I've restored that line :)

@trabucayre trabucayre merged commit 1a86fa2 into trabucayre:master Nov 8, 2023
16 checks passed
@trabucayre
Copy link
Owner

Applied. Thanks @bg-gsl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants