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

azlan27
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
pTwi->TWI_CR = AT91C_TWI_SWRST;
pTwi->TWI_RHR;

// TWI Slave Mode Disabled, TWI Master Mode Disabled
pTwi->TWI_CR = AT91C_TWI_MSDIS;

// Set master mode
pTwi->TWI_CR = AT91C_TWI_MSEN;

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

if (cldiv <= 255) {
ok = 1;
}
else {
ckdiv++;
}
}
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
.assembling
arm-elf-as -ahls -mapcs-32 -o crt.o crt.s > crt.lst
.compiling
arm-elf-gcc -I./ -c -fno-common -O0 -g main.c
.compiling
arm-elf-gcc -I./ -c -fno-common -O0 -g isrsupport.c
.compiling
arm-elf-gcc -I./ -c -fno-common -O0 -g lowlevelinit.c
.compiling
arm-elf-gcc -I./ -c -fno-common -O0 -g blinker.c
.compiling
arm-elf-gcc -I./ -c -fno-common -O0 -g uart.c
.compiling
arm-elf-gcc -I./ -c -fno-common -O0 -g twi.c
..linking
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: No registered users and 2 guests