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

Example spi_hw does not work #6

Open
71GA opened this issue Aug 23, 2021 · 1 comment
Open

Example spi_hw does not work #6

71GA opened this issue Aug 23, 2021 · 1 comment

Comments

@71GA
Copy link

71GA commented Aug 23, 2021

Example spi_hw does not work. When I run C program to send SPI commands to the slave (FPGA), later returns a bunch of 0xFF:

┌───┐
│ $ │ ziga > ziga--workstation > spi_host
└─┬─┘ /dev/pts/2
  └─> ./host
init..
bit inversion read idx 0: 0xff, should be 0xc7
bit inversion read idx 1: 0xff, should be 0x51
bit inversion read idx 2: 0xff, should be 0xc4
bit inversion read idx 3: 0xff, should be 0xb7
LED command answer from fpga: the first byte should be the command (0x4), the second byte should by the LED colour
sent yellow led
received: [0]:ff
received: [1]:ff
received: [2]:ff
received: [3]:ff
received: [4]:ff
sent blue led
received: [0]:ff
received: [1]:ff
received: [2]:ff
received: [3]:ff
received: [4]:ff
sent vector val: 0x1020304
sent vector val: 0x2040608
sent vector val: 0x306090c
sent vector val: 0x4080c10
vector read: 0xff, 0xff, 0xff, 0xff
vector read: 0xff, 0xff, 0xff, 0xff
vector read: 0xff, 0xff, 0xff, 0xff
vector read: 0xff, 0xff, 0xff, 0xff
@damdoy
Copy link
Owner

damdoy commented Aug 24, 2021

Hello,

It will be a bit hard to find what the problem is without more info, but here are a couple of questions/suggestions:
Were you able to synthesize and test with success other examples of the project, something with more direct feedback such as the LEDs?
Were you able to run the soft-SPI (not hardware module) example?
Are the jumpers correctly set on your board (if you are using the breakout board, which those examples are aimed for), in order to communicate with the ice40 directly and not the flash (see https://www.latticesemi.com/view_document?document_id=51987) ?

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

2 participants