Changing -mcpu option for compiler/assembler/etc

Discussion to talk about software related topics only.
Post Reply
khoney
Posts: 125
Joined: Fri Sep 11, 2009 12:43 pm

Changing -mcpu option for compiler/assembler/etc

Post by khoney »

I would like to try changing the mcpu option for the NANO54415 so that I can use the BYTEREV instruction. In another thread, I received the following advice:

This is a cpu flags problem to the assembler problem...

from a make file add

CPUFLAG=mcpu=54455

under elcipse you need to modify the project settings in c/c++ settings -> gnuc and c++ compiler
CPUFLAG=mcpu=54455

The instructions are
byterev %d0
byterev.l %d0


For the life of me, I can't figure out how to set this option. I tried adding "-mcpu=54455" to the Miscellaneous options for GNU C++ Compiler, but then it did not replace the default -mcpu=5206e option so I got an error. I tried modifying the PROPERTIES file under the NBEclipse/NANO54415 folder to include the CPUFLAG=mcpu=54415, but it had no effect. Can someone please direct me through the process of replacing the -mcpu=5206e with -mcpu=54455? I do not see in the GUI where this value is defined.
User avatar
Forrest
Posts: 289
Joined: Wed Apr 23, 2008 10:05 am

Re: Changing -mcpu option for compiler/assembler/etc

Post by Forrest »

Hello,

There is three things you will need to do.

1)
Build nb-crt0.s for the m54455. This is done by going to nburn/gcc-m68k/m68k-elf/lib and building it with

Code: Select all

m68k-elf-as -mcpu=54455 nb-crt0.s -om54455/nb-crt0.o
2)
Open nburn/NANO54415/PROPERTIES
edit DASHM variable to be -mcpu=54455

3) Right click on project in NBEclipse and select properties. Under NetBurner options, click Reload selection platforms properties file and click ok.


I did not test this, but that is the normal process when adding new platforms.
Forrest Stanley
Project Engineer
NetBurner, Inc

NetBurner Learn Articles: http://www.netburner.com/learn
khoney
Posts: 125
Joined: Fri Sep 11, 2009 12:43 pm

Re: Changing -mcpu option for compiler/assembler/etc

Post by khoney »

That appears to have done the trick - my endian swap macro using BYTEREV is now working. Thanks, Forrest!
Post Reply