News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

Execution error with AVR's

Started by ima bucket, May 27, 2013, 05:31:30 AM

Previous topic - Next topic

ima bucket

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:

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.

Jenna

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.

ima bucket

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:

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?

BlueHazzard

Quote from: ima bucket on May 27, 2013, 07:23:48 AM
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:

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

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


Quote from: ima bucket on May 27, 2013, 07:23:48 AM
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"...

ima bucket

#4
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:

"${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

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


Thanks Guys!

scarphin

Is there a specific reason for why you use a 'makefile' approach instead of the CB build system?

ima bucket

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

stahta01

Quote from: ima bucket on May 31, 2013, 02:17:55 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.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

scarphin

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.