M5329EVB C Stationary - ISR trouble on CW 6.4

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

M5329EVB C Stationary - ISR trouble on CW 6.4

2,321 Views
MK_Sirona
Contributor I

I got a problem with the interrupt handling in the M5329EVB C stationary.
The vectors.s is the standard one that came with the stationary, and I placed a
breakpoint in the low level ISR handler for testing.

It does not even reach the handler function, the moment any ISR is thrown,
it says "Exception vector name: Illegal instruction".


From what I've read, the illegal instruction in the ISR vector could be caused by a bad
memory layout that overwrites the interrupt vector with the heap.
(sounds reasonable to me, but I expected a little more from the stationary).
I tried reducing the heapsize as suggested, but that does not help.

I'd be glad for any help or ideas here

Greetz - Matt
Labels (1)
0 Kudos
4 Replies

342 Views
RichTestardi
Senior Contributor II
> It does not even reach the handler function, the moment any ISR is thrown,
> it says "Exception vector name: Illegal instruction".
 
Is your VBR set correctly?
 
One thing I noticed on some other (MCF52221) stationery is that the VBR is set with a function like:
 
Code:
/******************************************************************** * MCF5xxx ASM utility functions */asm void mcf5xxx_wr_vbr(unsigned long) { /* Set VBR */ move.l 4(SP),D0    movec d0,VBR  nop rts }

If you change calling conventions (in target settings -> Code Generation -> ColdFire Processor) to use, say, register parameter passing, it does the wrong thing.
 
So you might want to double check you have a good VBR value.
 
-- Rich
 
 
0 Kudos

342 Views
MK_Sirona
Contributor I
Hi Rich, thanks for your quick reply

I set parameter passing to standard (as in my old project).
This changed something, because the error now reads "Exception vector name: address error" instead of illegal instruction. Might be a clue, but I'm afraid I don't know enough to figure something from that.

But maybe this does not need to work - what I wanted the stationary for were the function from stdlib -
calloc, memset, etc. (in my old project I had actually programmed those myself, but they were a bit sluggish)
When I try to link the stationary's static lib C_TRK_4i_CF_MSL.a (which contains these funcs) in my old project, it complains about missing keywords in the lcf (why a static lib is dependent on a lcf file I shall never know).

Do you have an idea what lib to link to get the stdlib functions without such a fuss?




0 Kudos

342 Views
RichTestardi
Senior Contributor II
Hi,
 
I believe the default parameter passing for v6.4 is "compact", so anything other than that will require you to use non-default libraries (and change any asm routines like the one I showed that set the VBR).
 
One way to not have to deal with changing libraries when you change calling conventions is just to include the MSL source code rather than the libraries in your project...  For example, I only use a few msl functions, so I just browse to include ctype.c, mem.c, mem_funcs.c, and string.c directly into my project...  Then if I change calling conventions, those files just get recompiled.  The downside of this is that if routines need to be initialized in some way (the ones I use do not need to be, but calloc, for example, does), you have to do that by hand.
 
Can you step thru with the debugger and make sure your VBR is being loaded up correctly?  Also, you might want to step into some of the MSL routines just to be sure parameters are being passed correctly.  There are a lot of different flavors of the MSL libraries and you have to make sure you have the right one for the calling convention you have selected.  I definitely would not claim to understand all of the startup and library options!
 
I'm using CW7.0, but I think this is all true for CW6.4, as well.  If you're using "register" ABI, make sure your libraries have ".RegABI" in their name; if you're using "standard" ABI, make sure your libraries have ".StdABI" in their name; if you're using "compact", they should have neither of those in their name.
 
-- Rich
 
0 Kudos

342 Views
MK_Sirona
Contributor I
Hi Rich

I checked the VBR and the Vector Ram itself - both looked ok, they had the same values as in the working project. I think I'm giving up on that and concentrate on the use of the mem sources in the old project.Thank you, you were a great help here.
These sources just work and the project does not suddenly get demanding.

well, apart from CWs standard bitchyness :smileywink:
 I-refuse-to-recognize-changes-to-this-source-file-unless-you-rename-it-and-offer-it-again!

Thx & Greetz - Matt




0 Kudos