AtmelStudio6

General discussions about V-USB, our firmware-only implementation of a low speed USB device on Atmel's AVR microcontrollers
Post Reply
Eisvogel

AtmelStudio6

Post by Eisvogel » Sun Jul 01, 2012 8:03 pm

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

Eugen_E
Posts: 2
Joined: Sun Jul 01, 2012 1:19 am

Re: AtmelStudio6

Post by Eugen_E » Sun Jul 01, 2012 9:28 pm

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

Eisvogel

Re: AtmelStudio6

Post by Eisvogel » Mon Jul 02, 2012 9:33 am

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

Eisvogel

Re: AtmelStudio6

Post by Eisvogel » Mon Jul 02, 2012 6:41 pm

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
}

asd123zxc
Posts: 5
Joined: Sun Jul 08, 2012 10:15 pm

Re: AtmelStudio6

Post by asd123zxc » Tue Jul 10, 2012 11:42 pm

simply add a const before variables
for example:

Code: Select all

char usbDescriptorDevice[];

to

Code: Select all

const char usbDescriptorDevice[];

asd123zxc
Posts: 5
Joined: Sun Jul 08, 2012 10:15 pm

Re: AtmelStudio6

Post by asd123zxc » Tue Jul 10, 2012 11:46 pm

please watch this topic , i am using atmel studio 6 for compiling my project .
http://forums.obdev.at/viewtopic.php?f=8&t=6774

simpak
Posts: 1
Joined: Sat Jun 22, 2013 9:05 pm

Re: AtmelStudio6

Post by simpak » Sat Jun 22, 2013 9:06 pm

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..

vouvoume

Re: AtmelStudio6

Post by vouvoume » Sun Jun 23, 2013 1:46 am

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

Post Reply