Programming Arduino Mega2560

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 6.

Moderator: Benj

Post Reply
User avatar
stregato
Posts: 18
Joined: Tue Feb 25, 2014 12:28 am
Been thanked: 3 times
Contact:

Programming Arduino Mega2560

Post by stregato »

After reading several posts for the settings and configuration of the problem that I found myself in programming arduino Mega2560 was always this: :(

Avvio del programmatore...
C:\Program Files (x86)\Flowcode 6\compilers\avr\bin\avrdude.exe -c stk500v2 -p m2560 -P COM6 -b 115200 -U flash:w:"led pulse.hex":a
...............
avrdude.exe: stk500_2_ReceiveMessage(): timeout
..............
avrdude.exe: stk500_2_ReceiveMessage(): timeout
..............
avrdude.exe: stk500_2_ReceiveMessage(): timeout
..............
avrdude.exe: stk500_2_ReceiveMessage(): timeout
C:\Program Files (x86)\Flowcode 6\compilers\avr\bin\avrdude.exe ha riportato il codice di errore 255
TERMINATO

Given that the problem is reported by several users I waited several days hoping that MATRIXmultimedia should release the solution then I decided to bang your head until you try scaraicare this test to download what I found in various distributions AVRDUDE 2 files replaced with those present in the folder where you installed Flowcode finally solved the problem.
The tests are conducted by me only at module ARDUINO MEGA 2560
Image


Please administrators to block the link to my google drive where I hosted the files that I extracted from a package AVRDUDE
Those who need it can safely benefit from it

https://drive.google.com/file/d/0B3X-i1 ... sp=sharing

Avvio del programmatore...
C:\Program Files (x86)\Flowcode 6\compilers\avr\bin\avrdude.exe -c stk500v2 -p m2560 -P COM6 -b 115200 -U flash:w:"led pulse.hex":a

avrdude.exe: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.02s

avrdude.exe: Device signature = 0x1e9801
avrdude.exe: NOTE: FLASH memory has been specified, an erase cycle will be performed
To disable this feature, specify the -D option.
avrdude.exe: erasing chip
avrdude.exe: stk500v2_command(): command failed
avrdude.exe: reading input file "led pulse.hex"
avrdude.exe: input file led pulse.hex auto detected as Intel Hex
avrdude.exe: writing flash (940 bytes):

Writing | ################################################## | 100% 0.14s

avrdude.exe: 940 bytes of flash written
avrdude.exe: verifying flash memory against led pulse.hex:
avrdude.exe: load data flash data from input file led pulse.hex:
avrdude.exe: input file led pulse.hex auto detected as Intel Hex
avrdude.exe: input file led pulse.hex contains 940 bytes
avrdude.exe: reading on-chip flash data:

Reading | ################################################## | 100% 0.09s

avrdude.exe: verifying ...
avrdude.exe: 940 bytes of flash verified

avrdude.exe done. Thank you.

TERMINATO :P :P


Result after the substitution of the above files again tested only with ARDUINO MEGA 2560

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Programming Arduino Mega2560

Post by Benj »

Hello,

Many thanks for posting about the problem and the fix.

It's very much appreciated and we will update our files based on your findings to try and avoid other users coming across this issue.

JoeT
Posts: 14
Joined: Tue Sep 03, 2013 9:20 pm
Has thanked: 1 time
Contact:

Re: Programming Arduino Mega2560

Post by JoeT »

I have just downloaded FCv6.1.2.0 (11.05.2015)
And I am having the same issue.

////////////////////////////////////
Launching the programmer...
C:\Program Files (x86)\Flowcode 6\compilers\avr\batchfiles\avrc_arduinoB.bat m2560 stk500v2 com7 115200 "Blinky.hex"

C:\Users\JoeT\DOCUME~1\FlowCode\ARDUIN~1>"C:\PROGRA~2\FLOWCO~1\COMPIL~1\avr\BATCHF~1\..\bin\oldavrdude\avrdude.exe" -p m2560 -P com7 -b 115200 -c stk500v2 -U flash:w:"Blinky.hex"
................
avrdude.exe: stk500_2_ReceiveMessage(): timeout
....
C:\Program Files (x86)\Flowcode 6\compilers\avr\batchfiles\avrc_arduinoB.bat reported error code 255

FINISHED
/////////////////////////

Have any changes been incorporated for the FC for AVR's yet?
Before I start modifying files with one that are 2 years old I thought I would ask first.

I have tried to edit the Compiler Options - Programmer tab but it will not let me edit the values. I did a compiler option save and made a new setting called Arduino and I still can not edit the values.

TIA
JoeT

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Programming Arduino Mega2560

Post by Benj »

Hello,

This is the state of play as far as I am aware.

The Mega 2560 R3 will program fine with Flowcode as is using the latest v6 release.

The Mega 2560 will not program with the latest v6 release. We have used the latest AVRdude software and also tried multiple variations with no real success. Something seems to have changed. Therefore our current workaround to program this device is to use a 3rd party tool named Xloader. This takes the hex file generated by Flowcode and allows you to reprogram the Mega 2560. It's a bit more of a manual process but it works reliably.

If you want to have a try with the above workaround on your system then please let us know how you get on.

JoeT
Posts: 14
Joined: Tue Sep 03, 2013 9:20 pm
Has thanked: 1 time
Contact:

Re: Programming Arduino Mega2560

Post by JoeT »

Thanks for the fast reply.
I compiled to hex and used the Arduino loader from Atmel Studio and it programmed!

I guess I will start buying R3's from now on!

OK 1 more question.
I exported the Compiler configuration and edit the file with note pad. Imported the file back to the Compiler option. But it doesn't save the file.
After import I saved the Configuration to another name. And when I return to the Compiler settings they are back the way they were.

JoeT

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Programming Arduino Mega2560

Post by Benj »

Hi JoeT,

The Arduino devices have their compiler option settings hard coded in the definition file. This overrides the settings in the compiler options window which is why you are seeing your changes overwritten.

Go into the "Flowcode 6/FCD/AVR" folder and copy the Arduino .fcdx definition file you wish to edit to your desktop.

Open the file with a text editor e.g. notepad or textpad and the compiler options are coded right at the top of the file.

Make your changes, save the file and copy back to the "Flowcode 6/FCD/AVR" folder. Reload your Flowcode project and the changes should be in effect.

You may want to create a backup of the file first so you can easily go back if you need to.

Post Reply