Code::Blocks Forums
User forums => Embedded development => Topic started by: _WG_ on August 22, 2017, 02:18:47 pm
-
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.
-
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).
-
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 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.
-
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.
-
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"?
-
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.
-
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
-
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.
-
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:
This will load the firmware file into the flash
-
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.
It would simply be great to execute squirrel scripts... this would make it flexible for all i can think of...
-
I didn't mention squirrel :); it could be done, but I'd prefer if they are just shell scripts...
-
you probably will use the glorious Manager::Get()->GetMacrosManager()->ReplaceMacros() function for the macros and i am satisfied ;)
-
Yep...
-
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
-
...
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.
I would love to be able to do that, the ability to use custom variables in the argument list (as the custom tools do) would be nice
-
It will happen, but it should have to wait for the release to happen first. So no new features in the immediate future.