Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12590 Discussions

Help me in audio code, please! (about I2C SCL BASE )

Altera_Forum
Honored Contributor II
1,179 Views

Hi all!! 

I applying audio code demo of altera. But when I build project, it had 2 error : 

 

'I2C_SCL_BASE' undeclared (first use in this function) AUDIO.c /audio_de2_115_MTL line 357 C/C++ Problem 

and 

'I2C_SDA_BASE' undeclared (first use in this function) AUDIO.c /audio_de2_115_MTL line 357 C/C++ Problem 

 

I just found define of them is clk base for SCL. and data base for SDA, but I don't understood what are they? and how to use it? 

So, have someone can me me understand it and the way to fix it? Thank you so much!! ( I'm a beginner!!) 

Have a nice day every body!!
0 Kudos
4 Replies
Altera_Forum
Honored Contributor II
251 Views

Apparently the code you are compiling is looking for two peripherals in your system, one called i2c_scl and another one i2c_sda, but they aren't present. You should add them to your SOPC Builder or QSys project. 

From the names I'm guessing they are 1 bit bidirectional PIOs.
0 Kudos
Altera_Forum
Honored Contributor II
251 Views

 

--- Quote Start ---  

Apparently the code you are compiling is looking for two peripherals in your system, one called i2c_scl and another one i2c_sda, but they aren't present. You should add them to your SOPC Builder or QSys project. 

From the names I'm guessing they are 1 bit bidirectional PIOs. 

--- Quote End ---  

 

 

Thanks for your advice,Daixiwen! 

I did review my SOPC, it have enough component for audio. And in define of function I2C_write(); the sample code was define I2C_SCL_BASE is clk_base and I2C_SDA_BASE is data_base. But I don't understand what are the address of clk base and data base? I found it in the internet but it haven't had the info. I need!! (T_T")!  

hix hix, Who have another idea please help me (^_^")!!!???
0 Kudos
Altera_Forum
Honored Contributor II
251 Views

The component you need isn't for audio itself, it is for I2C. If you have a peripheral that is called i2c_scl in your SOPC builder project, then you will have in your BSP a file called system.h that defines I2C_SCL_BASE, among others.

0 Kudos
Altera_Forum
Honored Contributor II
251 Views

Oh!! Thank you so much, Daixiwen (^_^), I review my SOPC again, and recognized something I need into my project!  

Have a nice day!
0 Kudos
Reply