Code::Blocks

Developer forums (C::B DEVELOPMENT STRICTLY!) => Plugins development => Topic started by: ZinnJonas on February 25, 2013, 03:34:12 am

Title: avrdude
Post by: ZinnJonas on February 25, 2013, 03:34:12 am
Hey all,

a few days before i started with coding for the AVR microcontroller, they are nice integrated in c::b, but i couldn't find a plug in to bring the source file in the controller.
So i hade to use avrdude, like the most guys i guess. There are some nice gui's out there like Burn-O-mat, but i don't want to leave my ide all the time to burn the controller.
So i started to wrote a cbavrdude, which will be handy like the Burn-O-Mat.

It was written, wo burn the controller, each time a AVR project is compiled successfully.

U can configure it like the Burn-O-Mat:

(https://sourceforge.net/p/cbavrdude/screenshot/settings.PNG)

i hope i can integrate that u can start the burning manuel and read/write/set of fuses, but i'm some kind of busy at the moment.

the svn link is: svn://svn.code.sf.net/p/cbavrdude/code-0/trunk
the projekt is at: https://sourceforge.net/projects/cbavrdude/

maybe  it would be nice, if i could put the log output on the "bulid code" logger, but didn't find a way to get the log there, can someone help me there ?
and if someone has nice ideas for images ;)
Title: Re: avrdude
Post by: oBFusCATed on February 25, 2013, 07:04:42 am
Have you tried to setup a tool for avrdude instead of a full blown plugin?

p.s. the settings probably should go in the settings -> compiler dialog instead of settings -> env.
Title: Re: avrdude
Post by: LETARTARE on February 25, 2013, 11:13:18 am
hello,
I've loaded your project from svn SourceForge.
Compile on my system (see below) generates errors:
Quote
avrdudeConfig.h:27:3: error: 'wxLed' does not name a type
and
Quote
avrdudeConfig.cpp: 20:2: error: 'avrdudeFound' was Not Declared in this scope
and
Quote
avrdudeConfig.cpp:23:2: error: 'configFound' was not declared in this scope

In the 'wxs' Led are misnamed, it lacks
Quote
Identifier: ID_LED1 -> Var name: avrdudeConf, instead of 'Custom1'
and
Quote
Identifier: ID_LED2 ->  Var name: configFound, instead of 'Custom2'

and I added
Quote
# include "wx/led.h"
before generated code  //(*... //*)

With these modifications generation is correct.
I guess for you it is not necessary?
Title: Re: avrdude
Post by: oBFusCATed on February 25, 2013, 11:58:48 am
About the wxLed -> why don't you set the bg and text colours of the text ctrl to red/white for example, if the path is not valid. This is how I do it at other places in the ide.
Title: Re: avrdude
Post by: ZinnJonas on February 25, 2013, 12:06:40 pm
Hey,

i will try to move it to compilers page and a plugin for the avrdude is ok  i think, so i don't have to leave the ide for burning the chip.

@letartare, can u set the compiler include path from "." to "wx\.." ? u u should be able to build it that way.

I like the mini led's there is a plugin for these in the svn wxSmithContribItems and wxContribItem or even the plugin i wrote wxLedPlugin.
U can set the color of the path, true, but in my opinion it looks smoother this way. But u are free to change.
Title: Re: avrdude
Post by: danselmi on February 25, 2013, 02:28:14 pm
As obf suggested, you can use the following tool to program the flash:
Code: [Select]
Name: AVRDUDE write flash
Executable: C:\tools\avrdude\avrdude.exe
Parameters: -p ${MCU} -c avrftdi -v -U flash:w:$(TARGET_OUTPUT_BASENAME).hex:i
Working direcotry: $(TARGET_OUTPUT_DIR)
and similar calls to program the eeprom and the fuses.

This is a bad idea:
Quote
burn the controller, each time a AVR project is compiled successfully.
Since you are wasting write/erase cycles this way.