-
Notifications
You must be signed in to change notification settings - Fork 446
error on programming(make upload) #114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The error message says that, it was not able to find a Mega in port Are you sure you have a working Arduino mega connected in port |
I am sure.It is working fine when i use arduino IDE.
I use fedora15 as my os. |
Can you add the following line in your makefile (which will enable verbose output for avrdude) and then post the entire output?
|
|
It still shows that there is some problem with the board. Can you also enable verbose output in Arduino IDE and post that output as well? |
ok, i put the log on pastebin, here is link This board doesn't a standard arduino mega2560.It is a compatible board. |
I see that both are issuing the same avrdude command. Since you mentioned that it is a compatible board, what are you selecting in the boards menu in Arduino IDE? You are select Arduino Mega or something else? Also can you try the same sketch in both Arduino IDE and makefile? Just to rule out any sketch specific issues. |
I select board is arduino mega 2560 on Arduino IDE.And this time i use your example program, the webserver. Two is webserver on arduino-makefile |
This is really really strange, since both are issuing similar command to avrdude IDE is issuing
Where as make file is issuing
I don't see any difference in these commands. You said it is a Mega compatible board. Can you give me more details about this board? Is there a link or something? Also as a final resort, can you execute this command manually after doing
|
I have execute that command, it's programming is right.I saw some info about the board, all is same with standard.May be other place have a problem. |
I find the difference of that two commands.The Arduino IDE use -D parameter in command. Reading | ################################################## | 100% 0.01s avrdude: Device signature = 0x1e9801 It's programming success,when i add -D parameter after do_upload in Arduino.mk file. |
the makefile also uses the -V (note uppercase = do not verify) when combined with -D (disable auto erase) it makes you wonder if -D is just silently failing and you have bad flash memory. do the sketches actually work? |
I try to programming more times and it works fine.You means the flash memory is bad.Why arduino IDE add this parameter? It will check flash before programming and to decide add -D or not.Is this right? |
no the -D flag is set if in the IDE you tick the box that says "verify code after upload" in File->Preferences. I really don't see how -D is solving your problem, unless its some weird timing thing. |
@Blackrose Is it working fine with the makefile? As @sej7278 suggested, I guess there was some problem with the flash memory. Can you try a very simple sketch like Blink and confirm that it works both with makefile and with the IDE? |
@Blackrose So is it working if you add the |
@sudar yeah, it works fine. |
@Blackrose Thanks for confirming that it works. I am closing the ticket for now. |
I also just ran into this problem, it seems that the chip erase command is somehow not supported by the Arduino Mega2560's bootloader (that, or avrdude is sending the wrong command somehow). Perhaps Arduino-Makefile can also unconditionally pass -D to avrdude (just like the IDE does), to suppress the auto-erase? IIUC, this only means that any parts of the flash not overwritten by the upload will just remain at their old values instead of being erased to 0xff, which I guess shouldn't hurt? Looking at the stk500v2 bootloader sources, it seems that the erase command indeed isn't supported. The source says:
On the other hand, the code also has no-op handling for the CMD_CHIP_ERASE_ISP command. Running avrdude with enough -v's shows that this is indeed the command run (0x12 about halfway the message):
However, the return status returned by my Mega 2560 is 0xc0, which is STATUS_CMD_FAILED not STATUS_CMD_OK as the code shows. Looking a bit further, it seems this was changed in the IDE branch: |
@matthijskooijman Thanks for digging this up and also for the detailed analysis.
It is always better to emulate the IDE as much as possible to prevent any compatibility issues. Will do this. |
ide 1.0.5 doesn't pass -D to avrdude
|
That's weird, the code says it always adds -D: https://github.com/arduino/Arduino/blob/1.0.5/app/src/processing/app/debug/AvrdudeUploader.java#L169 I wonder if I'm looking at the wrong code... |
@sej7278 I just tried in both Arduino 1.0.5 and 1.5.4 that I downloaded from Arduino website and they indeed seem to be adding
Did you download your Arduino IDE from arduino website or installed it using some other means? |
no i used the debian package, which seems to have the line mentioned above in its source, and i can't find a patch that removes it.... |
I just also tried the Debian version 1:1.0.5+dfsg2-1 and it's passing -D normally:
Weird... |
Same problem here too. Adding the -D flashes the chip successfully, but doesn't erase it beforehand, which could lead to problems, I guess... |
I read readme and setting environment.When i use project WebServer to test it.I got these errors,Could i have resolve it?
make reset
make do_upload
The text was updated successfully, but these errors were encountered: