CodeWarrior for StarCore DSPs FAQs

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

CodeWarrior for StarCore DSPs FAQs

14,368 Views
J2MEJediMaster
Specialist I

This thread contains the Frequently Asked Questions (FAQs) for the StarCore for CodeWarrior DSPs development tools.

Labels (1)
Tags (1)
129 Replies

996 Views
dumitru-daniel_
NXP Employee
NXP Employee

Q: Can I use a different linker command file than the one being used in my project?

 

A: The linker command file can be changed by following steps below:

  1. In the CodeWarrior Projects window, right-click on project name. A context menu appears.
  2. From context menu, select Properties.  The Properties window appears.
  3. Expand C/C++ Build Folder.
  4. Underneath C/C++ Build, select Settings. The Settings options appear on right hand side of properties window. 
  5. Select StarCore C/C++ Linker folder.
  6. Underneath StarCore C/C++ Linker, select Linker Settings.  The Linker Settings appears.
  7. On the right hand side of Linker Settings is an option called Linker Command File.  Currently this is the linker command file that will be used.  If a different one is desired select ‘Browse’ button to select a different linker command file. 

  Linker Settings 

0 Kudos

996 Views
Li
Contributor I

Q: When using constants, where will the compiler put them?  Will it put them into .rom or .data segments?

 

A:  If you use the Allconst_To_Rom option in your Application Configuration File it will store in ROM all symbols that the high-level optimizer finds as constants. 

0 Kudos

996 Views
Li
Contributor I

Q: I have a function defined in file A as inline int myfunc().

This function is used in several other functions in the same file and also in four other

files.  All files are in a self-contained library with global optimizations enabled.  The

linker produces an error message which states that there is an unresolved symbol

_myfunc that is being referenced from the 4 other files.  If I look at the.obj file the

function __myfunc is not listed.  It seems like the compiler has stripped it out.  When I

remove the inline keyword, the project compiles correctly.   Also if I use the #pragma

inline instruction it also works correctly.  What is going on? 

 

A:  The frontend compiler is stripping out the inline function after it inlines them.  If you do not want to change your code, the option is to use the –Xcfe -inline off option which disables inlining in the frontend and icode performs the inlining afterwards.  The cleanest solution for the user though is to write an inline function in a header file and to include the header file where the inline function is called.

0 Kudos

996 Views
Li
Contributor I

Q: Can I set the .bss section and .data section into heap?

 

A: You can not use the heap to allocate global variables.  It is intended for dynamic memory allocation only.

0 Kudos

996 Views
Li
Contributor I

Q: What is the reason that I am receiving the following warning message: support long long and double is insufficiently specified? What may result in this warning?

 

A: Can you check in the .map file if the message: warning: support long long and double is insufficiently specified is generated for assembly source files only?  If this is the case, you can remove that message adding the following line at the beginning of each assembly source file generating the message:

              DEFINE .slld ‘1’

        Alternatively you can add the macro to the defined symbols in the project settings:

  1. In the CodeWarrior projects, right-click on project name.  A context menu appears.
  2. From context menu, select Properties.  The Properties window appears.
  3. Expand C/C++ Build folder.
  4. Under C/C++ Build, select Settings. The Settings pane appears.
  5. Select Tools settings tab.
  6. Expand StarCore Assembler.
  7. Underneath StarCore Assembler, select Preprocessor.  The Preprocessor settings appear.
  8. In defined symbols toolbar, select + sign.  The Enter Value window appears.
  9. In the Defined Symbols textbox, insert .slld ‘1’.
  10.   Select OK. The Enter Value window appears.
  11.   Select Apply.
  12.   Select OK.  The properties window disappears.
  13.   In the CodeWarrior Projects view, right-click on project name. A context menu appears.
  14.   From context menu, select Clean Project.
  15.   In the CodeWarrior Projects view, right-click on project name. A context menu appears.
  16.   From context menu, select Build Project.

 

0 Kudos

996 Views
IuliaDiaconescu
NXP Employee
NXP Employee

Q:  How do I make launch configurations to be part of a project when it is exported?

 

A:  To make a launch configurations be part of the project follow steps below:

  1. From toolbar, select Run > Open Debug Dialog.  The Debug window appears.
  2. Select launch configurations
  3. Select Common tab. The Common settings pane appears. 
  4. Under Save as, select the shared file radio button. Leave the default folder name as is. 
  5. Select Apply.  Now the launch configuration is physically located in the project folder, so it will be of the project when zipped.
0 Kudos

996 Views
CrasyCat
Specialist III

Q: Do I have to uninstall old CW releases to install new ones?

 

 A: There is no need to uninstall old releases.  Having multiple releases on one machine works fine. This may not be the case for CodeWarrior classic tools where DLL’s are registered on the system for different components.

0 Kudos

996 Views
CrasyCat
Specialist III

Q: What is the first thing I see when I bring up the CodeWarrior for StarCore 10.1 tools?

 

A :  The window that you see when you bring up the tools is called a workbench.  The workbench consists of a perspective, views, and editors.   The term “workbench” refers to the host development environment.

0 Kudos

996 Views
CrasyCat
Specialist III

Q:  What controls the initial views in the workbench?

 

A:  A perspective defines the initial layout of the views in a workbench.  Each of the perspectives is task oriented.  One workbench Window contains many perspectives. 

0 Kudos

996 Views
CrasyCat
Specialist III

Q: What exactly is a perspective?

 

A:  Perspectives are arrangements of views and editors.  Users can quickly switch between perspectives. 

0 Kudos

996 Views
CrasyCat
Specialist III

Q: Can I work on CodeWarrior for StarCore v10.0 project without having to change paths or variables on the same machine? 

 

A:  You can go back and forth between the different toolsets, but you must make sure that the Command Converter Server window is closed between the different versions of the tools. 

0 Kudos

996 Views
CrasyCat
Specialist III

 

Q: How can I tell the linker to add an object (function, variable) to the .eld, even though this object is never referenced in the application? 

 

A :  What you need to do to prevent the "unsed" object from being removed is by disabling dead striping.

This can be done using following notation:

 

 

          KEEP (SYMBOL "<fileName> | '*'" ("<objectName>"));

 

For instance, in order to add a global variable called VersionNumber to the .eld, add following line to the unit where the variable should be allocated:

 

 

      KEEP (SYMBOL "*" ("_VersionNumber"));

 

 

Note that you need to specify the object linkage name here. For an ANSI C object, just add a leading _ to the object name. For a C++ object, you need to specify the mangled name.

 

 

 

 

0 Kudos

996 Views
CrasyCat
Specialist III

Q:  Is it possible to get information on the pipeline stalls when building an ANSI C source file? 

 

A:  You can get pipeline stalls reported in an assembly listing file if you add the options -l -oSTALLS to the To Assembler edit box from the Project Properties Additional Arguments panel.

This is done as follows:
   1) Open the project in CodeWarrior V10.x 
   2) Right-click on the project name in the CodeWarrior Project View.
   3) In the pop up menu, select Properties.
   4) On the left-hand side of the dialog, go to the panel C/C++ Build > Settings.
   5) On the right-hand side of the dialog, switch to panel StarCore C/C++ Compiler > Additional Arguments.
   6) In the edit box To Assembler add -l -oSTALLS.
   7) Click Apply, then OK.

0 Kudos

996 Views
CrasyCat
Specialist III

Q: How can I get Eclipse to execute a post-build script ? 

 

A:  In order to start a batch file after a build, you just need to specify the name of the .bat file in the Command entry box for the Post-build steps group. This option can be reached by navigating Project > Properties > C/C++ Build > Settings and selecting the Build Steps tab.

Keep in mind that current directory when you are building is the one specified in Build directory option of the Build location group, which is located in the project's properties C/C++ Build panel. If your batch file is not in this directory, you need to adjust the path so that the IDE can retrieve the .bat file relative to this location.

For example:
My project is in: D:\Freescale\Work\Eclipse\testcbe\testbss.
My build location is: D:\Freescale\Work\Eclipse\testcbe\testbss\Debug_SC3x50_PACC.
My batch file is located in: D:\Freescale\Work\Eclipse\testcbe\testbss and is called postb.bat.
My post Build command is ..\postb.bat.

0 Kudos

996 Views
CrasyCat
Specialist III

Q:  I have a project that consists of ANSI C source files and assembly files with extension .sl. I get a linker error message that states that the symbols defined in the .sl files are undefined. Why is that happening? 

 

A:  The file extension .sl is not a standard extension for assembly source file. So the Eclipse IDE does not recognize the files as assembly files and therefore does not know what to do with them.

In order to correct this issue, you have two options:

  First option - Change the file extension to .asm or .s, which are standard extensions for assembly source file.

  Second option - Let the Eclipse IDE know that you want it to handle .sl files as assembly source files.

     This is done as follows:
        1) In CodeWarrior select Windows > Preferences.
        2) In the Preferences dialog, expand the General group and switch to the Content Types panel.
        3) Expand the Text Folder.
        4) Click on Assembly Source File.
        5) Click Add.
        6) Specify *.sl in the New File Type dialog.
        7) Click OK to dismiss the New File dialog.
        8) Click OK to close the Preferences dialog.

From now on, .sl files will be treated as assembly source files by CodeWarrior for all projects within that workspace.

0 Kudos

996 Views
CrasyCat
Specialist III

Q: For CodeWarrior for StarCore V10.x, how can I make a S-record file from a .eld file? 

 

A: You can create a S-record file using the utility sc100-elf2xx.exe.
You start this utility from the command line, or you can add a post-build step, which executes a .bat file responsible for creating the S-record file. The Targeting StarCore DSPs.pdf manual includes a description of the utility.

The sc100-elf2xx.exe utility is capable of creating one S-record file that contains the code for all the DSP cores.
You can use the option -m for that, as follows:

     -m [arch] -#[value] <[ist_eld] { #[value] [list_eld] ...}

arch respresent the processor architecture: msc8144, msc8156...
value is the index of a processor core. (For example, -#0 means core zero.)
list_eld is the list of executable ELF files, delimited by a space.

For example: sc100-elf2xx -m msc8144 -#0 app.eld -#1 c1_app.eld -#2 c2_app.eld -#3 c3_app.eld

or

sc100-elf2xx -m msc8156 -#0 app.eld -#1 c1_app.eld -#2 c2_app.eld -#3 c3_app.eld -#4 c4_app.eld -#5 c5_app.eld

The format of the resulting merged output file can be specified using the output-type argument with the -t option.

If you want to remove the new line character in the generated S-record file, use the option -DumpNewLine=Off.

If you want to associate a post-build step to your project:
1) Open the project properties dialog.
2) On the righthand side of the dialog, select Settings panel.
3) Select the Build Steps tab.
4) Specify the name of the .bat file where you have embedded the call to the sc100-elf2xx.exe utility.

Keep in mind that current directory when you are building is the Build location specified in the project properties' C/C++ Build panel. You may need to adjust the path so that the IDE can retrieve the .bat file relative to this location.

For example:
My project is in D:\Freescale\Work\Eclipse\testcbe\testbss.
My build location is D:\Freescale\Work\Eclipse\testcbe\testbss\Debug_SC3x50_PACC.
My batch file is located in D:\Freescale\Work\Eclipse\testcbe\testbss and is called postb.bat.

My post build command is therefore ..\postb.bat.

0 Kudos

996 Views
CrasyCat
Specialist III

Q: How can I force code/data into particular memory areas? 

 

A:  You can place code (or data) in a specific section using either a pragma or an application configuration file (*.appli).

For example, if you decide to use a pragma to place code from a specific module into the section .mySection, you can use the pragma pgm_seg_name:

#pragma pgm_seg_name ".mySection "

Note that in this case the code from all functions within that module will be allocated in the specified section.
There are pragmas data_seg_name, bss_seg_name and rom_seg_name that allow you to place initialized data, un-initialized data, or constant data respectively into a user-defined section. The section can then be place in the desired memory area in the .lcf file.

If you decide to go with an application configuration file, we recommend that you create a project for a MSC8156 ADS board without SDOS support and use its .appli file as a starting point. Check the file demo.appli in the Application_file folder for an example on how to allocate functions/data in user-defined sections.

Finally, note that the compiler V23.9.x now supports an attribute section that allows you to place a specific data or function in a user-defined section.

Check the StarCore C Compiler User Guide.pdf (section Specifying Section Attribute) for more information.

0 Kudos

996 Views
J2MEJediMaster
Specialist I

Q: How can I set a breakpoint using program address?

 

A: If you wish to set a breakpoint at a specific address, you have two options.

Option 1
======
Use a Debugger Shell window to set the breakpoint:
  1) Open a debugger shell window (While in debug Perspective, select Window > Show View > Debugger Shell or if the option is not available, select Window > Show View > Other, then expand the Debug group and select Debugger Shell).
  2) If you want to set the breakpoint at a physical address:
    - Enter command bp address (Where address stands for the physical address, where you want to set the breakpoint).
   If you want to set the breakpoint at a virtual address:
     - Enter command bp x:address (Where address stands for the virtual address, where you want to set the breakpoint).

Option 2
======
Use the Disassembly window to set the breakpoint.
   1) Once you are in the debugger, go to the Register window
   2) Expand the General Purpose Registers group
   3) Scroll down until you see PC
   4) Save current value of PC (to be able to restore it afterward).
   5) Change the value of PC to the address where you want to set the breakpoint.
   6) Go to the Disassembly window (Can be opened through Window > Show View > Disassembly in case it is not available).
   7) Set the breakpoint in the Disassembly window.
   8) Restore the PC to its original value.

0 Kudos

996 Views
J2MEJediMaster
Specialist I

Q: How do I compare two files in the CodeWarrior IDE? 

 

The Classic CodeWarrior IDE let me compare two files and see any differences. How do I do that in the Eclipse IDE?

A: You can compare two or more files in Eclipse and get the same kind of GUI report that the Classic CodeWarrior IDE provides. In the Eclipse IDE click on the files to be compared (use the standard Control-click or Shift-click actions to select multiple files) then do a right-click to display pop-up menu. Select Compare With, then Each Other. A Compare view appears, highlighting the first comparison mismatch, if any. Editor buttons are presented at the top of the Compare view. 
 

0 Kudos

996 Views
J2MEJediMaster
Specialist I

Q: How can I avoid having my program compiled with a mixed optimization level? 

 

A: In order to avoid mixing different compiler options, the optimization level should be specified only on the command line for each file. All of the #pragma opt_level directives in the source files and .appli files MUST be removed.

0 Kudos

996 Views
J2MEJediMaster
Specialist I

Q: Why cannot I change the optimization level for a file in the Optimization column of the CodeWarrior view? 

 

A: If the file belongs to a folder/group and another optimization level has been specified for the folder/group, then the group settings have a higher priority then the file settings. Change the folder/group optimization level to –O0 in order to specify a different optimization level for the files within that folder/group.

 

0 Kudos