Author Topic: Using CB for ARM development  (Read 14254 times)

Offline Abdalla

  • Single posting newcomer
  • *
  • Posts: 4
Using CB for ARM development
« on: March 13, 2015, 07:51:25 pm »
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.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 11714
    • Travis build status
Re: Using CB for ARM development
« Reply #1 on: March 13, 2015, 07:56:38 pm »
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!]

Offline Abdalla

  • Single posting newcomer
  • *
  • Posts: 4
Re: Using CB for ARM development
« Reply #2 on: March 13, 2015, 08:22:47 pm »
GNU Compiler for ARM. Btw it could not auto-detect the compiler toolchain.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 11714
    • Travis build status
Re: Using CB for ARM development
« Reply #3 on: March 13, 2015, 09:25:29 pm »
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!]

Offline Abdalla

  • Single posting newcomer
  • *
  • Posts: 4
Re: Using CB for ARM development
« Reply #4 on: March 14, 2015, 10:11:38 am »
No compiler appears on the ARM project wizard.

Offline scarphin

  • Lives here!
  • ****
  • Posts: 644
Re: Using CB for ARM development
« Reply #5 on: March 14, 2015, 11:09:44 am »
I can confirm that on win7. It's because a typo in the script 'share\CodeBlocks\templates\wizard\arm\wizard.script' at line 25:
Code: [Select]
Wizard.AddCompilerPage(_T(""), _T("armelf*"), false, false);It should be:
Code: [Select]
Wizard.AddCompilerPage(_T(""), _T("arm*"), false, true);to find the compiler and to allow for target options.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 11714
    • Travis build status
Re: Using CB for ARM development
« Reply #6 on: March 14, 2015, 12:07:57 pm »
scarphin, yes you're correct I'm using this patch:
Code: [Select]
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!]

Offline scarphin

  • Lives here!
  • ****
  • Posts: 644
Re: Using CB for ARM development
« Reply #7 on: March 14, 2015, 01:23:50 pm »
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.

Offline Abdalla

  • Single posting newcomer
  • *
  • Posts: 4
Re: Using CB for ARM development
« Reply #8 on: March 14, 2015, 01:29:33 pm »
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 ?

Offline scarphin

  • Lives here!
  • ****
  • Posts: 644
Re: Using CB for ARM development
« Reply #9 on: March 14, 2015, 02:26:32 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.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 11714
    • Travis build status
Re: Using CB for ARM development
« Reply #10 on: March 15, 2015, 12:48:21 am »
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!]

Offline scarphin

  • Lives here!
  • ****
  • Posts: 644
Re: Using CB for ARM development
« Reply #11 on: March 15, 2015, 03:24:49 am »
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.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 11714
    • Travis build status
Re: Using CB for ARM development
« Reply #12 on: March 15, 2015, 01:58:53 pm »
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!]

Offline scarphin

  • Lives here!
  • ****
  • Posts: 644
Re: Using CB for ARM development
« Reply #13 on: March 15, 2015, 08:05:31 pm »
'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.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 11714
    • Travis build status
Re: Using CB for ARM development
« Reply #14 on: March 15, 2015, 10:57:23 pm »
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!]

Offline scarphin

  • Lives here!
  • ****
  • Posts: 644
Re: Using CB for ARM development
« Reply #15 on: March 16, 2015, 03:26:59 am »
Well, I'm aware of what they are but in case there's a confusion with how 'arm-eabi' works, I just duplicated the arm-gcc compiler and made the necessary changes in terms of executables if I recall correctly.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 11714
    • Travis build status
Re: Using CB for ARM development
« Reply #16 on: March 16, 2015, 09:16:13 am »
So if I'm correct arm-elf* should match both of your compilers. Is this the case?
(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!]

Offline scarphin

  • Lives here!
  • ****
  • Posts: 644
Re: Using CB for ARM development
« Reply #17 on: March 16, 2015, 11:06:04 am »
Yes, but I can't be sure if I changed anything in the compiler settings, I may have. However I realized that the wizard is targeted for some embedded boards. The ones I checked are evaluation boards with no OS. arm-eabi compiler will need an OS to interact with making the wizard not appropriate for it so go ahead with arm-elf. I think a new wizard for arm-eabi will be more suitable in this case if need be.