Society of Robots - Robot Forum

Software => Software => Topic started by: Lester on May 17, 2012, 04:01:55 PM

Title: WebbotLib build failed right out of the box.
Post by: Lester on May 17, 2012, 04:01:55 PM
Built a project in Designer to include the following:
Standard items that get built in all...
button
statusLED
uart1
clock

plus I included....
Display-HD44780 compatible device
GPS-NMEA compliant device
uart for OBD connector
SPIBus for SD card
and a DroneCell device.

So, if I select the Log "Sent and Receive Data" to the Display I get the following error from the code I list below that Project Designer generates.

The errors on 182 and 189 are the result of a dropped semi-colon on 181 and 188 in the autogenerate but what about the error from the data type in both lines of displayGetWriter(byte) which is 181 and 188?

If I change the Log "Sent and Receive Data" to the uart1 back to the terminal program I don't get the error. 

Any ideas?

lib/lib_hardware.c: In function 'myDroneCell_put_char':
lib/lib_hardware.c:181: error: invalid type argument of '->' (have 'int')
lib/lib_hardware.c:182: error: expected ';' before 'return'
lib/lib_hardware.c:183: warning: no return statement in function returning non-void
lib/lib_hardware.c: In function 'myDroneCell_get_char':
lib/lib_hardware.c:188: error: invalid type argument of '->' (have 'int')
lib/lib_hardware.c:189: error: expected ';' before '}' token
make: *** [lib/lib_hardware.o] Error 1


DRONECELL _myDroneCell_ = MAKE_DRONECELL(_C_myDroneCell_uart,38400,myDroneCell_smsc,A0,A1,A2,A3,&myDroneCell_smsbuf,&myDroneCell_put_char,&myDroneCell_get_char);
// Create a Writer to write to myDroneCell
// Do NOT call it directly instead, to write the char 'A' use:
//    droneCellGetWriter(&myDroneCell)('A');
static MAKE_WRITER(myDroneCell_put_char){ /* createWriter */
(line 181)   displayGetWriter(byte)
   return droneCellSendByte(&_myDroneCell_,byte);
}
// Create a Reader to read from myDroneCell
static MAKE_READER(myDroneCell_get_char){ /* createReader */
   int byte = droneCellGetByte(&_myDroneCell_);
   if(byte!=-1){
(line 189)   displayGetWriter(byte)
   }
   return byte;
}
Title: Re: WebbotLib build failed right out of the box.
Post by: Webbot on May 17, 2012, 06:50:26 PM
Ok I've uploaded an new Project Designer that should fix your issues.
Title: Re: WebbotLib build failed right out of the box.
Post by: Lester on May 17, 2012, 08:44:36 PM
I downloaded Project Designer from here http://webbot.org.uk/iPoint/36.page (http://webbot.org.uk/iPoint/36.page) but it didn't create a desktop link nor am I certain it stored it anywhere.  Help->about says version 1.1 from 2009.

Anyway, I may be totally messed up in this and haven't really downloaded the right version LOL, I wouldn't put it past me.  Nevertheless, working off the download I did get, which probably disappeared when I closed it and didn't get stored anywhere this is what I got.


On "Build ALL" the following errors.

lib/lib_hardware.c:24: error: invalid initializer

line 24 is just below....
// Create hardware UART _C_uart1
HW_UART __C_uart1 = MAKE_HW_UART(UCSR1A,UCSR1B,UBRR1L,UBRR1H,UDR1,null,BV(U2X1),D2,D3,&uart1GetByte,&uart1SendByte);

AVR S4 generates this error for all uart "makes".  This one happens to be the usb uart.

From the Message tab....
Loaded plugin STK500
gcc plug-in: No AVR Toolchain installation found. The AVR GCC plug-in can still be used if you set up your own build tools.
Loaded plugin AVR GCC
Loaded partfile: C:\Program Files (x86)\Atmel\AVR Tools\PartDescriptionFiles\ATmega640
gcc plug-in: No AVR Toolchain installation found. The AVR GCC plug-in can still be used if you set up your own build tools.
gcc plug-in: No AVR Toolchain installation found. The AVR GCC plug-in can still be used if you set up your own build tools.


