Author Topic: C::B and NXP LPC175x  (Read 10599 times)

Offline Blackfin

  • Single posting newcomer
  • *
  • Posts: 3
C::B and NXP LPC175x
« on: June 20, 2011, 11:35:30 pm »
Hi all,

I have C::B 10.05 and have downloaded the latest Yagarto GNU ARM toolset with the intent of working on a project based around an LPC1756 Cortex-M3. I desperately need assistance to get this going.

Under Settings>Compiler and Debugger... I have selected the GNU ARM GCC Compiler and have set the Toolchain Executables to the various required exe files (e.g. arm-none-eabi-gcc.exe for the C compiler) and ensured that the installation directory points to my Yagarto install. Under Project>Properties...>Project's Build Options in the Linker Settings tab I have the following:

Code
-Wl,-Map,map.txt
-mcpu=cortex-m3
-T ld/LPC17xx_Linker_Script.ld

Under the Compiler Settings tab I have the following under the "Other Options" tab:

Code
-fno-common
-mcpu=cortex-m3

My current "test project" is very simple main.c. The main problem I'm seeing right now (the first of many I bet) is that I get the following error when I try to build things:

Code
src\LPC17xx_Startup.c|1|error: target CPU does not support ARM mode|
||=== Build finished: 1 errors, 0 warnings ===|

I suspect I may have an issue with having to have chosen a non-Cortex device in the wizard and now I've missed something...

Is there a tutorial around showing how to set up C::B for use with an ARM Cortex device or can someone offer some insight as to why I'm getting this error?

Thanks.

Offline scarphin

  • Lives here!
  • ****
  • Posts: 644
Re: C::B and NXP LPC175x
« Reply #1 on: June 21, 2011, 09:04:20 am »
I think u have to edit something in the 'src\LPC17xx_Startup.c' file to fix something that's not available for the MCU u work with.

Offline Blackfin

  • Single posting newcomer
  • *
  • Posts: 3
Re: C::B and NXP LPC175x
« Reply #2 on: June 21, 2011, 03:10:30 pm »
I think u have to edit something in the 'src\LPC17xx_Startup.c' file to fix something that's not available for the MCU u work with.


That's what I thought but (a) there's nothing in that file that should cause that and (b) the compiler is flagging the error on line one of the file which is just a comment.

Part of my problem is that there are many instances of build options in C::B. For instance, I can go to Settings > Compiler and debugger... and find "global" compiler setting there. But then I can click on Project > Build Options... and find setting there. Then I can click on Project > Properties... > Project's build options... and find yet another variant of the settings. It's somewhat confusing.

I found something online that starts with an empty project and allows you to specify a customized makefile so I will try that approach.

Offline scarphin

  • Lives here!
  • ****
  • Posts: 644
Re: C::B and NXP LPC175x
« Reply #3 on: June 21, 2011, 06:00:14 pm »
Actually there are only 2 build options. Global compiler settings in 'settings->compiler and debugger' apply to every project u make with the corresponding compiler. The other 2, 'project->build option' and 'project->properties->build options' are the same settings while accessed through different paths. And these settings apply to only the current project and appended to the global compiler settings. So if u have conflicting settings between u should check them first.

Offline Blackfin

  • Single posting newcomer
  • *
  • Posts: 3
Re: C::B and NXP LPC175x
« Reply #4 on: June 21, 2011, 06:55:53 pm »
I must be missing something. If I go to Project > Properties and click on the "Build Targets" tab, I see I can select a "platform." In my setup, all I have available is Windows, Unix and MAC. Under Type I can select from GUI or Console apps, Static or Dynamic libraries, Commands Only or Native. Even though the project was done with the ARM wizard these are my options?

I've given up on using C::B for embedded development for now. I've installed Eclipse Helios and will be using that with my Yagarto toolchain. I'll still be using C::B for other apps (Win console stuff, for instance) and like it enough as an IDE to try to eventually figure out how to get this working so I can come back to it someday. I just have to move on this project and don't have the time to sort this out right now.

I will stay tuned... :)

Offline scarphin

  • Lives here!
  • ****
  • Posts: 644
Re: C::B and NXP LPC175x
« Reply #5 on: June 22, 2011, 12:30:34 am »
Sorry I couldn't help, unfortunately I don't have any experience with arm core to be of further help.

I must say I was also hopeless with CB at first but I got used to it and CB still amazes me as of this moment. ;)