Custom new component error Build error:The command 'arm-none-eabi-gcc.exe' failed with exit code '1'

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
dafa_1669371
Level 3
Level 3
10 replies posted 5 replies posted Welcome!

i made a new AD9833 custom component i follow the video tutorials it compile with no error but when i add it to a project it give me this error
also i try to add the h file and c file but it couldn't find the directory
i've attached the file for the custom component

0 Likes
1 Solution
MotooTanaka
Level 9
Level 9
Distributor - Marubun (Japan)
First comment on blog Beta tester First comment on KBA

Hi,

You had instantiation of constant in AD9833.h

> const int SINE = 0x2000;                    // Define AD9833's waveform register value.

> const int SQUARE = 0x2028;                  // When we update the frequency, we need to

> const int TRIANGLE = 0x2002;                // define the waveform when we end writing.  

> const long refFreq = 25000000;          // On-board crystal reference frequency

I moved them in AD9833.c and made them extern

< extern const int SINE ;                    // Define AD9833's waveform register value.

< extern const int SQUARE ;                  // When we update the frequency, we need to

< extern const int TRIANGLE ;                // define the waveform when we end writing.  

< extern const long refFreq ;          // On-board crystal reference frequency

In AD9833.c

sdata_write() needed to be `$INSTANCE_NAME`_SDATA_Write()

Since you were using pow(), I added included "math.h" and add "m" in Linker Library

Build Settings > <Project> > ARM GCC 5.4-.. > Linker > General > Additional Libraries : m

moto

View solution in original post

3 Replies
odissey1
Level 9
Level 9
First comment on KBA 1000 replies posted 750 replies posted

DavidFarid,

Please follow these steps to attach the project: (1) Build->Clean. (2) File->Create archive bundle->Minimal. (3) In newly created zip file delete Generated_source folder to reduce the Archive size.

/odissey1

0 Likes
MotooTanaka
Level 9
Level 9
Distributor - Marubun (Japan)
First comment on blog Beta tester First comment on KBA

Hi,

You had instantiation of constant in AD9833.h

> const int SINE = 0x2000;                    // Define AD9833's waveform register value.

> const int SQUARE = 0x2028;                  // When we update the frequency, we need to

> const int TRIANGLE = 0x2002;                // define the waveform when we end writing.  

> const long refFreq = 25000000;          // On-board crystal reference frequency

I moved them in AD9833.c and made them extern

< extern const int SINE ;                    // Define AD9833's waveform register value.

< extern const int SQUARE ;                  // When we update the frequency, we need to

< extern const int TRIANGLE ;                // define the waveform when we end writing.  

< extern const long refFreq ;          // On-board crystal reference frequency

In AD9833.c

sdata_write() needed to be `$INSTANCE_NAME`_SDATA_Write()

Since you were using pow(), I added included "math.h" and add "m" in Linker Library

Build Settings > <Project> > ARM GCC 5.4-.. > Linker > General > Additional Libraries : m

moto

Thanks

just for the record i still had problems with the extern
change const int SINE = 0x2000;   with #define SINE 0x2000 and it work just fine