-
Notifications
You must be signed in to change notification settings - Fork 133
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
How to integrate a new programmer #214
Comments
Hi. Here you have a little document regarding new boards support: https://apiodoc.readthedocs.io/en/stable/source/contribute/support_new_board.html. The integration of the programmer depends on the type of programmer:
Sometimes the same programmer (for example iceprog) is used in different boards. In your case (icesugar) seems to work with iceprog programmer too, and the FPGA is already included in the fpgas.json file. So it only requires adding the board in the boards.json file. |
Thank you for your complete answer! I don't think iCESugar supports iceprog. It has a tool called icesprog but no source or windows binary has been released so far. The other upload method it to copy the bin to a virtual flash drive. It's quite fast but I don't know how to write with an specified offset (for risc-v firmwares). I'm thinking about using an external SPI programmer. I'm already using an external USB-UART... But for just uploading one single bin to default offset (0?) the copy method works great. Again, thank you for your time. |
The author just released icesprog source. I'll try to make a windows build with mingw and then create a toolchain. |
You're right. icesprog != iceprog Glad to see a new toolchain coming 😄 |
The author published (by request) icesprog source and I got to build it for windows. I guess a new toolchain is coming 😊 |
I have a lot of problems getting this to work. The installer binary lands at: And apio doesn't look for it there:
How can I reference that path from Programmer package is here https://github.com/aalku/apio-toolchain-iCESugar. Edit: I'm starting with windows_x64. I wish to cover every or most plaforms. Thank you in advance. |
It seems the programmer must be added to path in util.py. I got it working :) I would make a pool request now and then add the other platforms later but maybe you want to process a single poll request with everything instead. |
Great! it is up to you. You can do the pull requests you like. It is not a problem |
Let's continue the integration on this issue. First step: Create the toolchain. Please, provide here the link to the repo of the upstream you want to include, so that we all can check it |
Thank you. This is the repository of the whole board. https://github.com/wuxx/icesugar The programmer software is in src. As you can see there are binaries for different architectures of Linux but there aren't for windows. I asked for the sources and the author published them. They are on tools/src. |
OK. As the upstream does not provide a Release with the tools yet, we have to include the building script in the icesugar apio package. Remember that apio is a package manager, like pip,npm or apt-get. It installs the package that the user wants (The user tells explicitly apio the package to install. It does not install anything without the user consent) Next step: Create the toolchain-icesprog repo. It will contains the binaries for all the supported platforms as well as the scripts for building from the upstreams sourcer or downloading oficial releases if the upstream has already compiled them I will create the repo. Just give me some time. In the meanwhile you can have a look at other apio packages, like https://github.com/FPGAwars/tools-system (We should create something similar. Everything should be statically compiled, so that no external libraries are requiered) |
Hi. Let me tell you my progress. :) I'm copying things from the scripts of that I guess it will be easy to compile icesprog statically with them. The script set downloads I think once I can compile icesprog and build the package tar.gz files with just calling |
Great! I've already created the repo for the apio package: https://github.com/FPGAwars/toolchain-icesprog The build script should be similar to the one created in https://github.com/FPGAwars/toolchain-fujprog but with the adaptations needed |
Nice! I succesfully build the icesprog binary from upstream sources :) for linux_i686 too. But I don't know if this is a problem. I don't use icestudio on Linux. It seems the programmer needs root access. What do you think? Is that a problem? I'll build the gzip packages, fork FPGAwars/toolchain-icesprog repo, upload everything to the fork (no binaries at all), maybe test build from clean ubuntu (18.04) with no previous dependencies installed, and finally pull-request. Please feel free to reject it if I missed any step or you have something else in mind. But @Obijuan, toolchain-fujprog is only packaging preexisting binaries, I am compiling them too. The final result should be the same, a package with the same format, but with different way to get the binaries first. Note: One good thing about icesprog is that it doesn't need drivers to be installed on windows. I think it's that hidapi. I wonder if iceprog could use it too. I have no idea. |
I've got this tag and release with binaries compiled by myself with the included scripts. https://github.com/aalku/toolchain-icesprog/releases/tag/v1.0.0d I'll try them with apio and maybe with icestudio (if I still can build it). Then I will make a branch referencing FPGAwars/toolchain-icesprog in package.json instead my own repository and make pull-request. (No binaries, I understand you will build them???) |
Great! Could you please pull these changes and test them? I've seen that you introduced some workarounds. Try first to compile with the new scripts and when everything is ok, add the workarounds (in compile_icesprog.sh) In this first stage we are focusing on the binaries generation I think that it is great that no drivers are required in windows! I have to see if it is possible to do the same with iceprog. Thanks! |
Great! Thank you! Of course! |
On Ubuntu 20.04 just installed windows_amd64 is not compilng with these scritps.
I took a note here: After running This is the output I don't fully undestand:
and I think there are not compiled objects in |
I did |
The windows_amd64 binary is not working :( The problem's in the upstream code with Windows. Here is where it fails:
This problem is described here for the case of cygwin. Not exactly the same on mingw but it's the same: Windows C library opens the file in text mode so converts what it thinks that are line break codes. Here someone explains that on mingw has a bug with that. I copied this Demyan Kimitsa's code. I think I should've referenced that post in a comment. That fix is needed so mingw uses binary mode by default. |
Pull request made to the toolchain with all these things. If you accept it next step would be adapt apio to it but apio needs binary packages for the toolchain as far as I know so either you build them and publish them or I refrerence mines... |
We will continue this discussion on This issue and on the FPGAwars group (I will open a new thread). I need you to perform some tests, as I do not have an icesugar board |
How can I add a new programmer?
I see commands on "programmers.json" but I don't know where to place the executable (a python script in my case) so apio finds them. I can put it on the system path on my computer but I don't know how it's supossed to be distributed or installed with apio.
I can see Icestudio creates a virtual environment and some programmers are there but it seems wierd to me to have the "programmers.json" in apio and the actual executables in the project that is going to use apio. If I just make pull request of the programmers.json noone in this project can test it if the programmer is not here or referenced.
I'm sure there's something im not getting right. Thank you!
The text was updated successfully, but these errors were encountered: