Illegal exception while accessing pcr/gpdo in user mode(MPC5777C)

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

Illegal exception while accessing pcr/gpdo in user mode(MPC5777C)

Jump to solution
1,387 Views
Indra
Contributor III

 I used this code

//User mode

__asm__(" mfmsr %r23 ");
__asm__(" e_add16i %r24, %r23, 0x4000 ");
__asm__(" mtmsr %r24 ");

//gpdo toggling
vint32_t time = 0;
SIU.PCR[LEDPIN].R= 0x0200;
while(1){
while(time < 1000000)
{
SIU.GPDO[LEDPIN].R ^= 1;
time++;

}
time = 0;
}

This is for gpdo toggling simple application but I am getting illegal instruction exception in ESR and bits MAV,ST,G,BUS_WRERR in MCSR are set I dont know why this happening

what should I do?

Regards

M.V.S.I

0 Kudos
1 Solution
1,346 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

OK, there's no problem with MMU, all TLB entries are "user access allowed".

After deeper investigation, I found that it's caused by default configuration of Peripheral Bridge.

It's necessary to configure AIPS_1_OPACRA to 0x44440444 (default value is 0x44444444):

lukaszadrapa_0-1677828432527.png

 

lukaszadrapa_1-1677828440318.png

 

lukaszadrapa_2-1677828447232.png

 

After this configuration, it works as expected.

Regards,

Lukas

View solution in original post

4 Replies
1,372 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi @Indra 

could you show me your MMU configuration? If this happens after enabling of user mode then it points directly to MMU, most likely.

Regards,

Lukas

0 Kudos
1,361 Views
Indra
Contributor III

Hi @lukaszadrapa 

I've attached my mmu config please have a look at it

0 Kudos
1,347 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

OK, there's no problem with MMU, all TLB entries are "user access allowed".

After deeper investigation, I found that it's caused by default configuration of Peripheral Bridge.

It's necessary to configure AIPS_1_OPACRA to 0x44440444 (default value is 0x44444444):

lukaszadrapa_0-1677828432527.png

 

lukaszadrapa_1-1677828440318.png

 

lukaszadrapa_2-1677828447232.png

 

After this configuration, it works as expected.

Regards,

Lukas

1,343 Views
Indra
Contributor III

Thank you @lukaszadrapa  it works.

0 Kudos