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++
公告
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

adc alt_sys_init.c build error

SeanAB
新分销商 I
1,969 次查看

Quartus 21.1

MAX 10 10M08

Created an NIOS II with ADC, PLL, JTAG UART, TIMER. design builds fine in Quartus.

Creating an application in Eclipse with the hello_world_small template. Build the project and I am getting errors in alt_sys_inti.c that I cannot figure out how to fix:

 

-----------------------------------------------------------------------------------------------------

in file included from alt_sys_init.c:65:
alt_sys_init.c:75:31: error: 'MODULAR_ADC0_NAME' undeclared here (not in a function)
75 | ALTERA_MODULAR_ADC_INSTANCE ( MODULAR_ADC0, modular_adc0);
| ^~~~~~~~~~~~
./drivers/inc/altera_modular_adc.h:97:5: note: in definition of macro 'ALTERA_MODULAR_ADC_INSTANCE'
97 | name##_NAME, \
| ^~~~
alt_sys_init.c:75:31: error: 'MODULAR_ADC0_DUAL_ADC_MODE' undeclared here (not in a function); did you mean 'MODULAR_ADC0_SEQUENCER_CSR_DUAL_ADC_MODE'?
75 | ALTERA_MODULAR_ADC_INSTANCE ( MODULAR_ADC0, modular_adc0);
| ^~~~~~~~~~~~
./drivers/inc/altera_modular_adc.h:110:4: note: in definition of macro 'ALTERA_MODULAR_ADC_INSTANCE'
110 | name##_DUAL_ADC_MODE \
| ^~~~
alt_sys_init.c: In function 'alt_sys_init':
alt_sys_init.c:101:31: error: 'MODULAR_ADC0_IRQ_INTERRUPT_CONTROLLER_ID' undeclared (first use in this function); did you mean 'PLLFORADC0_IRQ_INTERRUPT_CONTROLLER_ID'?
101 | ALTERA_MODULAR_ADC_INIT ( MODULAR_ADC0, modular_adc0);
| ^~~~~~~~~~~~
./drivers/inc/altera_modular_adc.h:119:32: note: in definition of macro 'ALTERA_MODULAR_ADC_INIT'
119 | altera_modular_adc_init(&dev, name##_IRQ_INTERRUPT_CONTROLLER_ID, name##_IRQ);
| ^~~~
alt_sys_init.c:101:31: note: each undeclared identifier is reported only once for each function it appears in
101 | ALTERA_MODULAR_ADC_INIT ( MODULAR_ADC0, modular_adc0);
| ^~~~~~~~~~~~
./drivers/inc/altera_modular_adc.h:119:32: note: in definition of macro 'ALTERA_MODULAR_ADC_INIT'
119 | altera_modular_adc_init(&dev, name##_IRQ_INTERRUPT_CONTROLLER_ID, name##_IRQ);
| ^~~~
alt_sys_init.c:101:31: error: 'MODULAR_ADC0_IRQ' undeclared (first use in this function)
101 | ALTERA_MODULAR_ADC_INIT ( MODULAR_ADC0, modular_adc0);
| ^~~~~~~~~~~~
./drivers/inc/altera_modular_adc.h:119:68: note: in definition of macro 'ALTERA_MODULAR_ADC_INIT'
119 | altera_modular_adc_init(&dev, name##_IRQ_INTERRUPT_CONTROLLER_ID, name##_IRQ);
| ^~~~
Makefile:583: recipe for target 'obj/alt_sys_init.o' failed
make: *** [obj/alt_sys_init.o] Error 1

------------------------------------------------------------------------------------------------------

Was there a step I could have missed Platform Builder?

 

 

0 项奖励
1 解答
hareesh
员工
1,788 次查看

Hi @SeanAB ,

it's a software bug, I will raise ticket about this issue. if i get any alternate solution i will forward to you.

 

if you don't have any quires I'll close the case. please confirm 

 

 If any answer from the community or Intel Support are helpful, please feel free to give best answer or rate 9/10 survey.

 

Thanks,

在原帖中查看解决方案

0 项奖励
7 回复数
hareesh
员工
1,946 次查看

Hi SeanAB,

I tried duplicating the issue but its not reproducible in our system. What is the Quartus edition you are using. Also Can you please share platform design and SOPC information file.


Kind regards,



0 项奖励
SeanAB
新分销商 I
1,934 次查看

Quartus Prime Lite Ver 21.1.0 Build 842 10/21/21 - Windows 10 Host system

Eclipse Mars.2 rel 4.5.2

 

After spending a few more hours digging into the code, it appears the project wizard doesn't set up everything correctly.  Two corrections need to be made to get the application to build.

1. altera_modular_adc.h contains the following, form lines 92 to lines 120:

 

#define ALTERA_MODULAR_ADC_INSTANCE(name, dev) \
static alt_modular_adc_dev dev = \
{ \
{ \
ALT_LLIST_ENTRY, \
name##_NAME, \
NULL, \
NULL, \
NULL, \
NULL, \
NULL, \
NULL, \
NULL, \
}, \
NULL, \
NULL, \
0, \
0, \
name##_DUAL_ADC_MODE \
}


/*
* The macro ALTERA_MODULAR_ADC_INIT is called by the auto-generated function
* alt_sys_init() to initialize a given device instance.
*/
#define ALTERA_MODULAR_ADC_INIT(name, dev) \
altera_modular_adc_init(&dev, name##_IRQ_INTERRUPT_CONTROLLER_ID, name##_IRQ);

 

After going through system.h, I modified this file to add the correct constant names.

#define ALTERA_MODULAR_ADC_INSTANCE(name, dev) \
static alt_modular_adc_dev dev = \
{ \
{ \
ALT_LLIST_ENTRY, \
name##_SEQUENCER_CSR_NAME, \
NULL, \
NULL, \
NULL, \
NULL, \
NULL, \
NULL, \
NULL, \
}, \
NULL, \
NULL, \
0, \
0, \
name##_SEQUENCER_CSR_DUAL_ADC_MODE \
}


/*
* The macro ALTERA_MODULAR_ADC_INIT is called by the auto-generated function
* alt_sys_init() to initialize a given device instance.
*/
#define ALTERA_MODULAR_ADC_INIT(name, dev) \
altera_modular_adc_init(&dev, name##_SAMPLE_STORE_CSR_IRQ_INTERRUPT_CONTROLLER_ID, name##_SAMPLE_STORE_CSR_IRQ);

 

2. The second problem is that the application doesn't resolve the paths to all the libraries in the BSP. I modified the application's makefile to include the following at line 131:

 

APP_INCLUDE_DIRS += ../anotherADC_bsp/
APP_INCLUDE_DIRS += ../anotherADC_bsp/drivers/inc/

 

Once these corrections are made the application builds successfully. Attached is the SPOC information file.

0 项奖励
hareesh
员工
1,899 次查看

Can please share your platform design screen shot 

0 项奖励
SeanAB
新分销商 I
1,885 次查看

Here is the screen shot.

0 项奖励
Thierry29
初学者
1,924 次查看

Hi,

the same problem exists under Quartus Prime Lite 21.1.1 in Linux edition.

Regards.

0 项奖励
hareesh
员工
1,789 次查看

Hi @SeanAB ,

it's a software bug, I will raise ticket about this issue. if i get any alternate solution i will forward to you.

 

if you don't have any quires I'll close the case. please confirm 

 

 If any answer from the community or Intel Support are helpful, please feel free to give best answer or rate 9/10 survey.

 

Thanks,

0 项奖励
SeanAB
新分销商 I
1,775 次查看

@hareesh 

Thank you for looking into this. Yes, this closes the case.

 

 

0 项奖励
回复