Default Processor for Compilation (and Assembler)

24 Nov 2009

I am the happy owner of both LPC2368 and LPC1768 devices however  I am moving away from using the 2368's and working mostly with the 1768's. More than once I have gotten tripped up in the compiler because (I guess since I started with it) it defaults to the 2368, and the code won't run. Is there a way to configure the environment to default to the device of my choice?

Also, I am thinking about delving into a little assembly language programming (yes I like pain). Is there a net-based or freeware assembler available that will work with the mbed libraries?

Gary

24 Nov 2009 . Edited: 24 Nov 2009

I'm not 100% sure (don't have it with me) but I _think_ that when you open MBED.HTM there's an option to unregister your unit.

As for assembler, you can use inline assembly in the cpp files ( __ASM("mov r0, #0x11");). You can also use .s files and they even compile but I haven't yet figured out how to call their functions from C (adding underscores and extern "C" doesn't seem to work).

That said, I wouldn't recommend using assembly to optimize code unless you are really sure that you can improve what the compiler does (and did the profiling to identify the bottlenecks). Modern compilers, including RVCT, do a really good job optimizing code, and while human can still tweak things a bit in specific cases, writing whole programs in assembly is not worth it anymore (IMO).

24 Nov 2009

Hi Gary,

Gary Trimble wrote:
Is there a way to configure the environment to default to the device of my choice?
It is on the todo list!

11 Oct 2010

"As for assembler, you can use inline assembly in the cpp files ( __ASM("mov r0, #0x11");). You can also use .s files and they even compile but I haven't yet figured out how to call their functions from C (adding underscores and extern "C" doesn't seem to work)."

Igor did you say cpp because I won't be able to do inline assembly in .c files while I'll can do that in .cpp?