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

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

Open
drtrigon opened this issue May 7, 2019 · 4 comments

Comments

@drtrigon
Copy link

drtrigon commented May 7, 2019

Thanks to YosysHQ/picorv32#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 YosysHQ/picorv32#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 f32c/arduino#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 drtrigon changed the title Firmware update/upload via Arduino IDE (e.g. for picorv32) Feature request: Firmware update/upload via Arduino IDE (e.g. for picorv32) May 9, 2019
@drtrigon
Copy link
Author

drtrigon commented Jun 6, 2019

Latest commit: drtrigon/fpgarduino-icestorm@09d6520

What does work now:

  • Verify (building)
  • Upload
  • Serial Monitor using any baudrate, default is 115200 (needs setting the correct port)
  • Arduino IDE examples:
    • 01.Basics
      • BareMinimum: compiles
      • Blink: pinMode dummy for leds, digitalWrite on leds also using full 8-bit uint8_t, delay
      • DigitalReadSerial: Serial.println, Serial.begin all baudrates, pinMode (0-7), digitalRead (0-15)
      • AnalogReadSerial: analogRead (A0, 4Hz, bits increased from 8 to 10 by multiplying with 4)
      • ReadAnalogVoltage: (voltage calculation wrong 5.0->3.3)
      • (TODO: Fade - needs PWM)
    • 02.Digital
      • BlinkWithoutDelay: millis, micros, (delay refactored to use micros)
      • Button: (works after changing ledPin 13->LED_BUILTIN)
      • Debounce: (works after changing ledPin 13->LED_BUILTIN)
      • StateChangeDetection: (works after changing ledPin 13->LED_BUILTIN)
    • 03.Analog
      • AnalogInput: (works after changing ledPin 13->LED_BUILTIN)

@Obijuan
Copy link
Member

Obijuan commented Jun 7, 2019

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

@drtrigon
Copy link
Author

drtrigon commented Jun 9, 2019

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

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

@drtrigon
Copy link
Author

drtrigon commented Aug 7, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants