Code::Blocks Forums

User forums => Embedded development => Topic started by: pyrohaz on November 09, 2015, 12:06:25 am

Title: Use "Build -> Run" to execute something else
Post by: pyrohaz on November 09, 2015, 12:06:25 am
Hi all,

I've got Codeblocks configured with SDCC, along side the STM8 series of microcontrollers. I can compile and link fine along with generate the .hex file required. Currently, I have the .hex file being uploaded to the STM8 after the build process has completed. What I'm wondering is can I change what the Build->Run command does to instead of trying to execute the program in windows, execute the ST uploader from command line and upload to the microcontroller?

Thanks,
Harris
Title: Re: Use "Build -> Run" to execute something else
Post by: oBFusCATed on November 09, 2015, 12:22:58 am
You can do this using a post build step or using a tool.
You can probably setup another commands only target to do this.
Title: Re: Use "Build -> Run" to execute something else
Post by: scarphin on November 09, 2015, 09:44:59 am
Or use the Toolsplus plugin to define custom commands to program your microcontroller or execute the code etc...
Title: Re: Use "Build -> Run" to execute something else
Post by: pyrohaz on November 09, 2015, 09:51:08 pm
Or use the Toolsplus plugin to define custom commands to program your microcontroller or execute the code etc...

Aha! I didn't know such a thing existed. I've now created a Toolsplus macro.

Thank you all for your replies!
Title: Re: Use "Build -> Run" to execute something else
Post by: ouch on November 18, 2015, 11:51:02 pm
You might be able to create a new compiler profile for it too. That would make the build, run etc buttons work like normal for your micro.

settings->compiler and then click on copy, name it whatever and then just edit the directory and toolchain executables to whatever your microcontroller software needs.