Vector Table for MC9S08AC128

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

Vector Table for MC9S08AC128

Jump to solution
1,259 Views
preetuabraham
Contributor III

Hi,

I have a vector table for MCS9S08AC128 which has been hardcoded from ff9c but each vector is taking three bytes instead of 2 bytes as per the data sheet .I commented all the vector constants

Snippet from .map file

.abs_section_ff9c 3 R 0xFF9C 0xFF9E .absSeg5

vector table I have commented just to see how much size it occupies. Vector 49 should be from FF9C to FF9D as per the datasheet

void (* const _vectab[])() @0xff9c = {

/* FF80 - FF9B - Unused Vector Space available for user program. */

_DoNothing_Isr, /* Vspi2 Vector 49 */

//_DoNothing_Isr, /* Vtpm3ovf Vector 48 */

//_DoNothing_Isr, /* VReserved47 Vector 47 */

//_DoNothing_Isr, /* VReserved46 Vector 46 */

//_DoNothing_Isr, /* VReserved45 Vector 45 */

//_DoNothing_Isr, /* VReserved44 Vector 44 */

//_DoNothing_Isr, /* VReserved43 Vector 43 */

//_DoNothing_Isr, /* VReserved42 Vector 42 */

//_DoNothing_Isr, /* VReserved41 Vector 41 */

//_DoNothing_Isr, /* VReserved40 Vector 40 */

//_DoNothing_Isr, /* VReserved39 Vector 39 */

//_DoNothing_Isr, /* VReserved38 Vector 38 */

//_DoNothing_Isr, /* VReserved37 Vector 37 */

//_DoNothing_Isr, /* VReserved36 Vector 36 */

//_DoNothing_Isr, /* VReserved35 Vector 35 */

//_DoNothing_Isr, /* VReserved34 Vector 34 */

//_DoNothing_Isr, /* VReserved33 Vector 33 */

//_DoNothing_Isr, /* VReserved32 Vector 32 */

//_DoNothing_Isr, /* Vtpm3ch1 Vector 31 */

//_DoNothing_Isr, /* Vtpm3ch0 Vector 30 */

//_DoNothing_Isr, /* Vrti Vector 29 */

//_Iic_Isr, /* Viic1 Vector 28 */

//_DoNothing_Isr, /* Vadc1 Vector 27 */

//_DoNothing_Isr, /* Vkeyboard1 Vector 26 */

//_DoNothing_Isr, /* Vsci2tx Vector 25 */

//_DoNothing_Isr, /* Vsci2rx Vector 24 */

//_DoNothing_Isr, /* Vsci2err Vector 23 */

//_SciT_Isr, /* Vsci1tx Vector 22 */

//_DoNothing_Isr, /* Vsci1rx Vector 21 */

//_DoNothing_Isr, /* Vsci1err Vector 20 */

//_DoNothing_Isr, /* Vspi1 Vector 19 */

//_DoNothing_Isr, /* Vtpm2ovf Vector 18 */

//_DoNothing_Isr, /* Vtpm2ch5 Vector 17 */

//_DoNothing_Isr, /* Vtpm2ch4 Vector 16 */

//_DoNothing_Isr, /* Vtpm2ch3 Vector 15 */

//_DoNothing_Isr, /* Vtpm2ch2 Vector 14 */

//_DoNothing_Isr, /* Vtpm2ch1 Vector 13 */

//_DoNothing_Isr, /* Vtpm2ch0 Vector 12 */

//_Tpm1_Isr, /* Vtpm1ovf Vector 11 */

//_DoNothing_Isr, /* Vtpm1ch5 Vector 10 */

//_DoNothing_Isr, /* Vtpm1ch4 Vector 09 */

//_DoNothing_Isr, /* Vtpm1ch3 Vector 08 */

//_DoNothing_Isr, /* Vtpm1ch2 Vector 07 */

//_DoNothing_Isr, /* Vtpm1ch1 Vector 06 */

//_DoNothing_Isr, /* Vtpm1ch0 Vector 05 */

//_DoNothing_Isr, /* Vicg Vector 04 */

//_DoNothing_Isr, /* Vlvd Vector 03 */

//_DoNothing_Isr, /* Virq Vector 02 */

//_Swi_Isr, /* VSwi Vector 01 */

//_Startup /* VReset Vector */

};

Tags (1)
0 Kudos
1 Solution
956 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi Preetu,

Yes, your way is a correct way to define interrupt in prm file.

Once you define a certain interrupt in prm, we can't define the same vector in c file. otherwise we will get link error.

I attach a document on the summary of defining Interrupt Functions.

If you don't want share your project to public, you can create a private ticket to NXP technical support team, contact support engineer with your project personally.


Have a great day,
Jennie Zhang

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
7 Replies
956 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hello Preetu,

Normally this .abs_section_ff9c 3 R 0xFF9C 0xFF9E .absSeg5

is due to user define one more symbol at the same address. you need check the entire project code.

If you can not sort it out, please post your demo project here, I can help to check.


Have a great day,
Jennie Zhang

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
956 Views
preetuabraham
Contributor III

Hi Zhang,

.abs_section_ff9c 3 R 0xFF9C 0xFF9E .absSeg5 : This does not look it is allocable a preoccupied memory because in the map file  it shows like this for other sections also

.abs_section_200 40 N/I 0x200 0x227 .absSeg74

.abs_section_228 40 N/I 0x228 0x24F .absSeg75

.abs_section_250 80 N/I 0x250 0x29F .absSeg2

Please let me know if you need any other inputs .Also would like your inputs fro migrating to the new processor  whether to use banked or small memory model. If I use memory banked ,Whether only the interrupt functions should be placed under CODE_SEG along

#pragma CODE_SEG NON_BANKED

__interrupt void __near _SciT_Isr ( void ) {

#pragma CODE_SEG DEFAULT

0 Kudos
956 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

HI Preetu.

You can use 9s08ac128 banked mode to develop your project.

but we need to know even ac128 includes 3bytes banked memory, we can not define vector table and interrupt function in 3bytes address. because 8bit MCU handles interrupt with 16bits access.

Regarding to your specific problem, I need to check your project directly please click "use advanced editor", then

pastedImage_1.png

then you will see an attached button under the text field

pastedImage_2.png

Please attach your entire project, rather individual files.


Have a great day,
Jennie Zhang

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
956 Views
preetuabraham
Contributor III

Hi Zhang,

I did try to check that when I define vector.c file and use banked memory model it takes 3 bytes for each vector.#

When I removed vector.c file from project and defined the vectors like in .prm file it shows it takes 2 bytes. So whether this is correct to define the vectors as shown below??

VECTOR ADDRESS 0xFF9C _DoNothing_Isr

VECTOR ADDRESS 0xFF9E _DoNothing_Isr

VECTOR ADDRESS 0xFFA0 _DoNothing_Isr

VECTOR ADDRESS 0xFFA2 _DoNothing_Isr

VECTOR ADDRESS 0xFFA4 _DoNothing_Isr

VECTOR ADDRESS 0xFFA6 _DoNothing_Isr

VECTOR ADDRESS 0xFFA8 _DoNothing_Isr

For sharing the entire project files I have to check with my manager ,since the project is part  of the company legacy project.

If needed we can have a web-x session to show you the problem

Plus I am not getting the option Advanced Editor as per the image shown by you for sharing the filesadvacnededitor.JPG

Regards ,

Preetu

0 Kudos
957 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi Preetu,

Yes, your way is a correct way to define interrupt in prm file.

Once you define a certain interrupt in prm, we can't define the same vector in c file. otherwise we will get link error.

I attach a document on the summary of defining Interrupt Functions.

If you don't want share your project to public, you can create a private ticket to NXP technical support team, contact support engineer with your project personally.


Have a great day,
Jennie Zhang

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
956 Views
preetuabraham
Contributor III

Thanks Zhang for the document. Ok thanks for letting me know but whether the support engineer will be assigned as per the location.

So one ore query regarding the functions be defined with baked memory model.

whether all the interrupt functions needs to be defined in

#pragma CODE_SEG NON_BANKED

__interrupt void __near _xxx(void) {}

#pragma CODE_SEG DEFAULT

Which other types of functions needs to be placed . Whether reading and writing data from NVM also needs to be placed in NON Banked section and whether I should use the linear concept here

0 Kudos
956 Views
preetuabraham
Contributor III

Hi Zhang ,

This is not a demo project .

Ill explain the scenario.

We had a legacy project using MC9S08GT60 .Since we had occupied almost 58k bytes and only 6k bytes was left, it was decided to go with same HCS08 architecture with larger memory MC9S08AC128 to show it has more memory left. So we had a vector table(.c file) allocated for the vectors and what I observed is when we use Banked model it allocates 3 bytes and if I use small memory model it allocates two bytes. I am still not sure whether I have to use banked memory model or stick with small memory model. Please let us know where I can attach attachments

snippet of Vector.c

void (* const _vectab[])() @0xff9C = {

/* FF80 - FF9B - Unused Vector Space available for user program. */

_DoNothing_Isr, /* Vspi2 Vector 49 */

_DoNothing_Isr, /* Vtpm3ovf Vector 48 */

_DoNothing_Isr, /* VReserved47 Vector 47 */

_DoNothing_Isr, /* VReserved46 Vector 46 */

 

This is the PRM allocation for AC128

/* This is a linker parameter file for the GT128 */

LINK CDSS_LRSA_Current.abs

NAMES END /* CodeWarrior will pass all the needed files to the linker by command line. But here you may add your own files too. */

SEGMENTS /* Here all RAM/ROM areas of the device are listed. Used in PLACEMENT below. */

MY_STK = NO_INIT 0x15FF TO 0x17FF;

RAM1 = READ_WRITE 0x0080 TO 0x01FF;

RAMSEG = READ_WRITE 0x0200 TO 0x0370;

RAM2 = READ_WRITE 0x0372 TO 0x15FE;

RAM3 = READ_WRITE 0x1870 TO 0x20EF;

ROM = READ_ONLY 0x20F0 TO 0x7FFF;

ROM1 = READ_ONLY 0xC000 TO 0xFF9B;

/* INTVECTS = READ_ONLY 0xFF9C TO 0xFFFF;*/

/* banked FLASH ROM */

PPAGE_0 = READ_ONLY 0x008000 TO 0x00A0EF; /* PAGE partially contained in ROM segment */

PPAGE_2 = READ_ONLY 0x028000 TO 0x02BFFF;

PPAGE_4 = READ_ONLY 0x048000 TO 0x04BFFF;

PPAGE_5 = READ_ONLY 0x058000 TO 0x05BFFF;

//PPAGE_6 = READ_ONLY 0x068000 TO 0x06BFFF;

//PPAGE_7 = READ_ONLY 0x078000 TO 0x07BFFF;

END

PLACEMENT /* Here all predefined and user segments are placed into the SEGMENTS defined above. */

MySeg INTO RAM1;

DEFAULT_RAM INTO RAM2,RAM3;

_PRESTART,STARTUP,ROM_VAR, STRINGS,NON_BANKED,COPY INTO ROM;//PPAGE_4,PPAGE_5,PPAGE_6,PPAGE_7; /* See compiler option -OnB=b. */

DEFAULT_ROM,PAGED_ROM INTO PPAGE_0,PPAGE_2,PPAGE_4,PPAGE_5,ROM1;

SSTACK INTO MY_STK;

END

STACKSIZE 0x200

AND FOR gt60

/* This is a linker parameter file for the GT128 */

LINK CDSS_LRSA_Certified.abs
NAMES END /* CodeWarrior will pass all the needed files to the linker by command line. But here you may add your own files too. */

SEGMENTS /* Here all RAM/ROM areas of the device are listed. Used in PLACEMENT below. */
    MY_STK                   =  NO_INIT      0x0F80 TO 0x107F;
    ROM                      =  READ_ONLY    0x182C TO 0xFFAF;
    RAM1                     =  READ_WRITE   0x0080 TO 0x01FF;
    RAMSEG                   =  READ_WRITE   0x200  TO 0x0370;
    RAM2                     =  READ_WRITE   0x0372 TO 0x0F7F;
    ROM1                     =  READ_ONLY    0x1080 TO 0x17FF;
END

PLACEMENT /* Here all predefined and user segments are placed into the SEGMENTS defined above. */
    MySeg                      INTO  RAM1;
    DEFAULT_RAM                   INTO  RAM2;
    DEFAULT_ROM, ROM_VAR, STRINGS INTO  ROM1, ROM; /* See compiler option -OnB=b. */
    SSTACK                        INTO  MY_STK;
END


STACKSIZE 0x100

0 Kudos