Author Topic: Webbotlib - avr studio 4- errors  (Read 3842 times)

0 Members and 1 Guest are viewing this topic.

Offline raptorwesTopic starter

  • Jr. Member
  • **
  • Posts: 43
  • Helpful? 0
Webbotlib - avr studio 4- errors
« on: March 10, 2011, 06:18:40 PM »
I just received my Axon2, I loaded all of the required programs and was going through the "Getting started" tutorial. I got to the step where you "rebuild all" and got errors ...a lot of them . I am new to micro controllers and c programming, could someone shed some light on my situation so I can proceed on. Thanks in advance for any help . Below are the errors i received
  ???
Build started 10.3.2011 at 19:57:44
avr-gcc -I"C:\Users\wes lubee\Documents\..\..\..\My_Robots\Webbotlib"  -mmcu=atmega640 -Wall -gdwarf-2 -std=gnu99   -DF_CPU=16000000UL -O0 -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -MD -MP -MT Axon2_webbotlib.o -MF dep/Axon2_webbotli
b.o.d  -c  ../Axon2_webbotlib.c

avr-gcc -mmcu=atmega640 -Wl,-Map=Axon2_webbotlib.map Axon2_webbotlib.o   -L"c:\My_Robots\Webbotlib"  -lWebbot-ATMega640 -lc -lm  -o Axon2_webbotlib.elf
c:\My_Robots\Webbotlib\libWebbot-ATMega640.a(core.o): In function `main':
C:\eclipse\workspace\WebbotCLibrary/core.c:65: undefined reference to `configure_ports'
C:\eclipse\workspace\WebbotCLibrary/core.c:66: undefined reference to `registerLED'
C:\eclipse\workspace\WebbotCLibrary/core.c:78: undefined reference to `sysInitHardware'
C:\eclipse\workspace\WebbotCLibrary/core.c:80: undefined reference to `appInitHardware'
C:\eclipse\workspace\WebbotCLibrary/core.c:87: undefined reference to `appInitSoftware'
C:\eclipse\workspace\WebbotCLibrary/core.c:98: undefined reference to `appControl'
c:\My_Robots\Webbotlib\libWebbot-ATMega640.a(timer.o): In function `ticks_per_ms':
C:\eclipse\workspace\WebbotCLibrary/timer.c:86: undefined reference to `cpu_speed_div_1000'
C:\eclipse\workspace\WebbotCLibrary/timer.c:86: undefined reference to `cpu_speed_div_1000'
c:\My_Robots\Webbotlib\libWebbot-ATMega640.a(timer.o): In function `timerNumberOfCompareUnits':
/timer.h:230: undefined reference to `pgm_Timers'
/timer.h:230: undefined reference to `pgm_Timers'
c:\My_Robots\Webbotlib\libWebbot-ATMega640.a(timer.o): In function `compareGetTimer':
/timer.h:177: undefined reference to `pgm_Timers'
/timer.h:177: undefined reference to `pgm_Timers'
/timer.h:177: undefined reference to `pgm_Timers'
c:\My_Robots\Webbotlib\libWebbot-ATMega640.a(timer.o):/timer.h:177: more undefined references to `pgm_Timers' follow
c:\My_Robots\Webbotlib\libWebbot-ATMega640.a(timer.o): In function `initTimers':
C:\eclipse\workspace\WebbotCLibrary/timer.c:762: undefined reference to `NUMBER_OF_TIMERS'
C:\eclipse\workspace\WebbotCLibrary/timer.c:763: undefined reference to `pgm_Timers'
C:\eclipse\workspace\WebbotCLibrary/timer.c:763: undefined reference to `pgm_Timers'
c:\My_Robots\Webbotlib\libWebbot-ATMega640.a(timer.o): In function `compareGetTimer':
/timer.h:177: undefined reference to `pgm_Timers'
/timer.h:177: undefined reference to `pgm_Timers'
c:\My_Robots\Webbotlib\libWebbot-ATMega640.a(timer.o): In function `__clockInit':
C:\eclipse\workspace\WebbotCLibrary/timer.c:838: undefined reference to `NUMBER_OF_TIMERS'
C:\eclipse\workspace\WebbotCLibrary/timer.c:838: undefined reference to `pgm_Timers'
C:\eclipse\workspace\WebbotCLibrary/timer.c:838: undefined reference to `pgm_Timers'
c:\My_Robots\Webbotlib\libWebbot-ATMega640.a(scheduler.o): In function `__scheduleUpdate':
C:\eclipse\workspace\WebbotCLibrary/scheduler.c:148: undefined reference to `maxJobs'
C:\eclipse\workspace\WebbotCLibrary/scheduler.c:148: undefined reference to `__queue'
C:\eclipse\workspace\WebbotCLibrary/scheduler.c:148: undefined reference to `__queue'
c:\My_Robots\Webbotlib\libWebbot-ATMega640.a(scheduler.o): In function `calcTicks':
C:\eclipse\workspace\WebbotCLibrary/scheduler.c:55: undefined reference to `cpu_speed_div_1000000'
C:\eclipse\workspace\WebbotCLibrary/scheduler.c:55: undefined reference to `cpu_speed_div_1000000'
c:\My_Robots\Webbotlib\libWebbot-ATMega640.a(scheduler.o): In function `scheduleJob':
C:\eclipse\workspace\WebbotCLibrary/scheduler.c:92: undefined reference to `maxJobs'
C:\eclipse\workspace\WebbotCLibrary/scheduler.c:92: undefined reference to `__queue'
C:\eclipse\workspace\WebbotCLibrary/scheduler.c:92: undefined reference to `__queue'
make: *** [Axon2_webbotlib.elf] Error 1
Build failed with 30 errors and 0 warnings...










 :'(
