News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

Customize "Run" Button

Started by _WG_, August 22, 2017, 02:18:47 PM

Previous topic - Next topic

_WG_

Hello to everyone!

I use Code::Blocks a lot for embedded programming (STM32 and AVR). But up to now i did not found a solution to use the "Run" button or "Build and Run" Button to flash the controller.
At the moment i use Tool-Buttons in the menu, but now i do have 8 different buttons for the different controllers.

It would be helpful, if the customized "Run" Button use project dependent settings and not global settings.

Is there any solution you you can add this to the Development Todo-List?

Thx.

christobal

You can use the "Tools" menu with C::B Makros.
I use it to start the debugger and pass ${TARGET_OUTPUT_FILE} as parameter, which refers to the build target output file (.elf in my case).


_WG_

I know this and thats the way i do the last years. But this is not project dependent and to use "Run" or "Build+Run" would be very nice.

oBFusCATed

You can use post build steps to flash the controller. This is the only way to do it at the moment.
Probably you can experiment with commands only target and see if running it could be used to flash controllers.
I've never done it, so if this works I'll be happy to learn how.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

christobal

Quote from: _WG_ on August 22, 2017, 07:13:26 PM
I know this and thats the way i do the last years. But this is not project dependent and to use "Run" or "Build+Run" would be very nice.

You can use "Custom Variables" to define the controller type (i guess that's whats project dependent in your case). You can use these Variables just like the "normal" macros in the "tools" menu.

_WG_

Hi christibal,
thx for the answer. This could improve the usability. I will try it.
But any chance to use the play button for flashing? Maybe with custom variable "hacks"?


oBFusCATed

I'll see what could be done about this, but it won't happen soon.
If you feel like it you could add a feature request in our tracker at the project page on sf.net.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

BlueHazzard

What are you using to flash the controller?
it would be possible to use the debug button to flash the controller, if you have a gdb supported debugger

oBFusCATed

#8
He is probably using avrdude...
How could a debugger help for flashing?
Using the jtag or similar interface?

I'm thinking that we could extend the host app field in a way to allow the execution of more commands than just the host app.
Unfortunately the host app is not executed for executable targets and for commands only target.
I guess we could extend this with a checkbox which controls if the host app is used or not, so the user could override it.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

BlueHazzard

With a debugger (hardware) you usually can also flash your device. Most gdb server for embedded debugging incorporate a load command that can be executed with gdb
for example you can add this lines in the Project->Properties->Debugger->Additional GDB commands->After connection
for Segger gdb server or OpenOCD gdb server:

monitor reset
load


This will load the firmware file into the flash

BlueHazzard

QuoteI'm thinking that we could extend the host app field in a way to allow the execution of more commands than just the host app.
Unfortunately the host app is not executed for executable targets and for commands only target.
I guess we could extend this with a checkbox which controls if the host app is used or not, so the user could override it.
It would simply be great to execute squirrel scripts... this would make it flexible for all i can think of...

oBFusCATed

I didn't mention squirrel :); it could be done, but I'd prefer if they are just shell scripts...
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

BlueHazzard

you probably will use the glorious Manager::Get()->GetMacrosManager()->ReplaceMacros() function for the macros and i am satisfied ;)

oBFusCATed

(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

_WG_

I just tried to use a custom variable in the Project property outputfile with the hope, that this will be executed. But due to this the output file was not created :-)

I use openocd and avrdude. But for debugging i still have to start the openocd server before that i just want to do in case of debugging.

It should be a project dependent configuration in future, so that just the project file is necessary to do the job. No application configuration should be done.

thx