FPGAwars / icestudio

:snowflake: Visual editor for open FPGA boards
https://icestudio.io
GNU General Public License v2.0
1.7k stars 245 forks source link

Feature request: Firmware update/upload via Arduino IDE (e.g. for picorv32) #321

Open drtrigon opened 5 years ago

drtrigon commented 5 years ago

Thanks to https://github.com/cliffordwolf/picorv32/issues/92 we have a picorv32 version for icestudio. Now I would like to use the Arduino IDE in order to upload firmware code to the processor (instead of using a Makefile based toolchain). In fact this was already mentioned in https://github.com/cliffordwolf/picorv32/issues/92; "The firmware should be uploaded in the flash memory using iceprog, outside of icestudio. In future versión we will integrate it into icestudio as well".

Furthermore it would also allow to use the Arduino IDE syntax/api and therefore the examples, libraries, etc. already available. Basically a lot of existing code can be adopted and used.

This is very similar to the FPGArduino project (see http://www.nxlab.fer.hr/fpgarduino/) with the subtile difference that it will not use a bootloader but incorporate iceprog directly. (For details on that work see https://github.com/f32c/arduino/issues/32 - caution this thread is really long!)

The current status of this work can be seen in https://github.com/drtrigon/fpgarduino-icestorm (the naming is not appropriate anymore). The Blink example works already. Currently I am working on the digitalRead and Serial (port) examples.

Thus I would like to propose this feature to be integrated into the https://github.com/FPGAwars/icestudio/wiki/Wishlist:-proposed-features (outdated?) respective into the v0.4.0 release. What do you think?

Further References:

Feedback on this is very welcome.

drtrigon commented 5 years ago

Latest commit: https://github.com/drtrigon/fpgarduino-icestorm/commit/09d6520db16b8c602c879129a4065a3a33f698aa

What does work now:

Obijuan commented 5 years ago

That's awesome! Thanks for sharing! I will try to test it as soon as possible. Keep up the good work! :-)

drtrigon commented 5 years ago

The most recent commit now supports a lot more examples as it includes analogWrite (PWM), Serial.read and digitalWrite for all pins now: https://github.com/drtrigon/fpgarduino-icestorm/commit/7a31a42964c6704b8ea3ffce2b8730932badf305

Tried to get configurable pull-ups on the GPIO pins, but I only get a PULLUP with non-constant value.

drtrigon commented 5 years ago

Btw.: What's the state with Lattuino (https://github.com/FPGALibre/fpgacores) regarding icestudio support?