How to setup GCC-based toolchain

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

How to setup GCC-based toolchain

跳至解决方案
16,578 次查看
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:

标签 (1)
标记 (3)
0 项奖励
1 解答
10,192 次查看
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 项奖励
8 回复数
10,193 次查看
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 项奖励
6,753 次查看
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 项奖励
6,749 次查看
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 项奖励
6,747 次查看
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 项奖励
6,742 次查看
ErichStyger
Senior Contributor V

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

0 项奖励
7,385 次查看
hamidb80
Contributor I

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

0 项奖励
10,192 次查看
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 项奖励
10,192 次查看
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 项奖励