This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Operation mode configuration method eg. Privilege and user mode

Hi ,

In TRM, in the description of many registers, it offer refers to like this: "Privilege and user mode writes have no effect". and also, in some descriptions in refers to "emulation mode".

So, my question is: how to configure the system in privilege mode or user mode or emulation mode, in which register? How many operating modes does this MCU have and how to configure ?

Thanks.

  • Fumin,

    ARM Cortex R4 has several operating modes listed here.

    Some TMS570 registers have restricted accesses. Typically these register are read only in user mode and writes can be done in privileged mode. Coming out of reset the CPU is in a privileged mode and you enter user mode by writing to the CPSR register.

    Emulation mode (also referred to as Debug/suspend mode elsewhere in the TMS570 TRM) is when a debugger is connected to the device. This is configured automatically by the debugger.

    Abhishek

     

     

     

  • In TRM "Literature Number: SPNU489B", I can't find the description of register CPSR.

    what does this sentence mean "Coming out of reset the CPU is in a privileged mode and you enter user mode by writing to the CPSR register."?

    and what should be writen to the CPSR reigster ? does this is done by programmer manually ?

  • Fumin,

    CPSR is an ARM Cortex R4 CPU register. Information on this register can be found in the Cortex R4 TRM and specifically here.

    Let me rephrase: When you power up the device, the CPU is in privileged mode. You can decide to stay in this mode and execute all your code in this mode. If you want to enter user mode, you will have to program that.

    Abhishek

  • Does this understanding correct ? when power up the device, it will stay in priviledge mode in default. If want to enter user mode, i have to program the CPSR register.

    and my question is,When i am developing, i will keep it in priviledge mode. but if our product is distributed to customer in market, do i need to make sure it runs in user mode ? and how to program into user mode ? 

  • The decision of whether to run all code in privilege mode or to utilize both CPU supported privilege levels is ultimately up to the developer.  Most real time operating systems will implement both levels of privilege, with the operating system executing privileged code and the user tasks executing unprivileged code.  Several key configuration registers in the TMS570 architecture are built to support write access only in privilege mode, such that non-privileged user code may not alter system configuration.

    For more information on the privilege modes of the ARM architecture, please refer to the ARM Cortex R4F TRM or the ARM Architecture Reference Manual (v7A/R version).

     

    Regards,

    Karl