Interrupt routine from code for S08PT60-EVK Eval Board not being called

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

Interrupt routine from code for S08PT60-EVK Eval Board not being called

Jump to solution
2,136 Views
RickStranberg
Contributor II

Hello,

We recently purchased the S08PT60-EVK evaluation board as we are looking to use the S08PT60.  I have CodeWarrior V10.7.  It appears that the example project and code may have designed for a previous version of CodeWarrior.

I ended up copying all of the .c and .h files from the example code directories devices->common, devices->drivers, and devices->platform into the corresponding source and header file directories within the Codewarrior 10.7 project.  The project compiles and runs albeit barely.

The code in question is the ITIM1 interrupt service routine after main routine:

/************************************************************************
*       main - Program main entry point                                                                         *
*************************************************************************/
void main(void) 
{
    uint8_t i = 0;
    
    
 //   volatile unsigned char dummy;
 //   unsigned short uiCount;
    
    //Initialise system including clocks
    //Watchdog: disabled
    //FEE: BUS clock 16MHz
    //Serial terminal: SCI2 baudrate 115200
    Sys_Init();
    EnableInterrupts;

    printf("\n-- S08PT60-EVK OOBE BEGINS--\n");
    printf("\n");

    LED_Init();
    LED_Test();
    
    //Initialise MTIM1, 1ms interrupt interval, used for 1ms time delay
    MTIM1_Init();
    
    //Initialise MTIM2 to generate PWM
	FTM2_Init();
	
    //Initialise I2C PTA2/3 used for FXOS8700CQ write/read
    Accel_I2C_Init();
    FXOS8700CQ_Test();
    
    //while (1);
}


//MTIM1 is used for delay 1 milliseconds
interrupt VectorNumber_Vmtim1 void  Mtim1_ISR(void)
{
	LED0_On();
    DisableInterrupts;
    if(MTIM1_SC_TOF)
    {
        // clear the flag
        MTIM1_SC_TOF = 0;	
    }
    g_delay_1ms_done = 1;
    EnableInterrupts;
}

 

The Mtim1_ISR(void) never gets called.  I tested it as can be seen by putting a LED0_On() at the beginning of it (LED0_On() works elsewhere turning a RED LED on).

There's a couple of things - since this project is sort of a mish mash, where does the function Mtim1_ISR(void) get registered to be the actual MTIM1 interrupt routine?  I'm assuming it's by  using " VectorNumber_Vmtim1".  If that's not correct, what is the correct way?

I'm attaching my project so that you can possibly see any issues with how the project is structured.

 

Thanks so much!

 

Best Regards,

Rick

Tags (2)
0 Kudos
Reply
1 Solution
2,083 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Rick

You need to make sure the file path is included in project path settings.

ZhangJennie_0-1639538997035.png

 

 

 

Thanks,

Jun Zhang

 

View solution in original post

0 Kudos
Reply
6 Replies
2,116 Views
RickStranberg
Contributor II

-

Hi Jun,

 

Thanks for your reply.  It's seems I made a mistake in remembering what I did.  Apparently I started out with the example code for the S08PT60-EVK, "S08PT60-EVK Example Codes" from here:

https://www.nxp.com/design/development-boards/freedom-development-boards/adaptors/evaluation-kit-for...

unzipped and imported it into CodeWarrior 10.7 and then the compile error that I got was, "mingw-32-make:  *** No rule to make target C:\...".

I believe I then downloaded the example code from the S08P-Lite Example Board and tried to reconstruct a project from there.

Maybe if we fix the target setting error for the original S08PT60-EVK, that might be the best way to go.

Thanks so much!

 

Regards,

Rick

 

0 Kudos
Reply
2,102 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Rick

when we open the default demo code with CodeWarrior, we need to do clean it first then build. Thus there is no build error. I have tested it.

ZhangJennie_0-1639453874403.png

But this set of code is for EVK board, if you don't use this board, you need to check if the interrupt is triggered on HW side.

 

Thanks,

Jun Zhang

 

0 Kudos
Reply
2,089 Views
RickStranberg
Contributor II

Hi Jun,

Thanks for your reply. 

It turned out to be a project configuration issue.  When I download S08PT60-EVK Example Codes it unzips into 2 folders:  'devices' and 's08pt60_evk' - which is the project folder.  

After I copied the project to the local directory in which I would be working, I mistakenly put the devices folder within the s08pt60_evk.  After realizing the mistake, I started the project creation process again with leaving the devices folder at the same directory level as s08pt60_evk.  The project then compiled.

However I noticed that the project only "recognized" the 'common' and 'drivers' folder underneath the 'devices' folder.  It also did not recognize other folders underneath the 'drivers' folder.

I subsequently decided I wanted to use some of the functions in the s08pt60_evk_board.c file which was under the 'platform' directory under 'devices'.

So I then copied the 'platform' directory' into the 'devices' directory underneath the project.  I also copied the needed adc folder and files along with the tsi folders and files into the 'devices' folder which the s08pt60_evk_board.c file needs. 

However, codewarrioir will not recognize the files and folders that I added.  See screenshot:

Non-recognized_files.png

How do I get CodeWarrior to "recognize" the added folders/files?

Thanks so much.

Regards,

Rick

0 Kudos
Reply
2,084 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Rick

You need to make sure the file path is included in project path settings.

ZhangJennie_0-1639538997035.png

 

 

 

Thanks,

Jun Zhang

 

0 Kudos
Reply
2,078 Views
RickStranberg
Contributor II

Ahhh, thank you, Jun!

Also, to my original question "Interrupt routine ..... not being called", I figured out the issue for it.   In the code section in main, 

    LED_Init();
    LED_Test();
    
    //Initialise MTIM1, 1ms interrupt interval, used for 1ms time delay
    MTIM1_Init();

the LED_Test() function was before the interrupt was set up.  MTIM1_Init();

Thanks again for your help!

Regards,

Rick

0 Kudos
Reply
2,124 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi 

Your zip file is not downloadable.

But, According to your words "copying all of the .c and .h files from the example code directories",  Which "sample code" do you refer to? could you please send me the link? 

The Mtim1 vector number is 20. can you please check vectors.c file if Mtim1 vector is defined?

 

 

Have a nice day,

Jun Zhang

0 Kudos
Reply