Author Topic: How to install the GNU ARM compiler toolchain for codeblocks?  (Read 36962 times)

Offline aashishgogna92

  • Multiple posting newcomer
  • *
  • Posts: 11
How to install the GNU ARM compiler toolchain for codeblocks?
« on: August 03, 2018, 06:51:51 am »
hello,
I am trying to build a GUI using emWin libraraies,windows 10,using IDE:codeblocks and the controller is STM32F429 cortex M4.
I have mingw32 and wxwidgets already installed on the windows 10.
libraries:emWin
IDE:codeblocks
environment: Windows 10
compiler: GNU ARM

query: how to install this toolchain so that i can update my global compiler settings while selection of "GNU GCC compiler for ARM" in settings>>compiler>>global compiler settings>>GNU GCC compiler for ARM>>toolchain executables>> i need to fill all the entries mentioned here.i am confused which executable file belong to which fillup section.
As the compiler and linker executable files are available in the bin folder of the downloaded toolchain but the resource compiler and make program files are not there in the bin folder.
will these files be available after doing some engineering on commmand prompt?

Downlaoded the tool chain from:
https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: How to install the GNU ARM compiler toolchain for codeblocks?
« Reply #1 on: August 03, 2018, 11:42:51 am »
I do not understand fully your question...

Do you have the arm compiler running? Can you build and upload a simple led blink with codeblocks to your controller?

Quote
query: how to install this toolchain so that i can update my global compiler settings while selection of "GNU GCC compiler for ARM" in settings>>compiler>>global compiler settings>>GNU GCC compiler for ARM>>toolchain executables>> i need to fill all the entries mentioned here.i am confused which executable file belong to which fillup section.
I do not understand this at all...
Do you have problems filling in the executable files for the compiler?
You can look at the normal gcc for example. If there is written "gcc.exe" you need something like "arm-noeabi-gcc.exe" ecc...
Quote
As the compiler and linker executable files are available in the bin folder of the downloaded toolchain but the resource compiler and make program files are not there in the bin folder.
resource compiler is not needed for arm target. This is only for windows targets.
make is also not needed if you use codeblocks as your build environment...

you only need
c compiler: arm-none-eabi-gcc.exe
c++ compiler: arm-none-eabi-g++.exe
linker for dynamic libs: arm-none-eabi-g++.exe
linker for static libs: arm-none-eabi-ar.exe
(not necessary:)
make: make.exe

« Last Edit: August 03, 2018, 11:45:45 am by BlueHazzard »

Offline aashishgogna92

  • Multiple posting newcomer
  • *
  • Posts: 11
Re: How to install the GNU ARM compiler toolchain for codeblocks?
« Reply #2 on: August 03, 2018, 12:07:30 pm »
i have downloaded the compiler and in the bin folder these executable files are available, arm-none-eabi-addr2line,arm-none-eabi-ar,arm-none-eabi-as,arm-none-eabi-c++,c++filt,arm-none-eabi-gcc,arm-none-eabi-g++arm-none-eabi-,gdb,arm-none-eabi-gdb-py,lb,arm-none-eabi-nm etc etc.

i have just downloded the zip folder and extracted it,i am unaware that do i have to run gccvar (window batch file) and do some command stuff there to install this toolchain.(i dont know about the commands if required to install it or no installation is required)

NO,i cannot build any program because when i start making arm project ,codeblock error of no compiler tool-chain ,pops up!(i checked the gnu gcc compiler for ARM compiler for arm development and in global compiler setting i have tried to give path of these arm-none-eabi-g++,arm-none-eabi-gcc,arm-none-eabi-ar in the blank bar of respective files links)


i have checked through command prompt to check whether gcc compiler is installed or not, with this command gcc -v and it shows :

Target:mingw32
collect_gcc: gcc
thread model:posix
gcc version 5.1.0(tdm-1)
configured with: ../../src/gcc-5.1.0/configure --build=mingw32 --enable-languages=ada,c,c++,fortran, etc etc (all the required compilation options).

i know it is stupid to ask,mingw32 cannot be used for arm development? because i tried to give .exe path of mingw32 files during global compiler settings of code blocks and the similar message of the compiler toolchain not available on the selected path appeared/poped up again..

thanks for the reply :)

