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

[sw] bootloader: send wake up command to flash before trying to speak with it #552

Merged
merged 5 commits into from Mar 17, 2023

Conversation

agamez
Copy link
Contributor

@agamez agamez commented Mar 16, 2023

The ice40 family of FPGAs, send a sleep command to the flash once it's finished with self-programming in order to save some power [1], unless instructed not to when generating the bitfile (icepack -s or equivalent setting on Radiant)

We don't want the bootloader to depend on the bitfile generation settings and thus we wake up the flash, but since we want a bootloader as small as possible, we don't care to put it back to sleep again (because we don't even know if it was sleeping or not) and let the user application decide what to do with it.

[1] https://www.latticesemi.com/~/media/LatticeSemi/Documents/ApplicationNotes/IK/FPGA-TN-02001-30-iCE40-Programming-Configuration.pdf?document_id=46502 , page 20

… with it

The ice40 family of FPGAs, send a sleep command to the flash once it's
finished with self-programming in order to save some power [1], unless
instructed not to when generating the bitfile (icepack -s or equivalent
setting on Radiant)

We don't want the bootloader to depend on the bitfile generation settings
and thus we wake up the flash, but since we want a bootloader as small as possible,
we don't care to put it back to sleep again (because we don't even know if it was
sleeping or not) and let the user application decide what to do with it.

[1] https://www.latticesemi.com/~/media/LatticeSemi/Documents/ApplicationNotes/IK/FPGA-TN-02001-30-iCE40-Programming-Configuration.pdf?document_id=46502 , page 20
@stnolting
Copy link
Owner

Looks good so far!

I could not find some reliable information regarding the wake-up command... Do we need to send some zero bytes after that? What happens if the SPI flash does not support the wake-up command? Does it just ignore the command?

@stnolting stnolting added the SW software-related label Mar 16, 2023
@stnolting stnolting added the enhancement New feature or request label Mar 16, 2023
@stnolting
Copy link
Owner

I just updated the bootloader's documentation section and I rebuild the bootloader image. If this is fine for you we can merge this!

@agamez
Copy link
Contributor Author

agamez commented Mar 17, 2023

Oh, I had forgotten about the documentation! And it's ironic because one of the reasons I decided to dive into neorv32 is the fantastic documentation. I really do have a lot to learn from you and this project.

Everything looks fine for me too!

@stnolting stnolting merged commit 7a267a1 into stnolting:main Mar 17, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request SW software-related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants