SMU alarm while reading ASCLIN0_CLC

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

cross mob
User19909
Level 3
Level 3
First like received
I am having an issue while reading ASCLIN0_CLC, not through the debugger, if I read using the debugger everything is fine, however, if I try to read the register using SW without debugger alarm is invoked, so what exactly is going on?
0 Likes
6 Replies
NeMa_4793301
Level 6
Level 6
10 likes received 10 solutions authored 5 solutions authored
Is your code executing in User-0 mode (PSW.IO=0)? User-0 code will invoke an MPP trap or SMU alarm if it accesses the peripheral space.

If it's not that, what alarm are you getting? What's in DEADD?
0 Likes
User19909
Level 3
Level 3
First like received
UC_wrangler wrote:
Is your code executing in User-0 mode (PSW.IO=0)? User-0 code will invoke an MPP trap or SMU alarm if it accesses the peripheral space.

If it's not that, what alarm are you getting? What's in DEADD?


the SMU alarm or MPP trap upon accessing peripheral space even on reading? because I am just trying to read the register and the read access from the user manual seems to be available in User mode.
0 Likes
NeMa_4793301
Level 6
Level 6
10 likes received 10 solutions authored 5 solutions authored
Loads aren't allowed in User-0 mode either:

TriCore Architecture Manual Vol 1.
MPP - Memory Protection Peripheral Access (TIN 5)
A program executing in User-0 mode attempted a load or store access to a segment is configured to be a peripheral segment.
0 Likes
MoD
Employee
Employee
50 likes received 500 replies posted 100 solutions authored
Each task is allocated its own mode, depending on the task’s function:
• User-0 Mode: Used for tasks that do not access peripheral devices. This mode cannot enable or disable interrupts.
• User-1 Mode: Used for tasks that access common, unprotected peripherals. Typically this would be a read or write access to serial port, a read access to timer, and most I/O status registers. Tasks in this mode may disable interrupts for a short period. (The default behaviour of this mode may be overriden by the system control register).
• Supervisor Mode: Permits read/write access to system registers and all peripheral devices. Tasks in this mode may disable interrupts.
As written, you are in User-0 mode and get therefore a trap. In User-1 mode you can access the peripherals therefore the peripherals must be readable in User mode.
0 Likes
User19909
Level 3
Level 3
First like received
MoD wrote:
Each task is allocated its own mode, depending on the task’s function:
• User-0 Mode: Used for tasks that do not access peripheral devices. This mode cannot enable or disable interrupts.
• User-1 Mode: Used for tasks that access common, unprotected peripherals. Typically this would be a read or write access to serial port, a read access to timer, and most I/O status registers. Tasks in this mode may disable interrupts for a short period. (The default behaviour of this mode may be overriden by the system control register).
• Supervisor Mode: Permits read/write access to system registers and all peripheral devices. Tasks in this mode may disable interrupts.
As written, you are in User-0 mode and get therefore a trap. In User-1 mode you can access the peripherals therefore the peripherals must be readable in User mode.


I checked the PSW.IO and the value is supervisor, but as I said the issue only takes place if I am not using the debugger, if I am using the debugger the trap is not invoked
0 Likes
NeMa_4793301
Level 6
Level 6
10 likes received 10 solutions authored 5 solutions authored
When a debugger is connected, the watchdog system is disabled by default. Could it be that that line just happens to be where the watchdog expires? Which alarm are you seeing?
0 Likes