Cannot configure Objective C in the RL-RTX (cm3) task, otherwise the reason for entering the hardfault

Source: Internet
Author: User

Cannot configure Objective C in the RL-RTX (cm3) task, otherwise the reason for entering the hardfault

Http://www.keil.com/support/man/docs/rlarm/rlarm_ar_cfgrunpriv.htm

Run in privileged Mode
The RTX library of the cortex-M device allows you to select the running mode of user tasks. The task can run in two modes:

  • Non-privilege mode-Protected Mode
  • Privileged mode-Unprotected Mode

Protection should refer to operating system protectionCodeRun]

In privileged mode, you can access and configure system registers and control registers, such as the objective C interrupt controller. In non-privileged mode, these operations are not allowed. Accessing the Objective C register in non-privileged mode will cause hardware errors (hard fault ).

  • MacroOS _runprivEnables all tasks to run in privileged mode. Set 1 to enable the privileged mode, and set 0 to disable the privileged mode. This macro is disabled by default.

For old projects, you can enable the privileged mode. When the new cortex-m rtx kernel library is updated and the rtx_config.c configuration file is replaced, the existing code can be run without any changes. In privileged mode, tasks are unprotected. You can configure the system in any task, such as configuration interruption.
The privileged mode is disabled by default. This allows all tasks to run in protected mode. The task cannot change the system configuration or interrupt. You have two options:

  • Run the configuration code in privileged mode such as _ SVC function in the task
  • When the system kernel is not started, that is, when the device is still running in privileged mode, run the configuration code

Note:

  • This option is not supported in the RTX kernel library of arm7.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.