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

"Load the bitstream on the FPGA" example in README is wrong #8

Open
mcclure opened this issue Aug 8, 2023 · 0 comments
Open

"Load the bitstream on the FPGA" example in README is wrong #8

mcclure opened this issue Aug 8, 2023 · 0 comments

Comments

@mcclure
Copy link

mcclure commented Aug 8, 2023

Hello, I am getting into FPGA programming and have pulled out my old Doppler to test my builds.

Once I had a binary, I tried uploading it using the sample code in this repository's README:

  #include <ICEClass.h>
  #include "[PATHTO]/top.bin.h" // set up the path to doppler_simple_io or custom firmware
  ICEClass ice40;   // subclass ICEClass to implement custom spi protocol
   
  void setup() {
    ice40.upload(top_bin,sizeof(top_bin)); // Upload BitStream Firmware to FPGA -> see variant.h
    ice40.upload(); // Upload BitStream Firmware to FPGA -> see variant.h
    ice40.initSPI();  // start SPI runtime Link to FPGA
  }
  
  void loop() {
     
    static uint16_t x = 0;
    ice40.sendSPI16(x++);   delay(50);
  }

It did not work. After some experimentation, I found the problem was

    ice40.upload(top_bin,sizeof(top_bin)); // Upload BitStream Firmware to FPGA -> see variant.h
    ice40.upload(); // Upload BitStream Firmware to FPGA -> see variant.h

If I remove the ice40.upload();, this code works. But with the ice40.upload();, it does not. What I believe is happening is that .upload(top_bin, sizeof(top_bin)) uploads the "top" array, whereas .upload with no arguments uploads some sort of default (possibly the SPI LED command program). It seems the .upload() should be removed from the example.

In addition, it would be helpful at this point to link to the ICEClass / ice40 documentation, or to whatever repo contains the classes so we can read whatever code or documentation is there. Because I am using the Arduino SDK gui app I do not understand where the header files I am loading during a compile are located.

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

No branches or pull requests

1 participant