News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

Using CB for ARM development

Started by Abdalla, March 13, 2015, 07:51:25 PM

Previous topic - Next topic

Abdalla

What is required to start ARM projects in CB other than the toolchain ? I've installed this toolchain https://launchpad.net/gcc-arm-embedded, configured the toolchain executable inside CB and I still could not choose a compiler when creating an ARM project.

oBFusCATed

Which compiler have you edited in the settings?
(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!]

Abdalla

GNU Compiler for ARM. Btw it could not auto-detect the compiler toolchain.

oBFusCATed

Do you see the GNU ARM GCC Compiler in the wizard's drop down?
If you see it and you can hit next then this will be the selected compiler for your new project.
(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!]

Abdalla

No compiler appears on the ARM project wizard.

scarphin

I can confirm that on win7. It's because a typo in the script 'share\CodeBlocks\templates\wizard\arm\wizard.script' at line 25:
Wizard.AddCompilerPage(_T(""), _T("armelf*"), false, false);
It should be:
Wizard.AddCompilerPage(_T(""), _T("arm*"), false, true);
to find the compiler and to allow for target options.

oBFusCATed

scarphin, yes you're correct I'm using this patch:

diff --git a/src/plugins/scriptedwizard/resources/arm/wizard.script b/src/plugins/scriptedwizard/resources/arm/wizard.script
index 184a544..4f4ec83 100644
--- a/src/plugins/scriptedwizard/resources/arm/wizard.script
+++ b/src/plugins/scriptedwizard/resources/arm/wizard.script
@@ -1,5 +1,5 @@
board <- 1;
-derivative <- 1;
+derivative <- 0;
outputvariant <- 1;
function BeginWizard()
{
@@ -22,7 +22,7 @@ function BeginWizard()
        // select project name and path
        Wizard.AddProjectPathPage();
        // select compiler and configurations
-       Wizard.AddCompilerPage(_T(""), _T("armelf*"), false, false);
+       Wizard.AddCompilerPage(_T(""), _T("arm-elf*"), false, false);
        // select language
        Wizard.AddGenericSingleChoiceListPage(_T("ARMBoards"), _T("Please select your ARM evaluation board."), ARM_boards , board);



Would this work on windows?
(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!]

scarphin

I think it's safer to go with 'arm*' instead of 'arm-elf*' because in '\share\CodeBlocks\templates\wizard\common_functions.script' every arm related compiler is marked with 'arm*'. Although 'arm*' will match with 'arm-elf', I don't think there is any reason to introduce inconsistency between the wizard and the scripts nor rename available arm compilers to 'arm-elf*'. For a matter of fact arm-eabi compilers (i.e. for raspberry pi) can be used with cb too. Using 'arm-elf*' works btw.

Abdalla

It worked on windows, but I get a message next to the windows clock it says can't find compiler executables. I will check this, meanwhile how to add ARM boards to the IDE ?

scarphin

Quote from: Abdalla on March 14, 2015, 01:29:33 PM
meanwhile how to add ARM boards to the IDE ?
You have to modify the wizard script: 'path_to_cb_installation\share\CodeBlocks\templates\wizard\arm\wizard.script'
Or right click on the 'ARM Project' icon in 'file->new->project' and click 'edit this script' to use a modified version without affecting the original.

oBFusCATed

scarphin:
I can see that there is also iararm compiler, that won't be matched by the arm* or arm-elf*.
Do you know if this compiler will be supported by the wizard if it is enabled?
(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!]

scarphin

I don't know for sure but a quick look at the script tells me iar won't work as they have different compiler and linker options. One needs to test to be sure but it's highly unlikely imo.

oBFusCATed

OK.
Btw what is arm-eabi, simple search doesn't find anything in cb's sources about it.
I guess that the same compiler definitions are used for arm-eabi and arm-efl.
(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!]

scarphin

'eabi' is an API type.
https://wiki.debian.org/ArmEabiPort
I don't know why you are looking for 'arm-eabi' in cb sources, it's the type of the compiler producing 'eabi' compatible output.

oBFusCATed

Because arm-elf* and arm* are compiler ids in the CBs terms, they have nothing to do with compiler executables.
(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!]