How to setup GCC-based toolchain

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to setup GCC-based toolchain

Jump to solution
16,179 Views
isaacnickaein
Contributor III

Hello,

I'm looking for some guidance on programming for LPC modules (especially LPC1768) and have a few questions:

  1. There are recent builds of GCC toolchain available for these architectures (GNU Arm Embedded Toolchain – Arm Developer ). Where I can find the headers, libraries, and drivers for a specific LPC module from NXP website?
  2. Is there any limitations on the available C++ features in those toolchains (e.g. C++ threads, mutexes)? The Keil has the concept of "Task" for threading. How can multi-threading can be accomplished with these generic GCC toolchains?
  3. What tools do you recommend that provides a recent compiler support (e.g. C++14) together with support for hardware/debugging? Some options that come to my mind:

Labels (1)
Tags (3)
0 Kudos
1 Solution
9,793 Views
BlackNight
NXP Employee
NXP Employee

Hi Isaac,

1) I recommend that you use the MCUXpresso IDE (MCUXpresso IDE|NXP ) with the MCUXPresso SDK (Welcome to MCUXpresso | MCUXpresso Config Tools ): that way you get everything and you don't have to worry about all the parts and all the setup. Of course you can build your own toolchain and IDE, but this requires a decent knowledge of all the parts and pieces. I wrote several tutorials (see Breathing with Oxygen: DIY ARM Cortex-M C/C++ IDE and Toolchain with Eclipse Oxygen | MCU on Eclipse ), but again I recommend this only if you are really an expert and if you have very special needs. And again: get the MCUXpresso IDE and then you have something working and a solid base (you still could do a DIY afterwards if you really insist).

2) the standard way is to use FreeRTOS (freertos.org). Here again you have everything setup for you in the MCUXpresso SDK and MCUXpresso IDE. This gives you threads/mutexes/semaphores plus all the needed debug views inside the MCUXpresso IDE and C++ support.

3) Here again, I recommend to use the MCUXpresso IDE which comes with the GNU gcc toolchain. The current version of the IDE is v10.0.2, but there will be a new version in the near future which integrates the latest GNU toolchain with all the latest bells and whistles for C++. It supports the P&E, Segger and LPC-Link2 (CMSIS-DAP, LinkServer) debug probes (see LPC-Link2 Debug Probe | MCU on Eclipse ).

I hope this helps,

Erich

View solution in original post

0 Kudos
8 Replies
9,794 Views
BlackNight
NXP Employee
NXP Employee

Hi Isaac,

1) I recommend that you use the MCUXpresso IDE (MCUXpresso IDE|NXP ) with the MCUXPresso SDK (Welcome to MCUXpresso | MCUXpresso Config Tools ): that way you get everything and you don't have to worry about all the parts and all the setup. Of course you can build your own toolchain and IDE, but this requires a decent knowledge of all the parts and pieces. I wrote several tutorials (see Breathing with Oxygen: DIY ARM Cortex-M C/C++ IDE and Toolchain with Eclipse Oxygen | MCU on Eclipse ), but again I recommend this only if you are really an expert and if you have very special needs. And again: get the MCUXpresso IDE and then you have something working and a solid base (you still could do a DIY afterwards if you really insist).

2) the standard way is to use FreeRTOS (freertos.org). Here again you have everything setup for you in the MCUXpresso SDK and MCUXpresso IDE. This gives you threads/mutexes/semaphores plus all the needed debug views inside the MCUXpresso IDE and C++ support.

3) Here again, I recommend to use the MCUXpresso IDE which comes with the GNU gcc toolchain. The current version of the IDE is v10.0.2, but there will be a new version in the near future which integrates the latest GNU toolchain with all the latest bells and whistles for C++. It supports the P&E, Segger and LPC-Link2 (CMSIS-DAP, LinkServer) debug probes (see LPC-Link2 Debug Probe | MCU on Eclipse ).

I hope this helps,

Erich

0 Kudos
6,354 Views
fans_ahmad
Contributor I

Hi @BlackNight , I have a similar question. I have an old project on LPC2138 MCU maybe build on keil v4. Now after a long time ago I am not able to compile on it new PC and keil V5. I saw there is an "Make.bat" file in script folder which uses "arm-elf-c++.exe GNU-Compiler Version 3.3.2" to compile and build the project.

I don't have to access to that PC, where it was build originally. Can you help me to find this compiler or make this project compatible with keil v5 with default compiler or any other method to compile this project.

#lpc2138

0 Kudos
6,350 Views
ErichStyger
Senior Contributor V

The easiest thing would be if you buy that exact compiler/toolchain from Keil (they are now part of ARM).

Or you can port that project, but in my experience this is probably not easy, because the Keil compiler is using lots of proprietary extensions which are not easy to port to another tool chain. Certainly doable, and probably the best long-term way if you would use the GNU gcc tool chain.

I hope this helps,

Erich

0 Kudos
6,348 Views
fans_ahmad
Contributor I

Hi @ErichStyger ,

Thanks for your quick response, the future plan is to use GNU gcc toolchain only. But just to see if the project compiles well in current project we need that arm-elf toolchain. Anyways, can you share link to buy or evaluate arm-elf toolchain? Or do we need to contact keil directly for the same?

0 Kudos
6,343 Views
ErichStyger
Senior Contributor V

The Keil compiler and tool chain is proprietary and closed source. You have to buy it from ARM/Keil.

0 Kudos
6,986 Views
hamidb80
Contributor I

Hey, I couldn't find any SDK builder for `nxp lpc1768`

0 Kudos
9,793 Views
isaacnickaein
Contributor III

Hi Erich,

Do you know what version of GCC is currently shipped with MCUXpresso? We are planning to use flatbuffers library for message passing and its generated code requires a C++11 compiler.

Nevertheless, I am going to give MCUXpresso a try and follow your tutorial if the were any serious obstacles. A plus for MCUXpresso is being based on Eclipse which we are already familiar with. BTW, cool name for IDE! 

Thank you for the quick response,

Isaac

0 Kudos
9,793 Views
BlackNight
NXP Employee
NXP Employee

Hi Isaac,

MCUXpresso IDE V10.0.2 b411 is currently shipping with GNU Tools for ARM Embedded Processors 5 - Q3 2016.

Erich

0 Kudos