Unsolved error for TWI compilation on Eclipse for SAM7S-EK

All design tool related questions: compiler, assembler, linker. Embedded programming questions: assembler, C code.

Moderator: nferre

Posts: 1
Joined: Tue May 26, 2009 4:30 am

Unsolved error for TWI compilation on Eclipse for SAM7S-EK

Tue May 26, 2009 4:37 am

I'm having an error when compiling twi Library specifically configuring clock as per snippet below:

void TWI_ConfigureMaster(AT91S_TWI *pTwi, unsigned int twck, unsigned int mck)
unsigned int ckdiv = 0;
unsigned int cldiv;
unsigned char ok = 0;

// Reset the TWI

// TWI Slave Mode Disabled, TWI Master Mode Disabled

// Set master mode

// Configure clock
while (!ok)
cldiv = ((mck / (2 * twck)) - 3) / pow(2, ckdiv);

if (cldiv <= 255) {
ok = 1;
else {
pTwi->TWI_CWGR = 0;
pTwi->TWI_CWGR = (ckdiv << 16) | (cldiv << 8) | cldiv;

where the log during compilation are below:

**** Build of configuration Default for project twi ****

make all
arm-elf-as -ahls -mapcs-32 -o crt.o crt.s > crt.lst
arm-elf-gcc -I./ -c -fno-common -O0 -g main.c
arm-elf-gcc -I./ -c -fno-common -O0 -g isrsupport.c
arm-elf-gcc -I./ -c -fno-common -O0 -g lowlevelinit.c
arm-elf-gcc -I./ -c -fno-common -O0 -g blinker.c
arm-elf-gcc -I./ -c -fno-common -O0 -g uart.c
arm-elf-gcc -I./ -c -fno-common -O0 -g twi.c
arm-elf-ld -v -Map main.map -Tmyflash.cmd -o main.out crt.o main.o isrsupport.o lowlevelinit.o blinker.o uart.o twi.o libc.a libm.a libgcc.a
GNU ld (GNU Binutils) 2.18
libm.a(w_pow.o): In function `pow':
C:\msys\1.0\home\yagarto\newlib-build\arm-elf\newlib\libm\math/../../../../../newlib-1.14.0/newlib/libm/math/w_pow.c:210: undefined reference to `__errno'
C:\msys\1.0\home\yagarto\newlib-build\arm-elf\newlib\libm\math/../../../../../newlib-1.14.0/newlib/libm/math/w_pow.c:207: undefined reference to `__errno'
C:\msys\1.0\home\yagarto\newlib-build\arm-elf\newlib\libm\math/../../../../../newlib-1.14.0/newlib/libm/math/w_pow.c:164: undefined reference to `__errno'
make: *** [main.out] Error 1

My platform is Eclipse version 3.4.1 and arm-elf-gcc version is 4.3.2. Any advise guys

Return to “Development Tools”

Who is online

Users browsing this forum: Google [Bot] and 1 guest