opencore I2C problem

Having issues with the site, hardware, source code, or any other issues?
Post Reply
jeffie
Posts: 4
Joined: Sun Sep 15, 2013 3:21 pm

opencore I2C problem

Post by jeffie »

Hi,

I'm trying to compile the FPGA with Quartus sp13. It seems something has been changed somewhere.

The opencore I2C connection changes from separate I/O lines to bi-directional ports ( in VHDL, not the actual hardware pins ) and Qsys determines it needs more address space than it should ( 16 ). The map given from the repository shows it only needs 8.

Result is that while I have fixed enough to get an image, it doesn't work. It gives a failure reading the si_5338.

Any ideas?
bpadalino
Posts: 303
Joined: Mon Mar 04, 2013 4:53 pm

Re: opencore I2C problem

Post by bpadalino »

What commands are you running from the commandline? What errors does it have? Can you provide a screen shot?

I was able to use the build_bladerf.sh script to build using 13.0sp1, load the FPGA and set/get the si5338 registers.
drelectro
Posts: 8
Joined: Fri Mar 01, 2013 3:03 pm

Re: opencore I2C problem

Post by drelectro »

I tried the same thing and found the same problem.

It appears that there is an older version of oc_i2c_master included in ~/altera/13.0sp1/ip/altera/altera_dp/hw_demo/altera_avalon_i2c

If you open Qsys and right click on 'Communication - OpenCores I2C Master' you'll see 2 different entries for the core, if you hover over 'details' you'll see the location of each version.

It seems that even if you select the newer version included with the bladeRF (with separate I/O pins and enables) Qsys will revert to the one in the altera directory.

To fix this I made a copy of ~/altera/13.0sp1/ip/altera/altera_components.ipx and edited out the definition for the old version of oc_i2c_master.

After doing so I was able to run the build_bladerf.sh to completion.

However like you the resulting image also cannot talk to the si_5338 :(

I'm pretty certain you don't want to let the build use the older oc_i2c_master though.
Last edited by drelectro on Mon Sep 30, 2013 1:35 am, edited 1 time in total.
drelectro
Posts: 8
Joined: Fri Mar 01, 2013 3:03 pm

Re: opencore I2C problem

Post by drelectro »

Ahh, OK so I pulled a new copy of the source and ran

Code: Select all

./build_bladerf.sh -r hosted -s 40
and I now have a fully working fpga image.

I guess there must be some have been some left over intermediate files from when I was futzing around trying to solve the I2C issue.
bpadalino
Posts: 303
Joined: Mon Mar 04, 2013 4:53 pm

Re: opencore I2C problem

Post by bpadalino »

So you're good now?

I highly recommend running:

Code: Select all

nios2_command_shell.sh ./build_bladerf.sh -r hosted -s 40
The nios2_command_shell sets up those environment variables that we were having issues with beforehand, so we can slim down that shell script a bit.

Glad you were able to get it working. This build process leaves a bit to be desired for sure. We will be improving it for sure.
jeffie
Posts: 4
Joined: Sun Sep 15, 2013 3:21 pm

Re: opencore I2C problem

Post by jeffie »

I gave up trying with 13sp1. I downloaded 12sp1 and it worked fine.
bpadalino
Posts: 303
Joined: Mon Mar 04, 2013 4:53 pm

Re: opencore I2C problem

Post by bpadalino »

What's weird is that this past weekend I've been working with 13.0sp1 and it's been nothing but fine.

I wonder what issue you were having.
Post Reply