Code::Blocks Forums

User forums => Help => Topic started by: ima bucket on May 27, 2013, 05:31:30 am

Title: Execution error with AVR's
Post by: ima bucket on May 27, 2013, 05:31:30 am
Hey Guys,

I am quite sure I haven't configured this properly but I can't seem to find the correct answer to what I am looking for. At this stage I have left CB with the default makefile. When I "build and run" with F9 i get:

Code
Checking for existence: C:\Ryan\C Project\ss\bin\Debug\ss.elf
Executing: "C:\Ryan\C Project\ss\bin\Debug\ss.elf"  (in C:\Ryan\C Project\ss\)
Execution of '"C:\Ryan\C Project\ss\bin\Debug\ss.elf" ' in 'C:\Ryan\C Project\ss' failed.
Nothing to be done (all items are up-to-date).

The hex file is created I am just looking to see if I can possibly use the "run" section of this for the use of the make file. and ultimately to fix this error.

Quick question as well, without creating a new project, how would I change the microcontroller and frequency I have selected, I would assume the obvious answer to be in Project Properties, but I can't find it in this section :(

Cheers,
Ryan.
Title: Re: Execution error with AVR's
Post by: Jenna on May 27, 2013, 06:21:36 am
What do you try ?

How should windows execute an elf-file ?

If you use custom makefiles, the buid-process is controlled by them, not by C::B.
You  have to change parameters in the makefile or (probably) in the call of the makefile.
For the last look into the "Make" commands tab in the build-options.
Title: Re: Execution error with AVR's
Post by: ima bucket on May 27, 2013, 07:23:48 am
Found the later thanks.

I just had another read up on makefiles, it seems I was incorrect in stating that the makefile was my issue as that, if I am correct, only relates to compiling the application. The issue i was hoping to resolve was for execute or specifically, "Run" to relate do a similar thing to utilising a winavr command in console, executing something like:

Code
avrdude -c usbasp -B 1 -p ATmega644P -U flash:w:CT_COMBO.hex -F

And for why on earth it defaults to believe that it should execute the .elf file?
Title: Re: Execution error with AVR's
Post by: BlueHazzard on May 27, 2013, 01:53:20 pm
The issue i was hoping to resolve was for execute or specifically, "Run" to relate do a similar thing to utilising a winavr command in console, executing something like:

Code
avrdude -c usbasp -B 1 -p ATmega644P -U flash:w:CT_COMBO.hex -F

You can create a custom Tool: Tools->Configure Tools->Add


And for why on earth it defaults to believe that it should execute the .elf file?
This is default behaver, normally c::b is used for PC Application, and there it is normal to execute the builded file... And run means "run" and not "do something i don't know what, but please do"...
Title: Re: Execution error with AVR's
Post by: ima bucket on May 28, 2013, 02:05:12 am
Well that just makes too much sense. :(

I like the Custom bound Tool btw, thanks! So I would also gather at this point it is impossible to script or change the run file without recompiling C::B itself?

I have used the parameters:

Code
"${PROJECT_NAME}\${TARGET_OUTPUT_DIR}${TARGET_OUTPUT_BASENAME}.hex"

With a batch file and creating a custom key profile for AVR's that work quite well now. For my final question I would like to ask if it was possible to script in an automated check on the document type for changing the key profile based on the AVR or default.
pseudo code example

Code
if (DococType == AVR)
keyprofile = "AVR";
else
keyprofile = primary;

Thanks Guys!
Title: Re: Execution error with AVR's
Post by: scarphin on May 28, 2013, 10:35:20 am
Is there a specific reason for why you use a 'makefile' approach instead of the CB build system?
Title: Re: Execution error with AVR's
Post by: ima bucket on May 31, 2013, 02:17:55 am
Sorry for late reply.

I am actually using the default makefile of the CB build system at this stage with bootloader parameters loaded into settings. The above was actually for a "run" style script where it would just flash the chip by pressing F10
Title: Re: Execution error with AVR's
Post by: stahta01 on May 31, 2013, 03:22:27 am
I am actually using the default makefile of the CB build system at this stage with bootloader parameters loaded into settings. The above was actually for a "run" style script where it would just flash the chip by pressing F10

There is NO such choice as the "default makefile" of the CB build system!

You either use the normal CB Build system or you use a custom makefile.
Which is it?

Tim S.
Title: Re: Execution error with AVR's
Post by: scarphin on May 31, 2013, 11:31:51 am
You don't have to use a custom makefile to flash the chip. You can use the 'tools' menu to define a 'flash' command and execute that by its keyboard shortcut or from the tools menu after the build process.