kindly help :)
« Last Edit: August 03, 2018, 12:18:45 pm by aashishgogna92 »

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: How to install the GNU ARM compiler toolchain for codeblocks?
« Reply #3 on: August 03, 2018, 12:28:21 pm »
1) Download: https://developer.arm.com/-/media/Files/downloads/gnu-rm/7-2018q2/gcc-arm-none-eabi-7-2018-q2-update-win32.zip?revision=9b83e69c-e279-4d16-9401-990c836197b3?product=GNU%20Arm%20Embedded%20Toolchain,ZIP,,Windows,7-2018-q2-update
2) Extract zip file to c:\arm\gcc7
2.1) The folder c:\arm\gcc7 should looke like this:
Code
c:\arm\gcc7
└───gcc-arm-none-eabi-7-2018-q2-update-win32
    ├───arm-none-eabi
    ├───bin
    ├───lib
    └───share
3) Open codeblocks
4) Settings->Compiler->Select  "GNU gcc compiler for ARM" from the dropdown
5) Swtich to tab "toolchain executables"
6) Compilers installation directory: c:\arm\gcc7\gcc-arm-none-eabi-7-2018-q2-update-win32
7) fill in the executables:
Code
C compiler     =   arm-none-eabi-gcc.exe
C++ compiler =  arm-none-eabi-g++.exe
Linker for dynamic libraries = arm-none-eabi-g++.exe
Linker for static libraries     = arm-none-eabi-ar.exe
8) Hit OK

Now you have installed the GNU gcc for arm

Offline aashishgogna92

  • Multiple posting newcomer
  • *
  • Posts: 11
Re: How to install the GNU ARM compiler toolchain for codeblocks?
« Reply #4 on: August 03, 2018, 12:42:31 pm »
Thank you for telling the procedure but the problem is still existing.

i did the same,now after doing this,
i clicked on file>>new>>project>>
Selected >>arm project>>go>>next>>named the project>>next>> now reaching this screen i see compiler tab with no option available.

even i clicked next>>Error appears saying "You must select a compiler for your project..."

kindly help :) :-X

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: How to install the GNU ARM compiler toolchain for codeblocks?
« Reply #5 on: August 03, 2018, 12:55:03 pm »
Note: The ARM wizard is bad...  I never achieved it to produce runnable code for any arm.... I tried to fix it, but there where other problems i wanted to fix first...

Restart codeblocks and try again.

I will try to create a minimal example for arm stm. This will take some time.... (probably 1h or so...)

Offline aashishgogna92

  • Multiple posting newcomer
  • *
  • Posts: 11
Re: How to install the GNU ARM compiler toolchain for codeblocks?
« Reply #6 on: August 03, 2018, 01:15:30 pm »
thank you so much for investing your time.

I am doing the same procedure to link this toolchain path through various names in the directories

eg:
C:/Program file(x86)/GNUARM and then copying whole toolchain so that it will be automatically detected.

result: same error appeared on codeblocks screen.

second way was:
the directory path you have suggested.
result: same error appeared on codeblocks screen.

(while trying any path i am deleting other options so that duplicate paths should not lie in the c:/ directory at one time)

repeatedly doing restarting clicking every possible way, all other projects are available,work,like console applications,avr projects,wxwidgets projects,sdl projects but the problem always come in ARM Projects.

Offline aashishgogna92

  • Multiple posting newcomer
  • *
  • Posts: 11
Re: How to install the GNU ARM compiler toolchain for codeblocks?
« Reply #7 on: August 03, 2018, 01:22:46 pm »
i want to add one more thing if someone is trying to make a GUI On stm32f429 M4 or any cortex M using emWin libraries,
in the readme.txt it is clearly mentioned that it will run with these requirements :

1.Windows 2000 or later (correct i am having windows 10)
2.CodeBlocks IDE V10.05 (or later) for Windows and MinGW-compiler or (having both,but the confusion as its an arm project,mingw compiler is not automatically getting detected ,even manually trying on global compiler settings too not working ,same error)

3.Microsoft Visual Studio 2010 or later (optional,trying 2.)


please suggest what to do! :'( ::) :-X :-[

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: How to install the GNU ARM compiler toolchain for codeblocks?
« Reply #8 on: August 03, 2018, 02:44:53 pm »
Ok, here is a example project:
https://github.com/bluehazzard/cb_minimal_STM32F429ZI

NOTE: I have only tried to compile. I have no STM32F429ZI to test the code....

Quote
1.Windows 2000 or later (correct i am having windows 10)
2.CodeBlocks IDE V10.05 (or later) for Windows and MinGW-compiler or (having both,but the confusion as its an arm project,mingw compiler is not automatically getting detected ,even manually trying on global compiler settings too not working ,same error)

