what does this compiler error mean?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

what does this compiler error mean?

827 Views
ianbenton
Senior Contributor I

What does this compiler error message mean?

Building target: 02-1061-02.axf
Invoking: MCU Linker
arm-none-eabi-gcc -nostdlib -Xlinker -Map="02-1061-02.map" -Xlinker --gc-sections -Xlinker -print-memory-usage -mcpu=cortex-m3 -mthumb -T "02-1061-02_Debug.ld" -o "02-1061-02.axf" ./src/02-1061-01.o
Memory region Used Size Region Size %age Used
MFlash64: 23472 B 64 KB 35.82%
Ram0_4: 1932 B 4 KB 47.17%
Ram1_4: 0 GB 4 KB 0.00%
Ram2_4: 0 GB 4 KB 0.00%
c:/nxp/mcuxpressoide_10.1.1_606/ide/tools/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/lib/thumb/v7-m\libcr_c.a(cr_clock.o): In function `clock':
cr_clock.c:(.text.clock+0x0): undefined reference to `__sys_clock'
collect2.exe: error: ld returned 1 exit status
make: *** [02-1061-02.axf] Error 1

MCUXPresso has recently started including these files

 c:/nxp/mcuxpressoide_10.1.1_606/ide/tools/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/lib/thumb/v7-

in every new project, and now everything fails to compile with the error above. What has changed? (presumably accidentally changed)

Labels (2)
0 Kudos
4 Replies

588 Views
BlackNight
NXP Employee
NXP Employee

It means that in cour cr_clock.c you are using __sys_clock, and this object is not found by the linker.

It sounds like you are using a system clock function, but your project does not provide/include that clock function?

I hope this helps,

Erich

0 Kudos

588 Views
ianbenton
Senior Contributor I

I thought it must mean something like that, but I'm not using a system clock function. In fact I'm not using any C functions at all because the project is entirely in assembler.

Some settings have clearly changed, because MCUXpresso created this project differently from all my previous ones:

It added an "includes" directory containing:

MCUXpressoIDE_10.1.1_606/ide/tools/features/include   and

MCUXpressoIDE_10.1.1._606/ide/tools/redlib/include   which was not there in previous projects

It uses a different filename for the .axf file (now prefixed with "lib")

The icon for the .axf file has changed from a purple beetle to a purple amoeba

The project icon (an open folder with a superscript "c") now has a subscript "i".

There's about 500 bytes of RAM used at 0x02000000 which I didn't use in the code

Any clues as to what got changed, because otherwise I'll take aeons to find it!

0 Kudos

588 Views
BlackNight
NXP Employee
NXP Employee

I would make it link first and then check the .map file produce by the linker to see what gets added.

For this, add something dummy like this:

int __sys_clock(void) {

  return 0;

}

and then check the map file.

I hope this helps,

Erich

0 Kudos

588 Views
ianbenton
Senior Contributor I

That helped a lot, in a weird random sort of way. I started looking at every time I used the word "clock" in the assembly, and found I had used a label called "bcdclock" to point to a few bytes of memory where I store the data  from a DS1308 RTC, and later I referred to it as "clock" not "bcdclock", so "clock" was not defined; and that really seemed to upset it. 

0 Kudos