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

Add writable SPI flash and XMODEM xfer support #370

Open
wants to merge 33 commits into
base: master
Choose a base branch
from

Conversation

cr1901
Copy link
Contributor

@cr1901 cr1901 commented Oct 31, 2017

This pull request re-enables SPI flash write support and adds support to the firmware to transfer a firmware image using the XMODEM protocol.

To use the feature, at the H2U prompt, type:

write spi xmodem [address] [image-len] [crc]

The XMODEM functionality is provided by libmodem, a known-to-work full implementation of XMODEM (and possibly other serial protocols) designed to run anywhere a C89 compiler is present. Building libmodem as a submodule has been integrated into the Makefile, and requires meson to compile. I hope to be able to add more targets for libmodem with HDMI2USB to facilitate code reuse.

I have included a small Python script called getcrc32.py to calculate the crc and length for you, which can either be used in a script or copy/pasted to the H2U prompt. I have also created a small shell script to automate firmware upload, provided you know the flash address. In theory, the entire flash, including bitstream, BIOS, and firmware could be rewritten from the H2U prompt, but I have not tested this (and would need to extend the buffer size from 128kB to accommodate this).

I have confirmed that loading a firmware image works on both the Mimasv2 and Opsis boards. I have not currently had luck getting firmware upload to work on qemu-litex, but I can add it as a patch. Other than that, please let me know any changes you'd like me to make and we can discuss on IRC.

cr1901 and others added 25 commits December 12, 2017 10:34
@cr1901 cr1901 force-pushed the xfer-fw branch 2 times, most recently from da0d616 to 5495ae8 Compare December 14, 2017 15:05
@cr1901 cr1901 force-pushed the xfer-fw branch 3 times, most recently from 65d1c0d to f551cbd Compare December 14, 2017 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant