Page 1 of 1

AtmelStudio6

Posted: Sun Jul 01, 2012 8:03 pm
by Eisvogel
Hey there,
I tried V-USB in the development environment to use AtmelStudio6. I've made ​​everything as described in this tutorial. But unfortunately I keep getting errors like this:

Code: Select all

Error   1   variable 'usbDescriptorDevice' must be const in order to be put into read-only section by means of '__attribute__((progmem))'   C:\Programmieren\USB-Input\USB-Input\USB-Input\V-USB\usbdrv.h   455   6   USB-Input

Code: Select all

Error   2   variable 'usbDescriptorConfiguration' must be const in order to be put into read-only section by means of '__attribute__((progmem))'   C:\Programmieren\USB-Input\USB-Input\USB-Input\V-USB\usbdrv.h   461   6   USB-Input

Code: Select all

Error   3   variable 'usbDescriptorHidReport' must be const in order to be put into read-only section by means of '__attribute__((progmem))'   C:\Programmieren\USB-Input\USB-Input\USB-Input\V-USB\usbdrv.h   467   6   USB-Input

Code: Select all

Error   4   variable 'usbDescriptorString0' must be const in order to be put into read-only section by means of '__attribute__((progmem))'   C:\Programmieren\USB-Input\USB-Input\USB-Input\V-USB\usbdrv.h   473   6   USB-Input

Code: Select all

Error   5   variable 'usbDescriptorStringVendor' must be const in order to be put into read-only section by means of '__attribute__((progmem))'   C:\Programmieren\USB-Input\USB-Input\USB-Input\V-USB\usbdrv.h   479   5   USB-Input

Code: Select all

Error   6   variable 'usbDescriptorStringDevice' must be const in order to be put into read-only section by means of '__attribute__((progmem))'   C:\Programmieren\USB-Input\USB-Input\USB-Input\V-USB\usbdrv.h   485   5   USB-Input

Code: Select all

Error   7   variable 'usbDescriptorStringSerialNumber' must be const in order to be put into read-only section by means of '__attribute__((progmem))'   C:\Programmieren\USB-Input\USB-Input\USB-Input\V-USB\usbdrv.h   491   5   USB-Input

Re: AtmelStudio6

Posted: Sun Jul 01, 2012 9:28 pm
by Eugen_E
Hello,

I had the same problems with avr-gcc 4.7.0, as described here http://forums.obdev.at/viewtopic.php?f=8&t=6753&start=0

Re: AtmelStudio6

Posted: Mon Jul 02, 2012 9:33 am
by Eisvogel
Yea i done the same like you but than came this error:

Code: Select all

E r r o r 1 u n d e f i n e d r e f e r e n c e t o ` u s b I n i t ' C : \ P r o g r a mm i e r e n \ U S B - I n p u t \ U S B - I n p u t

Re: AtmelStudio6

Posted: Mon Jul 02, 2012 6:41 pm
by Eisvogel
I think the problem is that the funcion is deklared but nothing is in there:

Code: Select all

USB_PUBLIC void usbInit(void);


Why is there no code like this?

Code: Select all

USB_PUBLIC void usbInit(void){
my programm
}

Re: AtmelStudio6

Posted: Tue Jul 10, 2012 11:42 pm
by asd123zxc
simply add a const before variables
for example:

Code: Select all

char usbDescriptorDevice[];

to

Code: Select all

const char usbDescriptorDevice[];

Re: AtmelStudio6

Posted: Tue Jul 10, 2012 11:46 pm
by asd123zxc
please watch this topic , i am using atmel studio 6 for compiling my project .
http://forums.obdev.at/viewtopic.php?f=8&t=6774

Re: AtmelStudio6

Posted: Sat Jun 22, 2013 9:06 pm
by simpak
Eisvogel wrote:Hey there,
I tried V-USB in the development environment to use AtmelStudio6. I've made ​​everything as described in this tutorial. But unfortunately I keep getting errors like this:

Code: Select all

Error   1   variable 'usbDescriptorDevice' must be const in order to be put into read-only section by means of '__attribute__((progmem))'   C:\Programmieren\USB-Input\USB-Input\USB-Input\V-USB\usbdrv.h   455   6   USB-Input

Code: Select all

Error   2   variable 'usbDescriptorConfiguration' must be const in order to be put into read-only section by means of '__attribute__((progmem))'   C:\Programmieren\USB-Input\USB-Input\USB-Input\V-USB\usbdrv.h   461   6   USB-Input

Code: Select all

Error   3   variable 'usbDescriptorHidReport' must be const in order to be put into read-only section by means of '__attribute__((progmem))'   C:\Programmieren\USB-Input\USB-Input\USB-Input\V-USB\usbdrv.h   467   6   USB-Input

Code: Select all

Error   4   variable 'usbDescriptorString0' must be const in order to be put into read-only section by means of '__attribute__((progmem))'   C:\Programmieren\USB-Input\USB-Input\USB-Input\V-USB\usbdrv.h   473   6   USB-Input

Code: Select all

Error   5   variable 'usbDescriptorStringVendor' must be const in order to be put into read-only section by means of '__attribute__((progmem))'   C:\Programmieren\USB-Input\USB-Input\USB-Input\V-USB\usbdrv.h   479   5   USB-Input

Code: Select all

Error   6   variable 'usbDescriptorStringDevice' must be const in order to be put into read-only section by means of '__attribute__((progmem))'   C:\Programmieren\USB-Input\USB-Input\USB-Input\V-USB\usbdrv.h   485   5   USB-Input

Code: Select all

Error   7   variable 'usbDescriptorStringSerialNumber' must be const in order to be put into read-only section by means of '__attribute__((progmem))'   C:\Programmieren\USB-Input\USB-Input\USB-Input\V-USB\usbdrv.h   491   5   USB-Input



Please update all your drivers..

Re: AtmelStudio6

Posted: Sun Jun 23, 2013 1:46 am
by vouvoume
To everybody facing this issue: Please use a recent version of V-USB.

For example you can get one from :
1) https://github.com/obdev/v-usb or
2) https://github.com/baerwolf/USBaspLoader

The problem in old versin: PROGMEMs aren't declared as const, as they should be since data in the flash is read-only.
Older gccs ignored this (this actually was a bug). Todays compiler will raise an error.

Best regards