AnsweredAssumed Answered

Facing compilation issue with error warning: implicit declaration of function 'MTHID0'

Question asked by Vrushali Taklikar on May 8, 2017
Latest reply on May 12, 2017 by Martin Kovar

I am wirting a MMU driver for MPC5777C,

For below code I am facing compilation issue.

int main(void)
{
//volatile int counter = 0;
int pid;

asm ("e_li r0, 0x4000");
asm ("mthid0 r0"); /* Enable TB and Decrementer */

pid = MFSPR(286);
xcptn_xmpl (); /* Configure and Enable Interrupts */
if (pid == 0)
{
volatile int i;

SIU.PCR[114].R = ALT0 | OBE; /* PA=0, OBE=1 for GPIO[0] PA[1] */

/* Start Core 1 in VLE mode */
SIU.RSTVEC1.R = ((unsigned long)&__start & RSTVEC_RST_MASK) | RSTVEC_VLE;

/* PIT 0 Timer 0 Config - Used for Periodic Interrupt example */
PIT.MCR.B.MDIS = 0; /* Enable PIT */
PIT.TIMER[0].LDVAL.R = 0x0FBC51FF; /* 2s at 132MHz Per clock */
PIT.TIMER[0].TCTRL.R = 0x00000003; /* Enable timer CH0 and interrupt */

while (1) /* loop forever (core 0) */
{
i++;
}
} else {

volatile int i;

SIU.PCR[115].R = ALT0 | OBE; /* PA=0, OBE=1 for GPIO[0] PA[0] */


/* PIT 0 Timer 1 Config - Used for Periodic Interrupt example */
PIT.MCR.B.MDIS = 0; /* Enable PIT */
PIT.TIMER[1].LDVAL.R = 0x07DE2900; /* 1s at 132MHz Per clock */
PIT.TIMER[1].TCTRL.R = 0x00000003; /* Enable timer CH1 and interrupt */
while (1) /* loop forever (core 1) */
{
i++;
}
}
}

 

 

 

../src/main_Z7_0.c: In function 'main':
../src/main_Z7_0.c:49:5: warning: implicit declaration of function 'MTHID0'

 

Please suggest if I am missing any file inclusion

Outcomes