Go Down

Topic: Uploading C code on bootloaded Atmel328p (Read 664 times) previous topic - next topic

Hi,

Using Nick Gammon's excellent tutorial (http://www.gammon.com.au/forum/?id=11637), I was able to burn a bootloader on an atmel328p chip. As in the tutorial, I tried to upload a couple of arduino sketches (printing ASCII table over the serial port, blinking LED) and they seemed to work fine.

Now, I am trying to upload a simple C program to blink an LED following this tutorial : http://www.micahcarrick.com/tutorials/avr-microcontroller-tutorial/getting-started.html

I am having trouble with avrdude when it tries to upload it to the chip. Here is the error I am getting :
Code: [Select]
stk500v2_ReceiveMessage(): timeout

Here are the commands I've used:
Code: [Select]

avr-gcc -mmcu=atmega328p -Wall -Os -o blink_try.elf blink_try.c
avr-objcopy -j .text -j .data -O ihex blink_try.elf blink_try.hex
avrdude -v -p m328p -c stk500 -P /dev/ttyUSB1 -e -U flash:w:blink_try.hex


I am not sure what's going on.

-yogesh


Coding Badly


[font=Courier New]avrdude -v -p m328p -c arduino -P /dev/ttyUSB1 -e -U flash:w:blink_try.hex[/font]

it worked, thanks! :) I do have a question though. Is the arduino bootloader a generic one? ie, can we load a standard AVR C program onto a chip containing a bootloader loaded from the arduino IDE?

Coding Badly

it worked, thanks! :)


Excellent.  You are welcome.

Quote
Is the arduino bootloader a generic one?


It uses the STK500v1 protocol so, yes, it is a "generic" bootloader.

Quote
ie, can we load a standard AVR C program onto a chip containing a bootloader loaded from the arduino IDE?


Yes.

EEPROM data is not supported by Optiboot.

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy