Code::Blocks Forums

User forums => Embedded development => Topic started by: halfboy on July 06, 2014, 05:01:47 pm

Title: Configure CB with AVR on Linux Ubuntu
Post by: halfboy on July 06, 2014, 05:01:47 pm
Hello everyone. At the beggining: if this post is in bad category, i'm sorry, please move it.

I'm new user of Code::Blocks and I think it's really nice IDE but I have a big problem and I don't know how to solve it. I would like to start programming microcontrollers. I chosed Atmel AVR as are very popular in my country. Moreover I'm using Linux Ubuntu and Code::Blocks 12.11 . I've installed program with these commands :

Code
sudo apt-get install avr-libc
sudo apt-get install binutils
sudo apt-get install uisp
sudo apt-get install avrdude
sudo apt-get install codeblocks
sudo apt-get install --reinstall libc6-dev
sudo ln -s /usr/include/i386-linux-gnu/* /usr/lib/avr/include/

then I come to Code::Blocks, click "New Project" and I try to compile simple program. The result is:

Code

-------------- Build: Release in test3 (compiler: GNU AVR GCC Compiler)---------------

avr-gcc -Wall -mmcu=atmega32 -DF_CPU=16000000UL  -Os    -I/usr/include  -c main.c -o obj/Release/main.o
avr-g++ -L/usr/lib  -o bin/Release/test3.elf obj/Release/main.o   -mmcu=atmega32 -Wl,-Map=bin/Release/test3.map,--cref 
Output size is 3,73 KB
Running project post-build steps
avr-objdump -h -S bin/Release/test3.elf > bin/Release/test3.lss
avr-objcopy -R .eeprom -R .fuse -R .lock -R .signature -O ihex bin/Release/test3.elf bin/Release/test3.hex
avr-objcopy --no-change-warnings -j .eeprom --change-section-lma .eeprom=0 -O ihex bin/Release/test3.elf bin/Release/test3.eep
avr-objcopy --no-change-warnings -j .lock --change-section-lma .lock=0 -O ihex bin/Release/test3.elf bin/Release/test3.lock
avr-objcopy --no-change-warnings -j .signature --change-section-lma .signature=0 -O ihex bin/Release/test3.elf bin/Release/test3.sig
avr-objcopy --no-change-warnings -j .fuse --change-section-lma .fuse=0 -O ihex bin/Release/test3.elf bin/Release/test3.fuse
srec_cat bin/Release/test3.fuse -Intel -crop 0x00 0x01 -offset  0x00 -O bin/Release/test3.lfs -Intel
[b]srec_cat: bin/Release/test3.fuse: 1: file contains no data
Process terminated with status 1 (0 minutes, 0 seconds)
0 errors, 0 warnings (0 minutes, 0 seconds)[/b]
 

Earlier I had problem with srec_cat but i found in the web solution. Now I can't find the solution of my problem...

I would be very grateful if anyone could help me.

Thanks in advance.

P.S. I hope my English is understandable for everyone :)
Title: Re: Configure CB with AVR on Linux Ubuntu
Post by: scarphin on July 06, 2014, 09:51:55 pm
I fail to understand what your problem is, can you please be more clear with what has gone wrong? According to your build log, the only issue seems to be the empty fuse file. That is completely normal if you haven't defined any fuses inside your code though. For further inspection, do you have a 'test3.hex' file inside your 'project_path/bin/release/' folder?
Title: Re: Configure CB with AVR on Linux Ubuntu
Post by: halfboy on July 06, 2014, 10:43:44 pm
ehhh... you're completely right... I didn't notice this .hex files and I thought that these build logs are errors. So that .hex file I can program to avr? I'm so stupid...

So if I'll define fuses in code this notice will dissapear ?

THANKS !
Title: Re: Configure CB with AVR on Linux Ubuntu
Post by: scarphin on July 06, 2014, 11:43:59 pm
So if I'll define fuses in code this notice will dissapear ?
If you do it the right way, yes. And (a) fuse file(s) will be generated that you can also program into the AVR with AVRDude.
Title: Re: Configure CB with AVR on Linux Ubuntu
Post by: halfboy on July 07, 2014, 12:02:20 am
Thank you very much for help ! :)