5 years, 4 months ago.

How to write to / read from registers in supervisor mode

Hi,

I have a FRDM-KW41Z device that supoprts low power mode. According to the datasheet, putting the device into this mode requires writing to some registers in supervisor mode.

Unfortunately, after much Googling, I am none the wiser how to achieve this. I know that interrupts are handled in this mode, and I can trigger an interrupt on something like the press of a button, but this is surely not the right way to go about this? Setting these registers should happen right at the start of my program.

Is there some way to make a system call to request a register is written? I'm feeling very confused!

Any help you can provide would be much appreciated!

Joel

When you say 'low power mode' are you referring to a 'sleep/deep sleep' state no code running or a general clock/peripheral 'slow' down to reduce power consumption in operational mode?

posted by Paul Staron 14 Dec 2018

The latter - the low power mode shuts down or slows down various peripherals and slows the CPU / bus. It changes the behaviour of RUN/STOP states.

posted by Joel Lurcook 14 Dec 2018

1 Answer

5 years, 4 months ago.

Hi Joel,

In the Arm architecture we use the term "privileged" instead of supervisor. Out of reset the core will be in privileged mode and in fact with Mbed the core always stays privileged. We don't make use of non-privileged mode.

So to summarize, you shouldn't have to do anything special to write to the registers you see in the datasheet.

Regards,

Ralph, Team Mbed

Accepted Answer