« Last Edit: March 10, 2011, 06:59:23 PM by raptorwes »

Offline raptorwesTopic starter

  • Jr. Member
  • **
  • Posts: 43
  • Helpful? 0
Re: Webbotlib - avr studio 4- errors
« Reply #1 on: March 11, 2011, 05:54:26 AM »
Ok well i think i might have found part of my problem, Step 6 tells you to..

"Copy/paste all code in Photovore.c into the .c file with the same name as your project (found in Source Files on the left). For example, if your project is called 'Axon2_WebblotLib', paste the code into Axon2_WebbotLib.c. Push the 'Save' icon at the top left in AVR Studio. This is the main() file"

to do this i opened the programmers notepad - copied the text from photovore.c and went into AVRstudio 4 and in the box just to the right of the source files list i pasted the photovore.c text i hit save and rebuild all now i get less errors but i am obviously still doing something incorrectly  below is m latest try - 20 errors 3 warnings 



Build started 11.3.2011 at 06:45:57
avr-gcc  -mmcu=atmega128 -Wall -gdwarf-2 -Os -std=gnu99 -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -MD -MP -MT Axon2_webbotlib.o -MF dep/Axon2_webbotlib.o.d  -c  ../Axon2_webbotlib.c
../Axon2_webbotlib.c:38:90: error: sys/axon2.h: No such file or directory
../Axon2_webbotlib.c:39:38: error: servos.h: No such file or directory
../Axon2_webbotlib.c:40:32: error: a2d.h: No such file or directory
../Axon2_webbotlib.c:41:36: error: rprintf.h: No such file or directory
../Axon2_webbotlib.c:42:38: error: i2c_master.h: No such file or directory
../Axon2_webbotlib.c:46:22: error: hardware.h: No such file or directory
../Axon2_webbotlib.c: In function 'appInitHardware':
../Axon2_webbotlib.c:53: warning: implicit declaration of function 'uartInit'
../Axon2_webbotlib.c:53: error: 'GPS_UART' undeclared (first use in this function)
../Axon2_webbotlib.c:53: error: (Each undeclared identifier is reported only once
../Axon2_webbotlib.c:53: error: for each function it appears in.)
../Axon2_webbotlib.c:53: error: 'GPS_BAUD' undeclared (first use in this function)
../Axon2_webbotlib.c:54: error: 'USB_UART' undeclared (first use in this function)
../Axon2_webbotlib.c:54: error: 'USB_BAUD' undeclared (first use in this function)
../Axon2_webbotlib.c:55: error: 'WIRELESS_UART' undeclared (first use in this function)
../Axon2_webbotlib.c:55: error: 'WIRELESS_BAUD' undeclared (first use in this function)
../Axon2_webbotlib.c:56: error: 'OTHER_UART' undeclared (first use in this function)
../Axon2_webbotlib.c:56: error: 'OTHER_BAUD' undeclared (first use in this function)
../Axon2_webbotlib.c:59: warning: implicit declaration of function 'rprintfInit'
../Axon2_webbotlib.c:59: error: 'USB_ACTIVATE' undeclared (first use in this function)
../Axon2_webbotlib.c:62: warning: implicit declaration of function 'servoPWMInit'
../Axon2_webbotlib.c:62: error: 'bank1' undeclared (first use in this function)
../Axon2_webbotlib.c: At top level:
../Axon2_webbotlib.c:72: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'appInitSoftware'
../Axon2_webbotlib.c:82: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'appControl'
make: *** [Axon2_webbotlib.o] Error 1
Build failed with 20 errors and 3 warnings...

