-
Notifications
You must be signed in to change notification settings - Fork 0
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
Document & reproduce getting repl loop working #2
Comments
Documentation would definitely help :-) I feel like I've got fairly close working with Ubuntu 16.04 LTS and trying to target a Mimas v2: built gateware from https://github.com/upy-fpga/upy-fpga-litex-gateware; built modern lm32 cross tools from https://github.com/shenki/lm32-build-scripts; built MicroPython from https://github.com/upy-fpga/micropython lm32-mimasv2 branch. But there seems to be a "magic happens here" step that I'm missing which puts the gateware and MicroPython onto the Mimas v2, and then makes the REPL available. If I do " For reference my fairly detailed notes (to be turned into a blog post sometime) of my steps so far follow. MicroPython on Numato Mimas V2 FPGAPrerequisites
Before you begin it would be a very good idea to check that the Numato Mimas v2 GatewareSetupClone repository, which originated with HDMI2USB (hence the dependencies listed):
Install the relevant bits of the environment in two parts, firstly as root:
which will install dozens of packages as direct or indirect dependencies, including some from Tim's Ubuntu PPA. And then as a non-root user (eg, your own user) for the remaining parts:
which will download a bunch more packages, and execute/install them. Among other things it installs It also automatically The environment install process will take several minutes, mostly depending on the download speed. BuildFrom a terminal which has not entered the Xilinx ISE WebPack environment, set the desired
All going well, it should do some checking, report the directories being used, and then change the prompt to include the
From there, you can build the "gateware" for your selected
which will result in a lot of output, most of it from the Xilinx ISE WebPACK tools. This step will also take a few minutes, and will keep your CPU pretty busy. All going well you should end up Next you can build the "firmware" to run on the softcore CPU to provide MicroPython on the FPGA. You can build this for your selected
This step appears to use a pre-compiled firmware file, and builds quite quickly. It should result in a InstallEnsure that the Numato Mimas v2 "operation mode" switch ( Install the gateware with:
Because the upload happens at 19200 bps, this will take a couple of minutes to complete -- it does an erase cycle, a write cycle, and a read-back verification cycle. The process looks something like:
Modern build environmentBuilding MicroPython needs a fairly recent crosscompiler build environment, newer than the one used by the MicroPython gateware. This step is best done in a terminal which does not have the gateware configuration (above) in it, so start a fresh terminal. To build this newer crosscompiler environment clone the
Then build the cross compilers on your system with:
It will download several key Linux build tools ( This step will take several minutes, particularly to download the required source to build. Expect your CPU to be very busy for a while as it does a Assuming that it finishes without obvious error, and the return code is 0:
then we can assume that it worked. The build directory should include a lot of built code (approximately 2GB). The built code can then be installed somewhere central with:
which will also generate a lot of output, but run much quicker. After this
MicroPythonMicroPython is best built in a new terminal, without the gateware environment variables. It needs to be built from an in-development repository with changes for MicroPython on FPGA and the Mimas v2. In a fresh terminal, clone the forked MicroPython repository, with Mimas V2 support in it:
Enter the repository, and checkout the
Change into the lm32 directory, and build with a cross compiler:
That should build fairly quickly, and result in a
Installing MicroPython on the Numato Mimas v2NOTE: this does not appear to actually work :-( To actually install MicroPython, it appears that we have to build a complete flash image, by hand, containing the base processor gateware, the BIOS, and the MicroPython image. (There is a Return to the gateware build top directory, with the environment set up, ie as before (possibly you still have a suitable terminal open):
Make a directory to build up the MicroPython flash image:
And then copy over the MicroPython
Run:
to build a Change back up to the top directory, and then use
This should build a new flash image in Then this custom flash image can be loaded onto the Numato Mimas v2, by ensuring that the "operation mode" switch ( Once
to program MicroPython onto the Mimas v2. This will take a few minutes to write, as it is uploading at 19200 bps. The result should look something like:
a-litex-gateware$ Unfortunately this does not result in a working system :-( See comments at top |
@ewen-naos-nz Hi! You should join us on #upy-fpga on Freenode. We have actually been hacking on stuff related to the MimasV2 yesterday and today! |
So there are a couple of options to get micropython onto the MimasV2 instead of the H2U firmware. (1) Load via serialUse This will load micropython via the serial terminal. (2) Actually flash micropythonCreate a micropython.fbi using (3) Flash without firmware and then load via serialUse mkimage.py with BTW flterm doesn't like micropython for some reason (line endings I think?). So you'll have to disconnect from the serial port and use something like screen or minicom |
After some assistance from @mithro on #upy-fpga on FreeNode, plus a couple of patches he added, I've been able to get to the REPL on the Numato Mimas v2. Blog post with my notes on how I did it (an expanded version of the text above): http://ewen.mcneill.gen.nz/blog/entry/2017-03-12-micropython-on-numato-mimas-v2/ Ewen |
@shenki has had the repl loop working in QEmu.
@mithro has had the repl loop working on Opsis hardware.
@Kathatosada got repl loop working on the MimasV2 at Linux.conf.au
The text was updated successfully, but these errors were encountered: