Unable to change program status word register IO bit to user mode 0 in TC39x Aurix

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
indra
Level 1
Level 1
5 questions asked 5 replies posted 10 sign-ins

I am trying to enable user mode 0 on tc39x aurix . For this want to change the IO bit in the PSW register to 00 for user mode 0.

Ifx_CPU_PSW psw; 

psw.U = __mfcr(CPU_PSW);
psw.B.IO = 0x0;
__mtcr(CPU_PSW, psw.U);

This is the instruction I am using to change the IO bit but instead of setting the IO bit it setting the interrupt stack control bit(IS). also the starting value of the psw shows c000980 rather than 0000 0B80(reset value).  what should I do?

0 Likes
1 Solution
Jeremy_Z
Moderator
Moderator
Moderator
1000 replies posted 250 sign-ins 100 likes received

Hi @indra ,

Please go ahead to refer to the thread, I already illustrated the code in it.

BR,

Jeremy

View solution in original post

0 Likes
3 Replies
Jeremy_Z
Moderator
Moderator
Moderator
1000 replies posted 250 sign-ins 100 likes received

Hi @indra 

Thank you for your interest in Infineon Semiconductor products and for the opportunity to serve you.
What should I do?
The PSW will become the 0xC000980 after going through the startup function, to change the privilege level, I'd like to suggest you to software trigger either interrupt or trap, then modify the PSW in the auto-stored upper CSA context, after finishing, return and PSW will be 'restored' to modified value.

2023-03-07_13h56_43.png

BR,

Jeremy

 

0 Likes
indra
Level 1
Level 1
5 questions asked 5 replies posted 10 sign-ins

Hi @Jeremy_Z 

Can you provide me any example code on how to enable a software interrupt and modify upper CSA context

BR,

Indra

0 Likes
Jeremy_Z
Moderator
Moderator
Moderator
1000 replies posted 250 sign-ins 100 likes received

Hi @indra ,

Please go ahead to refer to the thread, I already illustrated the code in it.

BR,

Jeremy

0 Likes