AnsweredAssumed Answered

[Bug Report] SigimaStudio 3.9 Exported system files in ADAU1772 project contain compilation errors

Question asked by ralcock on Aug 29, 2013
Latest reply on Aug 30, 2013 by ralcock

Description : After exporting system files for an ADAU1772 project into a Visual Studio 2008 project I find that there are hundreds of warnings and errors.

Sigma Studio Version : 3.9. Build 2, Rev 1246. 7/24/2013

OS : Windows 7 (32-bit). Service Pack 1.

Other software : Microsoft Visual Studio 2008 Standard Edition. Version 9.0.21022.8

 

Background information (which is probably irrelevant to the bug report) : I am using the files exported from SigmaStudio to generated an exe on a PC. The PC has USB I2C interface that is connected to custom PCB containing an ADAU1772. I have been able to correct all the errors in the exported files to enable compilation, but after calling default_download_IC_1() to configure the ADAU1772 I find that the chip does not produce any detectable analog or digital output signal. I am powering the chip from a 3V supply (2xAA batteries) and providing a 700mV pk-pk chirp signal to inputs AIN0-AIN3 . I am however able to confirm the correct operation of the following aspects of the ADAU1772 device:

- MICBIAS0 can be enabled and disabled

- I2S bit-clock (MP2) and LRCLK (MP2) toggle correctly. I2S data is zero.

- Speaker outputs HPOUTLN, HPOUTLP, HPOUTRN, HPOUTRP can be enabled/disabled (The DC offset turns on and off).

This minimal functionality leads me to believe that the ADAU1772 is correctly receiving I2C instructions.

 

The compilation errors occur with all ADAU1772 projects that I have created. In all cases I have exported the system files with the name "Params". I have imported the following files into my Visual Studio project:

   Params_IC_1.h

   Params_IC_1_REG.h

   Params_IC_1_PARAM.h

 

There are three categories of error.

 

Error 1: There are undefined constants in file "Params_IC_1.h". The generated function default_download_IC_1() includes the following lines:

 

SIGMA_WRITE_REGISTER_BLOCK( DEVICE_ADDR_IC_1, BANK_A_PARAMETERS_ADDR_IC_1, BANK_A_PARAMETERS_SIZE_IC_1, BANK_A_PARAMETERS_IC_1 );

 

SIGMA_WRITE_REGISTER_BLOCK( DEVICE_ADDR_IC_1, BANK_B_PARAMETERS_ADDR_IC_1, BANK_B_PARAMETERS_SIZE_IC_1, BANK_B_PARAMETERS_IC_1 );

 

None of the definitions that begin with "BANK_" are defined.

A solution to this problem is to add the following code, which defines the constants in terms of auto-generated constants.

#define BANK_A_PARAMETERS_ADDR_IC_1 PARAM_ADDR_IC_1

#define BANK_A_PARAMETERS_SIZE_IC_1 PARAM_SIZE_IC_1

#define BANK_A_PARAMETERS_IC_1 Param_Data_IC_1

#define BANK_B_PARAMETERS_ADDR_IC_1 0x180

#define BANK_B_PARAMETERS_SIZE_IC_1 PARAM_SIZE_IC_1

#define BANK_B_PARAMETERS_IC_1 Param_Data_IC_1

 

 

 

Error 2. The following code sequence in file "Params_IC_1.h" is repeated 79 times, each time producing the same warning/error.

/* DSP Ram Data */

#define ZERO_SIZE_IC_1 4

#define ZERO_ADDR_IC_1 241

ADI_REG_TYPE ZERO_Data_IC_1[ZERO_SIZE_IC_1] = {

0x00, 0x00, 0x00, 0x00,

};

1a ) Each repetition changes the value of  "ZERO_ADDR_IC_1", so causes the warning "warning C4005: 'ZERO_ADDR_IC_1' : macro redefinition".

1b) Each repetition attempts to create a new array called "ZERO_Data_IC_1". This causes the error "error C2374: 'ZERO_Data_IC_1' : redefinition; multiple initialization

A solution to the problem is to comment out all of these definitions. The function default_download_IC_1() doesn't refer to these arrays anyway.

 

Error 3: Four of the single register writes have incorrect size definitions. The code segments from "Params_IC_1.h" that give rise to the errors are included below

/* Register Default - IC 1.PLL_CTRL5 Register */

ADI_REG_TYPE R8_PLL_CTRL5_IC_1_Default[REG_PLL_CTRL5_IC_1_BYTE] = ;

/* Register Default - IC 1.ABSREG0 Register */

ADI_REG_TYPE R18_DBREG0_IC_1_Default[REG_DBREG0_IC_1_BYTE] = ;

/* Register Default - IC 1.ABSREG1 Register */

ADI_REG_TYPE R19_DBREG1_IC_1_Default[REG_DBREG1_IC_1_BYTE] = ;

/* Register Default - IC 1.ABSREG2 Register */

ADI_REG_TYPE R20_DBREG2_IC_1_Default[REG_DBREG2_IC_1_BYTE] = ;

Each of the code segments produces the compilation error "error C2466: cannot allocate an array of constant size 0". The definitions that cause the errors are included from file "Params_IC_1_REG.h". The offending lines are:

#define REG_PLL_CTRL5_IC_1_BYTE                   0

#define REG_DBREG0_IC_1_BYTE                      0

#define REG_DBREG1_IC_1_BYTE                      0

#define REG_DBREG2_IC_1_BYTE                      0

The problem can be resolved by changing the definitions to '1'. (This change was deduced by observing the corresponding to transactions listed in the Capture window of SigmaStudio.)

 

 

 

Best regards,

Robert

Outcomes