AVR Studio programming issues

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 4.
To post in this forum you must have a registered copy of Flowcode 4 or higher. To sign up for this forum topic please use the "Online Resources" link in the Flowcode Help Menu.

Moderator: Benj

Post Reply
cantronicx
Posts: 16
Joined: Fri Jul 23, 2010 9:53 pm
Has thanked: 4 times
Been thanked: 1 time
Contact:

AVR Studio programming issues

Post by cantronicx »

The code will simulate, and compile to 'C' and also will compile to hex. It does not however compile to chip.

here is what happens when attempting to compile to chip on the STK500 or any other hardware configuration.

File name: C:\Users\cliff\Documents\CIRCUITS\Flowcode\Programs\Flowcode1.c
Generated by: Flowcode v4.3.6.61
Date: Thursday, February 24, 2011 16:55:12
Licence: Professional
Registered to: clifford luckiesh


http://www.matrixmultimedia.com


Launching the compiler...
C:\Program Files (x86)\Matrix Multimedia\Flowcode AVR V4\Tools\MX_bats\avra.bat atmega88 "C:\Users\cliff\DOCUME~1\CIRCUITS\Flowcode\Programs\Flowcode1.elf" "C:\Users\cliff\DOCUME~1\CIRCUITS\Flowcode\Programs\Flowcode1.c" "C:\Users\cliff\DOCUME~1\CIRCUITS\Flowcode\Programs\Flowcode1.lst"

C:\Users\cliff\Documents\CIRCUITS\Flowcode\Programs>"C:\PROGRA~2\MATRIX~1\FLOWCO~1\Tools\MX_bats\..\bin\avr-gcc.exe" -mmcu=atmega88 -Os -funsigned-char -o "C:\Users\cliff\DOCUME~1\CIRCUITS\Flowcode\Programs\Flowcode1.elf" "C:\Users\cliff\DOCUME~1\CIRCUITS\Flowcode\Programs\Flowcode1.c" -lm

C:\Users\cliff\Documents\CIRCUITS\Flowcode\Programs>"C:\PROGRA~2\MATRIX~1\FLOWCO~1\Tools\MX_bats\..\bin\avr-objdump.exe" -S "C:\Users\cliff\DOCUME~1\CIRCUITS\Flowcode\Programs\Flowcode1.elf" 1>"C:\Users\cliff\DOCUME~1\CIRCUITS\Flowcode\Programs\Flowcode1.lst"

C:\Users\cliff\Documents\CIRCUITS\Flowcode\Programs>"C:\PROGRA~2\MATRIX~1\FLOWCO~1\Tools\MX_bats\..\bin\avr-size.exe" -B -d "C:\Users\cliff\DOCUME~1\CIRCUITS\Flowcode\Programs\Flowcode1.elf"
text data bss dec hex filename
156 0 22 178 b2 C:\Users\cliff\DOCUME~1\CIRCUITS\Flowcode\Programs\Flowcode1.elf

Compilation successful!

Return code = 0

Launching the linker/assembler...
C:\Program Files (x86)\Matrix Multimedia\Flowcode AVR V4\Tools\MX_bats\avrb.bat "C:\Users\cliff\DOCUME~1\CIRCUITS\Flowcode\Programs\Flowcode1.elf" "C:\Users\cliff\DOCUME~1\CIRCUITS\Flowcode\Programs\Flowcode1.hex" "C:\Users\cliff\DOCUME~1\CIRCUITS\Flowcode\Programs\Flowcode1.cof"

C:\Users\cliff\Documents\CIRCUITS\Flowcode\Programs>"C:\PROGRA~2\MATRIX~1\FLOWCO~1\Tools\MX_bats\..\bin\avr-objcopy" -O ihex -R .eeprom "C:\Users\cliff\DOCUME~1\CIRCUITS\Flowcode\Programs\Flowcode1.elf" "C:\Users\cliff\DOCUME~1\CIRCUITS\Flowcode\Programs\Flowcode1.hex"

HEX file creation successful!

C:\Users\cliff\Documents\CIRCUITS\Flowcode\Programs>"C:\PROGRA~2\MATRIX~1\FLOWCO~1\Tools\MX_bats\..\bin\avr-objcopy" -O coff-avr -R .eeprom "C:\Users\cliff\DOCUME~1\CIRCUITS\Flowcode\Programs\Flowcode1.elf" "C:\Users\cliff\DOCUME~1\CIRCUITS\Flowcode\Programs\Flowcode1.cof"

