The OS I am using is Windows 10, and I already installed avr-gcc and avr-dude, with a bit of search on the internet I found the commands to convert my C program (written for ATMEGA328-P), to the object file and then to the hex file using avr-objcopy, but now I want to know the command to burn this hex file via the Command Prompt. I used
avrdude -v -V -patmega328p -carduino -PCOM* -b115200 -D -Uflash:w:hexfilename.hex
this command in response I got the following:-
C:\Users\AshishHJog\Desktop\Arduino\Bare Metal\Try>avrdude -v -V -patmega328p -carduino -PCOM6 -b115200 -D -Uflash:w:myhex.hex
avrdude: Version 5.11-Patch#7610, compiled on Aug 31 2011 at 08:02:19
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2009 Joerg Wunsch
System wide configuration file is "C:\Users\AshishHJog\Desktop\Arduino\Bare Metal\avrdude-5.11-Patch7610-win32\avrdude.conf"
Using Port : COM6
Using Programmer : arduino
Overriding Baud Rate : 115200
AVR Part : ATMEGA328P
Chip Erase delay : 9000 us
PAGEL : PD7
BS2 : PC2
RESET disposition : dedicated
RETRY pulse : SCK
serial program mode : yes
parallel program mode : yes
Timeout : 200
StabDelay : 100
CmdexeDelay : 25
SyncLoops : 32
ByteDelay : 0
PollIndex : 3
PollValue : 0x53
Memory Detail :
Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
eeprom 65 20 4 0 no 1024 4 0 3600 3600 0xff 0xff
flash 65 6 128 0 yes 32768 128 256 4500 4500 0xff 0xff
lfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
hfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
efuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
lock 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
calibration 0 0 0 0 no 1 0 0 0 0 0x00 0x00
signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00
Programmer Type : Arduino
Description : Arduino
Hardware Version: 3
Firmware Version: 4.4
Vtarget : 0.3 V
Varef : 0.3 V
Oscillator : 28.800 kHz
SCK period : 3.3 us
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.01s
avrdude: Device signature = 0x1e950f
avrdude: safemode: lfuse reads as 0
avrdude: safemode: hfuse reads as 0
avrdude: safemode: efuse reads as 0
avrdude: reading input file "myhex.hex"
avrdude: input file myhex.hex auto detected as Intel Hex
avrdude: writing flash (124 bytes):
Writing | ################################################## | 100% 0.03s
avrdude: 124 bytes of flash written
avrdude: safemode: lfuse reads as 0
avrdude: safemode: hfuse reads as 0
avrdude: safemode: efuse reads as 0
avrdude: safemode: Fuses OK
avrdude done. Thank you.
**It seems the hex is flashed from the response but I am not getting the expected output, (expected output:- I wrote a very simple c program to blink the led on digital pin 3 same code when uploaded via microchip studio or Arduino ide works but when I upload it using the above command it doesn't work as expected ). **