DSPRelated.com
Forums

Problems with linker.cmd

Started by mark...@bish.net December 14, 2005

I have a nasty problem where when I emulate everything works great but
when I run out of flash it blows up. I've narrowed the problem down to
some .asm files I have included in the project from the MSL.

I need to do some right shifting and I included the .asm files from

C:\Program Files\Metrowerks\CodeWarrior5.1\M56800
Support\msl\MSL_C\DSP_56800\asm_src\rtshift\

in my project and made some changes to linker.cmd to add the section
rtlib:

.main_application :
{
# .text sections
boot_app.c (.text)
* (.text)
* (rtlib.text)
* (fp_engine.text)
* (user.text)
} > .text and

.main_application_data :
{
# .data sections

* (.data)
* (fp_state.data)
* (rtlib.data)

# .bss sections

* (rtlib.bss.lo)
* (.bss)
} > .data

I checked the map file and I see where the sections and data are listed.

I don't know what I am doing wrong - I compiled all the .asm files into
the .lib using the Codewarrior project but Codewarrior doesn't let me add
the lib to the project. If I need to add MSL C 56800.Lib, how do I do
that? Should I be using << and >> for bit shifting or
should I be using _L_shl() and _Lshr()?





And can you use __div() in interrupt routines?



This is probably a distraction but the last comment reminded me of something. Be very careful with math in an interrupt routine (particularly with "C" source)!
 
I once used a "%" operator with CodeWarrior 4.1  and found that it called a library routine under the hood that failed to preserve registers. 
 
It caused random failures in my code.  The libraries in general are not interrupt safe.
-----Original Message-----
From: m...@bish.net [mailto:m...@bish.net]
Sent: Wednesday, December 14, 2005 11:42 AM
To: m...@yahoogroups.com
Subject: Re: [motoroladsp] Problems with linker.cmd



And can you use __div() in interrupt routines?

The information contained in this message is confidential and intended only for use of the designated recipient(s) named above. If the reader of this message is not the intended recipient or an agent responsible for delivering it to the intended recipient, you are hereby notified that you have received this message in error, and that any review, dissemination, distribution, copying, or alteration of this message is strictly prohibited. If you have received this communication in error, please notify the originator immediately and remove it from your system.





Yes, I am aware that '%' isn't ISR safe. I have went back and took a
project apart a project that used the MSL lib and just used that. I had a
setting "sort by address" - it needed to be disabled. On Wed, 14 Dec 2005, Yochum, William wrote:

> This is probably a distraction but the last comment reminded me of
> something. Be very careful with math in an interrupt routine (particularly
> with "C" source)!
>
> I once used a "%" operator with CodeWarrior 4.1 and found that it called a
> library routine under the hood that failed to preserve registers.
>
> It caused random failures in my code. The libraries in general are not
> interrupt safe.
>
> -----Original Message-----
> From: mark@mark... [mailto:mark@mark...]
> Sent: Wednesday, December 14, 2005 11:42 AM
> To: motoroladsp@moto...
> Subject: Re: [motoroladsp] Problems with linker.cmd >
>
> And can you use __div() in interrupt routines? >
> * br> > <http://docs.yahoo.com/info/terms/> . > _____ >
> The information contained in this message is confidential and intended only
> for use of the designated recipient(s) named above. If the reader of this
> message is not the intended recipient or an agent responsible for delivering
> it to the intended recipient, you are hereby notified that you have received
> this message in error, and that any review, dissemination, distribution,
> copying, or alteration of this message is strictly prohibited. If you have
> received this communication in error, please notify the originator
> immediately and remove it from your system.
>



Hi,
Im working with bootloader v.1.1 and some times the application doesnt start and Hyper Terminal application doesnt display any message. Its like DSP gets blocked checking the SCI. It seems to me that the reason could be COP interrupt. How can I solve this problem?
Thanks in advance

Regards

David Montero