Mar 09, 2023
09:24 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mar 09, 2023
09:24 PM
Hi, I want to switch to user mode in tc39x. I tried to change the IO bit of psw register but it always setting the interrupt stack control bit(IS) bit. I even tried to change it through an isr in this case the register value isn't changing at all(the isr executes other instructions like toggling gpr value). One reply I got is to change the register value through upper context save area but at that memory location I cant find the psw values. I dont know if I am seeing it correct or wrong . What should I do?
- Tags:
- aurix
- Aurix ude
- context save area
- csa
- dspr
- infineon
- interrupt
- io
- isr
- memory
- mfcr
- microcontroller
- mtcr
- psw
- software interrupt
- tc39x
- Upper context save area
- User mode
- user mode 0
3 Replies
Mar 10, 2023
02:40 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mar 10, 2023
02:40 AM
Hi @indra ,
When an interrupt happens and enters the ISR function, you can try below function to set the PSW in the upper context.
uppercase = _mfcr( CPU_PCI ); //Get the value of the PCI register
pxUpperCSA = portCSA_TO_ADDRESS( uppercase ); //Convert PCXS and PCXO fields in PCXI to CSA addresses pointed by PCX
pxUpperCSA[ 1 ] = pxUpperCSA[ 1 ] & 0xfffff3ffU; //Set PSW.IO =0
Then exit the ISR function.
BR,
Jeremy
Mar 10, 2023
03:24 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mar 10, 2023
03:24 AM
Mar 13, 2023
12:51 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mar 13, 2023
12:51 AM
Hi @indra ,
/* CSA Manipulation. */
#define portCSA_TO_ADDRESS( pCSA ) ( ( uint32_t * )( ( ( ( pCSA ) & 0x000F0000 ) << 12 ) | ( ( ( pCSA ) & 0x0000FFFF ) << 6 ) ) )
#define portADDRESS_TO_CSA( pAddress ) ( ( uint32_t )( ( ( ( (uint32_t)( pAddress ) ) & 0xF0000000 ) >> 12 ) | ( ( ( uint32_t )( pAddress ) & 0x003FFFC0 ) >> 6 ) ) )
BR,
Jeremy
This widget could not be displayed.