Compile AVR Code in Raspberry Pi

Posted

in

by

I have recorded a video showing the steps to compile AVR code.

In this video, you will see how to compile AVR led blinking code for the atmega32 microcontroller is being compiled using AVR-GCC in raspberry pi 3 b+.

Step 1. : Create a file and put your avr c code in that file. Save that file with a “.c” extension

Step 2. : Run the following commands one by one

avr-gcc -g -0s -mmcu=atmega32 -c led.c
avr-gcc -g -mmcu=atmega32 -o led.elf led.o
avr-objcopy -j .text -j .data -o ihex led.elf led.hex

Step 3. : The step 2 will create a hex file. which can be uploaded to the microcontroller with the help of a programmer.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *