- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, why does the IO bit in PSW register wont change, other bits get changed why is this happening
Solved! Go to Solution.
- Tags:
- aurix
- infineon
- io
- mfcr
- microcontroller
- mtcr
- Program State Information Registers
- psw
- tc39x
- User mode
- user mode 0
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
They are then two possibilties, the assembler code is wrong (please provide) or the debugger always set the IO to supervisor, maybe there that this is an option in the debugger. With Lauterbach I can't see this behavior, correct assemble instruction -> correct value in PSW.
Maybe you should let show the assembled code and make there instruction step to see that the used dataregister contains the correct value.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What is the state of IO bitfield before and after operation?
How you make the change of register?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @MoD
before the io bit field value is 2. I need to change the value to 0(user mode 0) or 1(user mode 1)
This is the code I am using
//Code 1
Ifx_CPU_PSW psw;
psw.U = __mfcr(CPU_PSW);
psw.B.IO=1;
//Code 2
__mtcr(CPU_PSW, 0X00000180u);
//Code 3
uint32 psw;
psw = __mfcr( CPU_PSW );
psw &= 0xFFFFF1FF;
__mtcr( CPU_PSW, psw );
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Code 1 don't change the PSW, there is missing __mtcr(CPU_PSW, psw.U);
Code 2 should set the IO bitfield of PSW to 0x0
Code 3 should set the IO bitfield of PSW to 0x0 also IS bit should be cleared
How you read the valiue from PSW, which debugger? Sure that the value is updated?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes I have read the PSW value the value is 0xa80(previous 0x980) from csfr registers. I use Aurix ude as debugger
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Which code change the value from 0xA80 to 0x980?
Can you add also the assembler listing for this code?
As debugger you use the PLS UDE with an own box, correct?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@MoD the 2nd code changes the value and yes I use pls ude
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
They are then two possibilties, the assembler code is wrong (please provide) or the debugger always set the IO to supervisor, maybe there that this is an option in the debugger. With Lauterbach I can't see this behavior, correct assemble instruction -> correct value in PSW.
Maybe you should let show the assembled code and make there instruction step to see that the used dataregister contains the correct value.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@MoD This the assembly code for code 2 d15 holds correct value
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content