COFF file creation successful!

Return code = 0

Launching the programmer...
C:\Program Files (x86)\Matrix Multimedia\Flowcode AVR V4\Tools\MX_bats\avrc.bat -cCOM3 -datmega88 -e -if"C:\Users\cliff\DOCUME~1\CIRCUITS\Flowcode\Programs\Flowcode1.hex" -pf -vf

C:\Users\cliff\Documents\CIRCUITS\Flowcode\Programs>"C:\PROGRA~2\MATRIX~1\FLOWCO~1\Tools\MX_bats\..\AVRDUDEusb\avrdude.exe" -p -datmega88 -P COM3 -c stk500 -U flash:w:-pf
avrdude.exe: AVR Part "-datmega88" not found.

Valid parts are:
x256a3 = ATXMEGA256A3 [C:\PROGRA~2\MATRIX~1\FLOWCO~1\Tools\AVRDUDEusb\avrdude.conf:13802]
x128a1 = ATXMEGA128A1 [C:\PROGRA~2\MATRIX~1\FLOWCO~1\Tools\AVRDUDEusb\avrdude.conf:13728]
x128a1d = ATXMEGA128A1REVD [C:\PROGRA~2\MATRIX~1\FLOWCO~1\Tools\AVRDUDEusb\avrdude.conf:13654]
m6450 = ATMEGA6450 [C:\PROGRA~2\MATRIX~1\FLOWCO~1\Tools\AVRDUDEusb\avrdude.conf:13465]
m3250 = ATMEGA3250 [C:\PROGRA~2\MATRIX~1\FLOWCO~1\Tools\AVRDUDEusb\avrdude.conf:13276]
m645 = ATMEGA645 [C:\PROGRA~2\MATRIX~1\FLOWCO~1\Tools\AVRDUDEusb\avrdude.conf:13087]
m325 = ATMEGA325 [C:\PROGRA~2\MATRIX~1\FLOWCO~1\Tools\AVRDUDEusb\avrdude.conf:12898]
usb82 = AT90USB82 [C:\PROGRA~2\MATRIX~1\FLOWCO~1\Tools\AVRDUDEusb\avrdude.conf:12718]
usb162 = AT90USB162 [C:\PROGRA~2\MATRIX~1\FLOWCO~1\Tools\AVRDUDEusb\avrdude.conf:12534]
usb1287 = AT90USB1287 [C:\PROGRA~2\MATRIX~1\FLOWCO~1\Tools\AVRDUDEusb\avrdude.conf:12345]
usb1286 = AT90USB1286 [C:\PROGRA~2\MATRIX~1\FLOWCO~1\Tools\AVRDUDEusb\avrdude.conf:12156]
usb647 = AT90USB647 [C:\PROGRA~2\MATRIX~1\FLOWCO~1\Tools\AVRDUDEusb\avrdude.conf:11968]
usb646 = AT90USB646 [C:\PROGRA~2\MATRIX~1\FLOWCO~1\Tools\AVRDUDEusb\avrdude.conf:11779]
t84 = ATtiny84 [C:\PROGRA~2\MATRIX~1\FLOWCO~1\Tools\AVRDUDEusb\avrdude.conf:11596]
t44 = ATtiny44 [C:\PROGRA~2\MATRIX~1\FLOWCO~1\Tools\AVRDUDEusb\avrdude.conf:11414]
t24 = ATtiny24 [C:\PROGRA~2\MATRIX~1\FLOWCO~1\Tools\AVRDUDEusb\avrdude.conf:11232]
m128rfa1 = ATMEGA128RFA1 [C:\PROGRA~2\MATRIX~1\FLOWCO~1\Tools\AVRDUDEusb\avrdude.conf:11044]
m2561 = ATMEGA2561 [C:\PROGRA~2\MATRIX~1\FLOWCO~1\Tools\AVRDUDEusb\avrdude.conf:10850]
m2560 = ATMEGA2560 [C:\PROGRA~2\MATRIX~1\FLOWCO~1\Tools\AVRDUDEusb\avrdude.conf:10657]
m1281 = ATMEGA1281 [C:\PROGRA~2\MATRIX~1\FLOWCO~1\Tools\AVRDUDEusb\avrdude.conf:10469]
m1280 = ATMEGA1280 [C:\PROGRA~2\MATRIX~1\FLOWCO~1\Tools\AVRDUDEusb\avrdude.conf:10280]
m640 = ATMEGA640 [C:\PROGRA~2\MATRIX~1\FLOWCO~1\Tools\AVRDUDEusb\avrdude.conf:10092]
t85 = ATtiny85 [C:\PROGRA~2\MATRIX~1\FLOWCO~1\Tools\AVRDUDEusb\avrdude.conf:9911]
t45 = ATtiny45 [C:\PROGRA~2\MATRIX~1\FLOWCO~1\Tools\AVRDUDEusb\avrdude.conf:9732]
t25 = ATtiny25 [C:\PROGRA~2\MATRIX~1\FLOWCO~1\Tools\AVRDUDEusb\avrdude.conf:9552]
pwm3b = AT90PWM3B [C:\PROGRA~2\MATRIX~1\FLOWCO~1\Tools\AVRDUDEusb\avrdude.conf:9371]
pwm2b = AT90PWM2B [C:\PROGRA~2\MATRIX~1\FLOWCO~1\Tools\AVRDUDEusb\avrdude.conf:9188]
pwm3 = AT90PWM3 [C:\PROGRA~2\MATRIX~1\FLOWCO~1\Tools\AVRDUDEusb\avrdude.conf:9005]
pwm2 = AT90PWM2 [C:\PROGRA~2\MATRIX~1\FLOWCO~1\Tools\AVRDUDEusb\avrdude.conf:8821]
t2313 = ATtiny2313 [C:\PROGRA~2\MATRIX~1\FLOWCO~1\Tools\AVRDUDEusb\avrdude.conf:8634]
m328p = ATMEGA328P [C:\PROGRA~2\MATRIX~1\FLOWCO~1\Tools\AVRDUDEusb\avrdude.conf:8446]
t88 = attiny88 [C:\PROGRA~2\MATRIX~1\FLOWCO~1\Tools\AVRDUDEusb\avrdude.conf:8260]
m168 = ATMEGA168 [C:\PROGRA~2\MATRIX~1\FLOWCO~1\Tools\AVRDUDEusb\avrdude.conf:8072]
m88 = ATMEGA88 [C:\PROGRA~2\MATRIX~1\FLOWCO~1\Tools\AVRDUDEusb\avrdude.conf:7886]
m48 = ATMEGA48 [C:\PROGRA~2\MATRIX~1\FLOWCO~1\Tools\AVRDUDEusb\avrdude.conf:7699]
t861 = ATTINY861 [C:\PROGRA~2\MATRIX~1\FLOWCO~1\Tools\AVRDUDEusb\avrdude.conf:7511]
t461 = ATTINY461 [C:\PROGRA~2\MATRIX~1\FLOWCO~1\Tools\AVRDUDEusb\avrdude.conf:7322]
t261 = ATTINY261 [C:\PROGRA~2\MATRIX~1\FLOWCO~1\Tools\AVRDUDEusb\avrdude.conf:7133]
t26 = ATTINY26 [C:\PROGRA~2\MATRIX~1\FLOWCO~1\Tools\AVRDUDEusb\avrdude.conf:6976]
m8535 = ATMEGA8535 [C:\PROGRA~2\MATRIX~1\FLOWCO~1\Tools\AVRDUDEusb\avrdude.conf:6818]
m8515 = ATMEGA8515 [C:\PROGRA~2\MATRIX~1\FLOWCO~1\Tools\AVRDUDEusb\avrdude.conf:6660]
m8 = ATMEGA8 [C:\PROGRA~2\MATRIX~1\FLOWCO~1\Tools\AVRDUDEusb\avrdude.conf:6500]
m161 = ATMEGA161 [C:\PROGRA~2\MATRIX~1\FLOWCO~1\Tools\AVRDUDEusb\avrdude.conf:6360]
m32 = ATMEGA32 [C:\PROGRA~2\MATRIX~1\FLOWCO~1\Tools\AVRDUDEusb\avrdude.conf:6185]
m6490 = ATMEGA6490 [C:\PROGRA~2\MATRIX~1\FLOWCO~1\Tools\AVRDUDEusb\avrdude.conf:5992]
m649 = ATMEGA649 [C:\PROGRA~2\MATRIX~1\FLOWCO~1\Tools\AVRDUDEusb\avrdude.conf:5807]
m3290p = ATMEGA3290P [C:\PROGRA~2\MATRIX~1\FLOWCO~1\Tools\AVRDUDEusb\avrdude.conf:5624]
m3290 = ATMEGA3290 [C:\PROGRA~2\MATRIX~1\FLOWCO~1\Tools\AVRDUDEusb\avrdude.conf:5439]
m329p = ATMEGA329P [C:\PROGRA~2\MATRIX~1\FLOWCO~1\Tools\AVRDUDEusb\avrdude.conf:5254]
m329 = ATMEGA329 [C:\PROGRA~2\MATRIX~1\FLOWCO~1\Tools\AVRDUDEusb\avrdude.conf:5070]
m169 = ATMEGA169 [C:\PROGRA~2\MATRIX~1\FLOWCO~1\Tools\AVRDUDEusb\avrdude.conf:4890]
m163 = ATMEGA163 [C:\PROGRA~2\MATRIX~1\FLOWCO~1\Tools\AVRDUDEusb\avrdude.conf:4747]
m162 = ATMEGA162 [C:\PROGRA~2\MATRIX~1\FLOWCO~1\Tools\AVRDUDEusb\avrdude.conf:4551]
m1284p = ATMEGA1284P [C:\PROGRA~2\MATRIX~1\FLOWCO~1\Tools\AVRDUDEusb\avrdude.conf:4361]
m644p = ATMEGA644P [C:\PROGRA~2\MATRIX~1\FLOWCO~1\Tools\AVRDUDEusb\avrdude.conf:4169]
m644 = ATMEGA644 [C:\PROGRA~2\MATRIX~1\FLOWCO~1\Tools\AVRDUDEusb\avrdude.conf:3979]
m324p = ATMEGA324P [C:\PROGRA~2\MATRIX~1\FLOWCO~1\Tools\AVRDUDEusb\avrdude.conf:3788]
m164p = ATMEGA164P [C:\PROGRA~2\MATRIX~1\FLOWCO~1\Tools\AVRDUDEusb\avrdude.conf:3597]
m16 = ATMEGA16 [C:\PROGRA~2\MATRIX~1\FLOWCO~1\Tools\AVRDUDEusb\avrdude.conf:3419]
c32 = AT90CAN32 [C:\PROGRA~2\MATRIX~1\FLOWCO~1\Tools\AVRDUDEusb\avrdude.conf:3228]
c64 = AT90CAN64 [C:\PROGRA~2\MATRIX~1\FLOWCO~1\Tools\AVRDUDEusb\avrdude.conf:3038]
c128 = AT90CAN128 [C:\PROGRA~2\MATRIX~1\FLOWCO~1\Tools\AVRDUDEusb\avrdude.conf:2848]
m128 = ATMEGA128 [C:\PROGRA~2\MATRIX~1\FLOWCO~1\Tools\AVRDUDEusb\avrdude.conf:2670]
m64 = ATMEGA64 [C:\PROGRA~2\MATRIX~1\FLOWCO~1\Tools\AVRDUDEusb\avrdude.conf:2489]
m103 = ATMEGA103 [C:\PROGRA~2\MATRIX~1\FLOWCO~1\Tools\AVRDUDEusb\avrdude.conf:2349]
8535 = AT90S8535 [C:\PROGRA~2\MATRIX~1\FLOWCO~1\Tools\AVRDUDEusb\avrdude.conf:2228]
8515 = AT90S8515 [C:\PROGRA~2\MATRIX~1\FLOWCO~1\Tools\AVRDUDEusb\avrdude.conf:2114]
4434 = AT90S4434 [C:\PROGRA~2\MATRIX~1\FLOWCO~1\Tools\AVRDUDEusb\avrdude.conf:2031]
4433 = AT90S4433 [C:\PROGRA~2\MATRIX~1\FLOWCO~1\Tools\AVRDUDEusb\avrdude.conf:1907]
2343 = AT90S2343 [C:\PROGRA~2\MATRIX~1\FLOWCO~1\Tools\AVRDUDEusb\avrdude.conf:1783]
2333 = AT90S2333 [C:\PROGRA~2\MATRIX~1\FLOWCO~1\Tools\AVRDUDEusb\avrdude.conf:1698]
2313 = AT90S2313 [C:\PROGRA~2\MATRIX~1\FLOWCO~1\Tools\AVRDUDEusb\avrdude.conf:1585]
4414 = AT90S4414 [C:\PROGRA~2\MATRIX~1\FLOWCO~1\Tools\AVRDUDEusb\avrdude.conf:1472]
1200 = AT90S1200 [C:\PROGRA~2\MATRIX~1\FLOWCO~1\Tools\AVRDUDEusb\avrdude.conf:1357]
t15 = ATtiny15 [C:\PROGRA~2\MATRIX~1\FLOWCO~1\Tools\AVRDUDEusb\avrdude.conf:1224]
t13 = ATtiny13 [C:\PROGRA~2\MATRIX~1\FLOWCO~1\Tools\AVRDUDEusb\avrdude.conf:1051]
t12 = ATtiny12 [C:\PROGRA~2\MATRIX~1\FLOWCO~1\Tools\AVRDUDEusb\avrdude.conf:918]
t11 = ATtiny11 [C:\PROGRA~2\MATRIX~1\FLOWCO~1\Tools\AVRDUDEusb\avrdude.conf:854]