Sorry to be a pain.
Title: Re: WebbotLib build failed right out of the box.
Post by: Webbot on May 18, 2012, 12:37:07 PM
Sounds like your in installer heaven.
Remeber there are various components:

The reason you are seeing the error message in AVR Studio 4 is normally because you installed it before you installed the WinAVR compiler and so it needs to know where the compiler lives. You can do this via the AVR Studio 4 setup but its sometimes easier to just un-install, install WinAVR, and then install AVR Studio. It then looks at the registry to auto-discover where the compiler etc are installed.

However: you don't necessarily need AVR Studio 4. Since Project Designer will generate a 'make' file then so long as your compiler is on the PATH then you can just launch a command window, change to your project directory, and type in 'make'.
Having built your app the resultant *.hex file then needs squirting onto the chip. Yes you can do this in AVR Studio but there are lots of other tools to let you do it for example http://www.societyofrobots.com/axon2/axon2_setup3.shtml (http://www.societyofrobots.com/axon2/axon2_setup3.shtml) or even command line tools like avr-dude

As for your 'MAKE_HW_UART' compile problem. I think you are using an old Version 1.x version of WebbotLib - which is from the times before Project Designer. You should be using the Version 2.x code stream.

Not sure why you didn't get the desktop shortcut created - unless you are using a PC at work with stringent security settings.

Hope that helps


Title: Re: WebbotLib build failed right out of the box.
Post by: Lester on May 22, 2012, 07:37:05 PM
okay, so I unistalled WinAVR and Studio 4 (although I have gotten other projects to compile) and Step 2 seems to have taken a disliking to me.

Step 2: Install AVR Studio
http://www.societyofrobots.com/axon/axon_getting_started_software.shtml (http://www.societyofrobots.com/axon/axon_getting_started_software.shtml)

I think it's trying to tell me something LOL....
AVR Studio (latest version)
http://www.atmel.com/Images/avrstudio4setup.exe (http://www.atmel.com/Images/avrstudio4setup.exe)

Which version of AVR Studio online elsewhere has been tested?

and a PS, I am pretty sure I used the 2.08 version of Webbotlib but I will reinstall that as well.

Thanks.

Title: Re: WebbotLib build failed right out of the box.
Post by: Lester on May 22, 2012, 07:41:25 PM
and as I said I had actually built other projects so "right out of the box" in my subject line was missleading sorry about that.

The essence of the errors centered around my using a display (4x20 LD) which works for Hello World suff off a keypad.
Title: Re: WebbotLib build failed right out of the box.
Post by: Webbot on May 22, 2012, 08:16:30 PM
Which version of AVR Studio online elsewhere has been tested?

To be brutally honest - I don't really care what IDE people are using- Notepad upwards. WebbotLib has its own makefile so it can be built from scratch in a Cmd window, each project generates a makefile and so can also be built in a Cmd window. This gets you as far as a .hex file to upload to your chip - and you don't need an IDE for that either. So I don't test against ANY IDE as they are kinda irrelevant to me and down to everyones own preference. There are many people using AVR Studio 4 and I know others have had success with Studio 5 and 6 - but I don't use any of them so hard to recommend.

@Admin: that link to avr studio 4 seems to be dead.

Title: Re: WebbotLib build failed right out of the box.
Post by: Max Web on May 23, 2012, 10:10:03 AM
Hi,

Quote
Which version of AVR Studio online elsewhere has been tested?

I tested AVR Studio 4, 5 and 6, all of them are working fine, using WinAVR as well as the integrated compiler (which should be WinAVR as well)!
The only thing you need to do is to use the external makefile, press build and upload the hex file to your controller, that's it.

Regards,

Max Web
Title: Re: WebbotLib build failed right out of the box.
Post by: Webbot on May 23, 2012, 11:49:12 AM
You can get older versions of AVRStudio from http://www.atmel.com/tools/STUDIOARCHIVE.aspx (http://www.atmel.com/tools/STUDIOARCHIVE.aspx)