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

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

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

跳至解决方案
3,573 次查看
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 项奖励
回复
1 解答
3,532 次查看
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

在原帖中查看解决方案

4 回复数
3,558 次查看
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 项奖励
回复
3,547 次查看
Indra
Contributor III

Hi @lukaszadrapa 

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

0 项奖励
回复
3,533 次查看
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

3,529 次查看
Indra
Contributor III

Thank you @lukaszadrapa  it works.

0 项奖励
回复