Offline KurtEck

  • Robot Overlord
  • ****
  • Posts: 217
  • Helpful? 12
Re: Webbotlib - avr studio 4- errors
« Reply #2 on: March 11, 2011, 08:45:00 AM »
Sounds like maybe there are issues on your project setup.  In particular the project settings that sets the include directories.  This tells the compiler where to search for the include files. 

I am not at my main computer that has this stuff installed, so I may not be much more help.

Kurt

Offline raptorwesTopic starter

  • Jr. Member
  • **
  • Posts: 43
  • Helpful? 0
Re: Webbotlib - avr studio 4- errors
« Reply #3 on: March 11, 2011, 09:21:00 AM »
Thanks, I thought i entered the correct information as i was very careful. I have gone thorough the setup process twice but I will redo the setup again when i get home from work to see if that fixes the problem. Maybe i missed something.

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,165
  • Helpful? 111
    • Webbot stuff
Re: Webbotlib - avr studio 4- errors
« Reply #4 on: March 11, 2011, 12:24:32 PM »
you could try using the 'makefile' that gets generated. ie from a command prompt, change to the folder where your project file is stored and just type:
make
and press enter
Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline raptorwesTopic starter

  • Jr. Member
  • **
  • Posts: 43
  • Helpful? 0
Re: Webbotlib - avr studio 4- errors
« Reply #5 on: March 11, 2011, 06:16:34 PM »
I tried from scratch again and this is what is get.

Build started 11.3.2011 at 19:13:54
avr-gcc -I"C:\My_Robots\Axon2_webbotlib\..\WebbotLib"  -mmcu=atmega640 -Wall -gdwarf-2 -std=gnu99 -O0 -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -MD -MP -MT Axon2_webbotlib.o -MF dep/Axon2_webbotlib.o.d  -c  ../Axon2_webbotlib.c
In file included from ../Axon2_webbotlib.c:38:
C:\My_Robots\Axon2_webbotlib\..\WebbotLib/sys/axon2.h:82:2: warning: #warning No CPU speed specified - assuming Axon is running at 16MHz
../Axon2_webbotlib.c:42:38: error: i2c_master.h: No such file or directory
../Axon2_webbotlib.c:46:22: error: hardware.h: No such file or directory
../Axon2_webbotlib.c: In function 'appInitHardware':
../Axon2_webbotlib.c:53: error: 'GPS_UART' undeclared (first use in this function)
../Axon2_webbotlib.c:53: error: (Each undeclared identifier is reported only once
../Axon2_webbotlib.c:53: error: for each function it appears in.)
../Axon2_webbotlib.c:53: error: 'GPS_BAUD' undeclared (first use in this function)
../Axon2_webbotlib.c:54: error: 'USB_UART' undeclared (first use in this function)
../Axon2_webbotlib.c:54: error: 'USB_BAUD' undeclared (first use in this function)
../Axon2_webbotlib.c:55: error: 'WIRELESS_UART' undeclared (first use in this function)
../Axon2_webbotlib.c:55: error: 'WIRELESS_BAUD' undeclared (first use in this function)
../Axon2_webbotlib.c:56: error: 'OTHER_UART' undeclared (first use in this function)
../Axon2_webbotlib.c:56: error: 'OTHER_BAUD' undeclared (first use in this function)
../Axon2_webbotlib.c:59: error: 'USB_ACTIVATE' undeclared (first use in this function)
../Axon2_webbotlib.c:62: error: 'bank1' undeclared (first use in this function)
../Axon2_webbotlib.c: In function 'appControl':
../Axon2_webbotlib.c:85: error: 'bank1' undeclared (first use in this function)
../Axon2_webbotlib.c:99: warning: implicit declaration of function 'update_sensors'
../Axon2_webbotlib.c:101: error: 'lightLeft' undeclared (first use in this function)
../Axon2_webbotlib.c:101: error: 'lightRight' undeclared (first use in this function)
../Axon2_webbotlib.c:104: error: 'left_wheel' undeclared (first use in this function)
../Axon2_webbotlib.c:105: error: 'right_wheel' undeclared (first use in this function)
make: *** [Axon2_webbotlib.o] Error 1
Build failed with 19 errors and 2 warnings...

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,165
  • Helpful? 111
    • Webbot stuff
