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
Solved! Go to Solution.
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):
After this configuration, it works as expected.
Regards,
Lukas
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
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):
After this configuration, it works as expected.
Regards,
Lukas
Thank you @lukaszadrapa it works.