Page 1 of 1

opencore I2C problem

Posted: Sun Sep 29, 2013 7:26 am
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?

Re: opencore I2C problem

Posted: Sun Sep 29, 2013 11:58 am
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.

Re: opencore I2C problem

Posted: Mon Sep 30, 2013 1:17 am
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.

Re: opencore I2C problem

Posted: Mon Sep 30, 2013 1:27 am
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.

Re: opencore I2C problem

Posted: Mon Sep 30, 2013 3:20 pm
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.

Re: opencore I2C problem

Posted: Sun Oct 06, 2013 10:56 am
by jeffie
I gave up trying with 13sp1. I downloaded 12sp1 and it worked fine.

Re: opencore I2C problem

Posted: Sun Oct 06, 2013 2:48 pm
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.