Include command missing after usage of device init

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

Include command missing after usage of device init

1,987 Views
Ralph
Contributor I

Hi folks,

 I am using the device initialization often in my project since some things aren't clear up to now, so changes have to be done.

Since the Interrupt-handlers are in the MCUinit.asm and I am using names out of my personal include-file there, I have to add the "INCLUDE ....inc" command at the beginning of the MCUinit.asm. Each time I change something with the device initialization tool and let it generate the code, my INCLUDE-command is away . Is there a workaround to keep it?

Sorry if this is a dumb question!

Many thanks in advance!

Best regards,

Ralph

Labels (1)
0 Kudos
Reply
4 Replies

480 Views
CrasyCat
Specialist III

Hello

 

I assume you are using CodeWarrior for MCU V6.2.

 

Inside of MCUInit.inc you can add your include statement between the comments:

 

; User declarations and definitions
;   Code, declarations and definitions here will be preserved during code generation

and

 

; End of user declarations and definitions

 

Device Initialization will not change anything between these comments.

 

CrasyCat

0 Kudos
Reply

480 Views
Ralph
Contributor I

@CrazyCat: Sorry I forgot to write! I am using V5.1 (GT16A) at the moment. THere your named lines do not exist.

 

It starts with 


 IFNDEF __xxxx_xxx_QFP_INC
__xxxx_xxx_QFP_INC: EQU  1

; Include shared modules, which are used for whole project

        XREF    MCU_init
 ...

 

after the header.

 

Does your suggestion work here too?

 

@bigmac:I've tried your last suggestion to move the include command to the beginning of the ISRs and it works fine!

 

Best regards,
Ralph

0 Kudos
Reply

480 Views
CrasyCat
Specialist III

Hello

 

In that case it looks like the feature has been added after V5.1 to the tool chain.

 

You need to either upgrade to the latest release (V6.2) or if you need to stick to V5.1, disconnect your project from Processor Expert  as explained by bigmac.

 

CrasyCat

0 Kudos
Reply

480 Views
bigmac
Specialist III

Hello Ralph,

 

I presume that the PE device initialisation tool presupposes the use of standard register names, as defined within the CW include file for the device. If you are attempting to alter these labels within the initialisation code, it is probably not valid to use PE.

 

One possible alternative approach might be to rename the file to MCUInit.inc. Then within your main file:

 

INCLUDE "special.inc"

INCLUDE "MCUInit.inc"

; Other code

 

So the contents of both files would have visibility to the main file, and the file MCUInit.inc would not be separately assembled. Actually, this is the approach required for an absolute assembly project.

 

Another alternative for the interrupt handlers might be to simply JSR to sub-routines within another file, which would contain the "real" ISR code. Or alternatively, entirely eliminate the ISR code from MCUInit.asm for those interrupts that need the special include.

 

Regards,

Mac

 

Another thought!  Presumably the ISR code is at a position within the file that does not get over-written by the initialisation tool.  The solution may be to incorporate the INCLUDE directive just prior to the first ISR, where hopefully it will not be over-written.  The contents of the include will then be visible to the ISRs (but not to the preceeding code).

 

Message Edited by bigmac on 2009-03-20 07:07 AM
0 Kudos
Reply