Re: Webbotlib - avr studio 4- errors
« Reply #6 on: March 11, 2011, 06:59:19 PM »
What OS do you have: Win, Unix,Mac?
What Version of WebbotLib are you on (look in the Version.h file in the library)
How are you building the file: AVRStudio or using make
Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline raptorwesTopic starter

  • Jr. Member
  • **
  • Posts: 43
  • Helpful? 0
Re: Webbotlib - avr studio 4- errors
« Reply #7 on: March 11, 2011, 07:30:00 PM »
i am running
windows 7 pro 32 bit
webbotlib version 1.29
i am using AVR studio 4

i am following the steps in the getting started tutorial i am on step 6 in which you rebuild all.

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: Webbotlib - avr studio 4- errors
« Reply #8 on: March 12, 2011, 01:58:56 PM »
I just rechecked the photovore demo code with 1.29 and it works fine for me.

You will need to comment this one line out, though, in Photovore.c at the top:
#include "i2c_master.h"


Looking at the errors, it appears you are missing a step. Probably one that locates a folder for WebbotLib.

Offline raptorwesTopic starter

  • Jr. Member
  • **
  • Posts: 43
  • Helpful? 0
Re: Webbotlib - avr studio 4- errors
« Reply #9 on: March 12, 2011, 10:36:35 PM »
thanks for the tip Admin
I commented the line #include "i2c_master.h" out ( i am assuming // is what i should put in front of it since it turned green when i did that)
and it removed one of the errors
one thing i also noticed - in the start up guide there is some text in the IO box to the right of avr studio, i don't have anything in that box. Is that box populated by a file i may have missed ? i am on my 5 th try at setting up avr studio and being a computer geek by trade i find it odd that i would have missed something 5 times ( although i do admit i have and will make mistakes from time to time)  ;)

do you think it was a step missed installing webbotlib or a step in avr studio? for source file in avr studio it points to the File name i gave it when i selected new file during setup, should that point directly to the webbotlib folder ? or did you possibly mean it was a header or dependency file ? i have hardware .h in the header and the 3 files specified as dependencies.

attached is a screen shot of AVR studio
« Last Edit: March 12, 2011, 10:50:43 PM by raptorwes »

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: Webbotlib - avr studio 4- errors
« Reply #10 on: March 12, 2011, 11:23:36 PM »
Quote
one thing i also noticed - in the start up guide there is some text in the IO box to the right of avr studio, i don't have anything in that box. Is that box populated by a file i may have missed ?
Don't worry about that box, it doesn't affect your situation.


Lets try something different. I want you to use WebbotLib Project Designer instead. Follow the instructions here:
http://webbot.org.uk/iPoint/37.page

PD makes things much easier and I highly recommend it. It should bypass any setup mistakes you are making, as most of it is automatically done for you.

Here is a demo video on using it:

How to Program Axon II in PD

Offline raptorwesTopic starter

  • Jr. Member
  • **
  • Posts: 43
  • Helpful? 0
Re: Webbotlib - avr studio 4- errors
« Reply #11 on: March 13, 2011, 11:32:18 AM »
The project designer program worked. I was able to set up 2 servos to turn on when i turn on the power switch although they go forward and backward instead of one direction. I am waiting for some hitech connectors to come in the mail so i can get the photo diodes connected.
1 more question - for now..lol   ???
 in the project designer there are 2 options for the servos, center and range. I am playing around with the settings and notice a change in how the servos act. how would i increase the speed of the servo and keep them going in one direction without reversing backwards and forwards. I am using 2 hsr-1425 constant rotation digital servos

Thanks again to everyone that tried to help me it is much appreciated  ;D   

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: Webbotlib - avr studio 4- errors
« Reply #12 on: March 13, 2011, 12:11:03 PM »
Look at my example programs, it'll help you a lot.

For example, in the Photovore example, you'll see this:
Code: [Select]
act_setSpeed(&left,DRIVE_SPEED_MIN);
act_setSpeed(&right,DRIVE_SPEED_MAX);

If you wanted half of full speed for the right servo, you could do this:
Code: [Select]
act_setSpeed(&right,DRIVE_SPEED_MAX/2);
That should get you in the right direction ;D

 


Get Your Ad Here

data_list