The FreeRTOS API remains substantially the same between single core and SMP versions except for these additions. Therefore, an application written for the FreeRTOS single core version should compile with the SMP version with minimal to no effort. However, there may be some functional issues, as some assumptions which were true for single core applications may no longer be true for those on multi-cores.
One such common assumption is that a lower priority task cannot run while a higher priority task is running. While this was true on a single core, it is no longer true for multi-cores, as multiple tasks can be running simultaneously. If the application relies on relative task priorities to provide mutual exclusion, it may observe unexpected results in a multi-core environment. The application writer has couple of options to address this:
vTaskCoreAffinitySet
API.configRUN_MULTIPLE_PRIORITIES
to 0
which
ensures that multiple tasks will run simultaneously only if they have the
same priority. Note that this may result in under utilization and put some
cores to idle when they could be used to run other low priority tasks.One other common assumption is that ISRs cannot run simultaneously with each
other or with other tasks. This is no longer true in a multi-core environment
and the application writer needs to ensure proper mutual exclusion while
accessing shared data between tasks and ISRs. The macros taskENTER_CRITICAL_FROM_ISR()
and taskEXIT_CRITICAL_FROM_ISR()
can be used in ISRs and the macros
taskENTER_CRITICAL()
and taskEXIT_CRITICAL()
can be used in tasks to provide
such mutual exclusion.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。