Where does the IDE get the command line arguments that it uses when it invokes avrdude to upload a sketch? Can they be edited? I have tried modifying the parameters in avrdude.conf for my board but that makes no difference. I would like to change the baudrate to 9600 to see if (by some wild chance) this makes a bricked board useable.
see the file
Arduino\hardware\arduino\avr\platform.txt
Thanks for this. I see that tools.avrdude.program.pattern= has the various command line variables, but the values are just tokens (serial.port, upload.speed, etc). Do I just substitute my desired baud rate for upload.speed, or is there another place where avrdude is getting values for those tokens? Thanks.
You can do that, but it will affect all boards of the platform. The better approach is to modify the values of the property set in the board definitions in the boards.txt
file that is in the same folder as the platform.txt
file.
For example, this line of boards.txt sets the
upload.speed` property to 115200 when you are uploading to the Arduino Uno board:
uno.upload.speed=115200
Some important things to understand when modifying Arduino boards platforms:
You must close all Arduino IDE windows and then start the IDE again before changes to the platform configuration files like platform.txt
and boards.txt
will take effect.
The hardware\arduino\avr
subfolder of the Arduino IDE 1.x installation folder contains the copy of the "Arduino AVR Boards" platform that is included with the Arduino IDE installation. However, if you update to a new version of the platform using the Arduino IDE Boards Manager (which is likely since several new releases of the platform have been made since the last Arduino IDE 1.x release), the update is installed to a completely different location and the copy of the platform in the hardware\arduino\avr
subfolder of the Arduino IDE 1.x installation folder is no longer used. So you will have a very confusing and frustrating time if you are modifying a different copy of the platform than the one the IDE is using. You can learn the location of the platform in use for a given board by enabling verbose compilation output in the Arduino IDE preferences, compiling for the board of interest, then examining the contents of the black output panel at the bottom of the Arduino IDE window after the compilation finishes.
The Arduino boards platform system is documented here:
https://arduino.github.io/arduino-cli/latest/platform-specification/
If you are interested in learning about the Arduino boards platform framework, then by all means take a look at these files and perform some methodical experiments. But if your only purpose is to try to unbrick your board then you are completely wasting your time. You would be better off to provide a detailed description of the problem and get the assistance of the forum members.
This is very helpful; thanks for posting it. While I am interested in finding out if I can salvage this Uno board, I also am interested in gaining a better understanding of how this all works. The board stopped working after something went wrong with small motor that it was controlling through a relay. Loop-back testing on the damaged board using serial monitor doesn't work entirely - the LED on the Uno does flash when the character is sent but isn't echoed back. I believe I succeeded in reinstalling the bootloader on the damaged board, using another Uno that works fine. However, the damaged Uno still doesn't allow the IDE to upload a sketch. I really doubt that uploading at 9600 instead of 115200 will solve the problem, but I would like to find out. I appreciate your explanation and the link to documentation. Thanks.
Check the UNO schematic, you likely burned the 16U2. Board may be usable using your 2nd UNO as ArduinoISP, but for serial, you'll need to use an external USB-serial adapter.
Very cool! I personally find the subject of the Arduino boards platform system very interesting. Please let us know if you have any problems or questions.
Even though I cannot upload a sketch, I can still obtain the board info. Does that bypass the serial connection? Also, does an external USB-serial adapter connect to the ICSP pins on the board, and then make the IDE functional again?
The answer depends on which version of Arduino IDE you are using. Please tell us which version you are using and we will provide the answer. The version is shown on the window title bar and also in the Help > About dialog.
The above uses the serial port to interrogate the board bootloader.
ONLY a bootloader responds to serial comm (Rx/Tx) so the answer is "no."
ICSP can be created from a dedicated device or An Arduino running the Arduino As ICSP sketch.
Arduino as ISP and Arduino Bootloaders | Arduino Documentation | Arduino Documentation
Only in Arduino IDE 1.x. Arduino IDE 2.x's Tools > Get Board Info feature only shows data from the board definition in boards.txt
. So it does not provide any indication at all of the status of the hardware.
Oh, my!
My bad as I have used long ago and it really did work, or maybe I just thought it did... how could such a bad issue get propagated when what should have been done was to "gray" out the option.
50 lashes to delveloper with a wet depont jumper.
If it was "long ago", were you using Arduino IDE 1.x?
Why do you consider it "such a bad issue"? I have not seen evidence that any significant number of users even use this feature. How many are interested in knowing the VID/PID and serial number?
I wouldn't say the behavior of the feature in Arduino IDE 2.x is even necessarily wrong other than in the context of the Arduino IDE 1.x behavior. Arduino IDE 2.x's "Get Board Info" actually does what it says on the tin by providing the information about the selected board's definition. Arduino IDE 1.x's "Get Board Info" is more of "port info" than it is "board info". That said, I do think the port info is more useful.
I'm a little confused. The board info includes the SN, which doesn't come from boards.txt. It's obtained from the board, isn't it? I'm wondering if since the IDE can successfully obtain that, does it help clarify what is still working and what is not (in light of the fact that I cannot upload sketches via the IDE. Also, in playing with this and running avrdude from the command line, I've managed to trash the SN on the working board -- Get Board Info now returns "null" for its serial number. No other error messages and uploads still work, so am I correct in assuming I've managed to inadvertently overwrite the memory where the SN is stored?
@couldabin if you would take the time to answer the question I asked yesterday then you wouldn't need to be confused because I would be able to provide a correct answer instead of having to guess which IDE version you are using:
I apologize -- I missed your question. I am using 1.8.19. Thanks for your patience.
In Arduino IDE 1.x, yes.
Not really. It tels us that the computer recognizes the USB device created by the ATmeaga16U2 chip on the Uno, but this fact is already indicated by the presence of a serial port for the board in Arduino IDE's Tools > Port menu. It gives more information about that USB device, but the information is not really relevant.
The VID/PID tells us which USB to serial adapter chip the board is using (e.g., Microchip ATmega16U2 vs WCH CH340), but that information is mostly only needed in the case where there is no port for a board due to missing drivers, and if there was no port then you couldn't use the "Get board info" feature anyway.
It is possible the serial number can be correlated to some manufacturing and distribution data that might be useful in the specific case where hardware design or firmware version is suspected as the cause (which I do not at all suspect), but that would require access to a hypothetical serial number database that only certain people (e.g., customer support staff) have access to, so not useful to the users or community helpers.
I don't know enough about the ATmega16U2 microcontroller that provides this information (note that the information provided by the Arduino IDE 1.x "Get board info" feature comes exclusively from the USB chip on the board, not the primary ATmega328P microcontroller) to say whether or not that is possible. If the uploads are working I wouldn't worry about it.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.