Error returned from [avrdude]

Return code = 1

Flowcode was unable to transfer the flowchart to the microcontroller. Check the programmer options and physical connections.

FINISHED


Does anyone have a fix for this?

Sean
Valued Contributor
Valued Contributor
Posts: 548
Joined: Tue Jun 26, 2007 11:23 am
Has thanked: 6 times
Been thanked: 44 times
Contact:

Re: AVR Studio programming issues

Post by Sean »

Hello,

The parameters being sent to the programmer are not compatible with the options available in Flowcode AVR V4.

The default parameter string allows simple selection of the prefered programming utility (usually dictated by the USB driver selected for the AVRISPmkII programmer):

AVRDUDE %a %t "%D\%f.hex" "%f.hex" %cfg %c0 %c1 %c2 %c3

The options are AVRDUDE (AVRDUDE.exe is supplied with Flowcode) and STK500 (STK500.exe is supplied with AVR Studio). The STK500 board can be used with either option.

Other parameter changes need to be made by editing the batch file that controls the programming process.

The file avrc.bat controls programming. It is in the Tools\MX_bats folder of the Flowcode AVR installation. It is recommended that a copy of the original file is used to make a new custom file (avrc_stk500.bat).

All the important settings are at the top of the file (default values):

@SET Programmer=avrispmkii
@SET DUDEPort=usb

@SET STKPort=USB
@SET STKPath="C:\Program Files\Atmel\AVR Tools\STK500\Stk500.exe"


The values in the custom file should be changed to match the new requirements.

@SET Programmer=stk500 (or stk500v2)
@SET DUDEPort=COM3

@SET STKPort=COM3
@SET STKPath="C:\Program Files\Atmel\AVR Tools\STK500\Stk500.exe"

The custom file can then be used to control programming by changing the file name at the end of the programmer location string from avrc.bat to avrc_stk500.bat.

cantronicx
Posts: 16
Joined: Fri Jul 23, 2010 9:53 pm
Has thanked: 4 times
Been thanked: 1 time
Contact:

Re: AVR Studio programming issues

Post by cantronicx »

Thank you for your answer on this so quickly.

However there is still a problem here. For some reason the batch file seems to be passing a part called "-datmega88" of which is not found in the part list. And yet it should be passing the part as "atmega88". I do not see where the extra "-d" is coming from, as it is this is what looks like the problem here.

Can you help on this last bit of the batch file avrc_stk500.bat?

Sean
Valued Contributor
Valued Contributor
Posts: 548
Joined: Tue Jun 26, 2007 11:23 am
Has thanked: 6 times
Been thanked: 44 times
Contact:

Re: AVR Studio programming issues

Post by Sean »

I have attached a copy of a batch file that should work using COM3.
avrc_stk500.zip
(765 Bytes) Downloaded 277 times
The file should be extracted into the Tools\MX_bats folder of the Flowcode AVR installation

This is the string that should be used for the programmer parameters:

AVRDUDE %a %t "%D\%f.hex" "%f.hex" %cfg %c0 %c1 %c2 %c3

The file name at the end of the programmer location string (chip -> compiler options) must be changed from avrc.bat to avrc_stk500.bat to allow the new file to be used.

cantronicx
Posts: 16
Joined: Fri Jul 23, 2010 9:53 pm
Has thanked: 4 times
Been thanked: 1 time
Contact:

Re: AVR Studio programming issues

Post by cantronicx »

thank you very much... it is working great...

I did however made one change to it and removed the "-c%STKPort%" statement so that the programmer stk500 will search for either the stk500 developer board or the avrisp mkii and use that to program. It now works for both without doing any changes.

Post Reply