Pages: [1]   Go Down
Author Topic: Uploading C code on bootloaded Atmel328p  (Read 585 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
stk500v2_ReceiveMessage(): timeout

Here are the commands I've used:
Code:
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

Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 210
Posts: 13039
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


avrdude -v -p m328p -c arduino -P /dev/ttyUSB1 -e -U flash:w:blink_try.hex
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

it worked, thanks! smiley 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?
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 210
Posts: 13039
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

it worked, thanks! smiley

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.
Logged

Pages: [1]   Go Up
Jump to: