Search:

Support for DSP56xxx C compiler toolset

Frequently Asked Questions

This page contains answers to common questions handled by our customer support staff, along with some tips and tricks that we have found useful and presented here as questions.

Please consult the generic EDE FAQ for questions related to the Embedded Development Environment.

Contents

Is your question not listed? Contact TASKING.


How to test interrupt routines using the CrossView Simulator?

There are no hooks in the simulator to generate interrupts, so you will have to call the subroutine yourself for testing. The only thing you really need to do is to prepare the hardware stack. The status register is the only state of the processor that is saved by the interrupt itself, all (used) registers must be saved and restored in the interrupt routine itself.

Here are two macro for far and short vectors

(Adopted from an answer of Robert-Jan at the Yahoo TASKINGforum)


Programming the flash memory on an evaluation board fails.

One possibility is that you are using the wrong flash write-enable codes for your evaluation board.

If you look at the circuit diagram of your evaluation board, there is a good chance that the data bus to the Flash memory has been cross-wired, shuffling the data bits around (e.g. data bus D0 goes to Flash D7, data bus D1 goes to Flash D6, etc.). You have to shuffle the bits around in the Atmel programming codes in the reverse way to produce a new set of codes specific to the EVM board.

Once you figured this out and modified the codes, the Flash should work fine.


How do I assign hexadecimal constants to fractional data?

Create a union typedef containing an int and a _fract (the int must be the first member of the union). To initialize you can then use appropriate hexadecimal values to variables of this union type. To use the values you can reference the fractional member of the union.

See also the intrinsic function _int2fract.


How can I get a double-precision result from a fractional multiply(-accumulate)?

If you need a double-precision result when multiplying two single-precision values, you must cast one of the operands to a double-precision value before the multiply:

dpresult = (long _fract) spvalue1 * spvalue2;

Otherwise, the ANSI C rules require that the multiplication is done in single precision and the result cast to double precision. This is the same for int/long and float/double operations. The compiler will use a single multiply instruction where appropriate, instead of the more elaborate double-precision operation.


How do I locate a function at a fixed address?

Put the function in a separate file and use the -R.ptext=<sectionname> option to give the code section a specific name. Then edit the .dsc file in your project to place the section at the desired address in P_space:

Download the Example Case (ZIP, 4 kB) for further clarification.


How do I create a data table in ROM?

Place the data table in a separate file and create a seperate project to only translate the table to an S-record or Intel-hex file. Use this file to program the ROM in your system. You can reference the table in your code with a define of the table address, e.g.:


How do I avoid double memory use for initialized data?

The locator generates the copy table that initializes data at program start. This can be switched off with the locator -c option. This means that you have to reload your program when you rerun it in the debugger, however, and that a bootstrap loader for your program must be capable of handling all memory spaces (examples folder contains such a bootloader). To also avoid including the copy table routine in the startup code you must reassemble it with NOCOPY defined (e.g. as563 def_targ.asm -DNOCOPY).

If your data does not change during program execution, you should add the 'const' modifier to its declaration. From version 2.2r2 on, the compiler does not use the copy table for such variables, but stores them directly, thus saving memory space.


The _external keyword does not work. What is going wrong?

The _external keyword only gives a section lower priority for locating, it does not force a section to external memory if enough internal memory is available. This approach gives better performance for small programs.


How do I force all external sections to external memory?

In most cases this is not the optimal layout, and therefore it is not automatic in the linker descriptor file. However, you can force it with the locator descriptor file as shown below. Basically, you create a dummy section in every memory space at the border between internal and external memory, and force all 'P' (postponed=external) sections to be located there. To still be able to locate sections without internal/external definitions, a second amode section is created. Repeat this for the X and Y memory spaces if you need it there as well.


Why does the startup code place empty sections at x:0 and y:0 called null_x and null_y?

A compare between NULL and the address of a variable at address 0 would yield true, which is an undesirable situation in a lot of cases. This kind of test occurs in many library functions; it would even make the "hello world" example fail. The compiler therefore makes these addresses artificially occupied.


How can I place a data section at address 0?

In C you can use the _at(0) keyword, the compiler will take care of the null_x and/or null_y symbols. In assembly, you must define these symbols yourself if you create data sections at address 0, to avoid conflicts in the link phase.


What file formats are supported by the CrossView Pro debugger?

The CrossView Pro debugger can only read the IEEE-695 format as produced by the TASKING tools to read program code and debug information. For reading and writing data (see 'dump' command) it also supports the Motorola S-record and Intel-hex records format.


How can I read/write 16-bit data in the 16-bit model?

The DSP563xx still has 24-bit wide program memory. In order to support this properly, CrossView will always read and write 24-bit values. To read and write 16-bit values you must open a file in text mode and do some character processing; it is not possible in binary mode. Normally the overhead of this processing defeats the purpose of speeding up the data exchange.


How can I single-step the bootstrap ROM?

Change the Program Counter register to the start of the bootstrap ROM ($FF0000 on the DSP563xx), and then use assembly single-steps to step through the code. You cannot set breakpoints in the bootstrap ROM, and therefore "go to cursor" and "step over" will not work. Instead, you can use multiple assembly steps from the command window (e.g. "50 si" will proceed 50 assembly steps).


Why do I get a lot of warnings when I compile a C++ program?

The C++ compiler generates old-style prototypes (no type information) for all functions, and the linker gives warnings in all of these cases. This will be alleviated in a future release of the C++ compiler. For now you can safely ignore warnings on parameter types in C++ compiled program.


How do I describe an 8-bit wide ROM in the locator descriptor file?

It is not useful to describe 8-bit wide devices in the locator descriptor file, because the assembler does not generate sections that fit an 8-bit device. They are best left out altogether. You must make sure that their memory range of the ROM is not used in other chip definitions.


When debugging my application, how do I redirect its output stream in the Virtual I/O Window to a file?

There is a feature in CrossView Pro to redirect the output of a stream to a file. The commands are:

will redirect stream 1 (output, so w for writable) to the file myfile.out. When done, the second command is used to close the stream.


When starting CrossView Pro for DSP5600x, I get an error message involving tdp56k.dll. Why?

SYMPTOMS

After installation, CrossView Pro version 3.0r1 (software code SW039-049-xx) may generate the following message at startup:

XVW error - tdp56k.dll: The specified module could not be found. No such file or directory

CAUSE

The name of a configuration file is incorrectly specified in xvw.ini and does not match the name of the actual configuration file.

RESOLUTION

Edit the name of the configuration file specified in xvw.ini to match the name of the actual configuration file. In <product_root>\etc\xvw.ini change (last line of the file):

xvwstartup_target_cfg: sim56.cfg

into:

xvwstartup_target_cfg: sim560.cfg

"sim" can also be "ads" or "evm", depending upon the execution environment that was selected during installation.

CrossView Pro uses <product_root>\etc\xvw.ini as a template for the creation of a customized xvw.ini file, which is usually stored in <product_root>\bin. If the file <product_root>\bin exists, delete it and let CrossView create a new one.