3.Microsoft Visual Studio 2010 or later (optional,trying 2.)
this is probably only for the windows executables... If you want to use it on your arm you can also use makefiles or whatever....

EDIT: have you any idea what you are doing? If not, please tell us what you want to do... Compiler emWin on windows, for testing, or compiling emWin for arm and running it on your arm controller?
« Last Edit: August 03, 2018, 02:47:14 pm by BlueHazzard »

Offline aashishgogna92

  • Multiple posting newcomer
  • *
  • Posts: 11
Re: How to install the GNU ARM compiler toolchain for codeblocks?
« Reply #9 on: August 04, 2018, 06:14:39 am »
 :-*
thankyou very much for helping . i never thought of using cubemx to make a project for codeblocks. i thought it is available only for eclipse and IAR. Thanks .

i have downloaded the code and it is building fine.thanks alot.

Yes i do know exactly what i want to do(Please help me if i am opting the wrong procedure or i am missing the link,kindly help).

Motive:

1. To design a GUI application on stm32f429 with the help of static libraries of emWin to use its functions like(GUI_Init(), CreateWindow(),GUI_Clear();
GUI_SetColor(aColor),
GUI_SetFont(&GUI_FontComic24B_ASCII), GUI_DispString("Hello world!"
), etc etc there are so many to design a basic button  and  then enabling the touch over it ).

2.while designing this project,as its a ARM controller so i need a ARM compiler installed?right,so i downloaded the compiler and was trying to install.From there the problem started.

i want to ask,the project you provided is working perfect and building,if it is building definitely it is using the arm-none-eabi compiler,How did the project itself is  detecting the compiler present in the windows while building the code even though its executable are not provided in the setting of its path manually(right now by me,i have just clicked on the C:B project and pressed build that is it).

thanks for helping ::) .



EDIT: i am using emwin for its >>static libraries  (STemWin532_CM0_GCC.a,STemWin532_CM3_GCC.a,STemWin532_CM4_GCC.a,STemWin532_CM7_GCC.a) as within these libraries only the source code of the GUI_Init() or other functions be available) . once the program which i am trying to write ,if successfully build with this libraries,then a smart screen will appear on my LCD?....

do you find any mistake in this approach?
« Last Edit: August 04, 2018, 06:52:46 am by aashishgogna92 »

Offline aashishgogna92

  • Multiple posting newcomer
  • *
  • Posts: 11
Re: How to install the GNU ARM compiler toolchain for codeblocks?
« Reply #10 on: August 04, 2018, 06:50:28 am »
kindly tell me the procedure ,how did you made this project,i guess it is made using Cubemx ,but in my cubemx version,codeblocks ide is not listed 

Thanks ;D

Offline aashishgogna92

  • Multiple posting newcomer
  • *
  • Posts: 11
Re: How to install the GNU ARM compiler toolchain for codeblocks?
« Reply #11 on: August 04, 2018, 08:48:03 am »

EDIT: have you any idea what you are doing? If not, please tell us what you want to do... Compiler emWin on windows, for testing, or compiling emWin for arm and running it on your arm controller?

i want to compile emwin for arm and run it on my arm controller.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: How to install the GNU ARM compiler toolchain for codeblocks?
« Reply #12 on: August 04, 2018, 10:10:29 am »
kindly tell me the procedure ,how did you made this project,i guess it is made using Cubemx ,but in my cubemx version,codeblocks ide is not listed 

Thanks ;D

He likely started from an empty Code::Blocks project and then add code and settings till it built correctly.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline aashishgogna92

  • Multiple posting newcomer
  • *
  • Posts: 11
Re: How to install the GNU ARM compiler toolchain for codeblocks?
« Reply #13 on: August 04, 2018, 12:16:43 pm »


He likely started from an empty Code::Blocks project and then add code and settings till it built correctly.

Tim S.

actually the style of code in the project is made using some utility software later the post-pre buildcommands ,linker settings,alot of settings, linking objects, and a lot of non figure able information(at least to me) are manually input to the IDE.

thanks for providing the project.
 

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: How to install the GNU ARM compiler toolchain for codeblocks?
« Reply #14 on: August 04, 2018, 03:36:17 pm »
Still he could have started with an empty CB Project and added text files from some external wizard or tool; after that added CB project settings.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org