ARM Cortex-A specific FreeRTOSConfig.h settingsThe following settings must be included in FreeRTOSConfig.h. Note these settings are specific to the ARM Cortex-A RTOS port for processors that use a proprietary interrupt controller. The settings for the RTOS port for ARM Cortex-A processors that use the ARM GIC are different because they also configure the GIC.
Note: If there is an official demo for the Cortex-A9 processor you are using then the FreeRTOSConfig.h file provided with the demo will already contain the correct settings.
Configuring and installing the RTOS tick interruptEvery official FreeRTOS demo that targets an ARM Cortex-A based embedded processor includes code to configure a timer to generate the RTOS tick interrupt, and install the FreeRTOS tick interrupt handler. The following information is only required if you need to change the provided implementation.The macro configSETUP_TICK_INTERRUPT() is called by the RTOS kernel port layer. configSETUP_TICK_INTERRUPT() must be #defined in FreeRTOSConfig.h to configure a peripheral to generate a periodic interrupt at the frequency set by the configTICK_RATE_HZ FreeRTOSConfig.h setting. FreeRTOS_Tick_Handler() must then be installed as the interrupt's handling function. For example:
Interrupt handlingOfficial RTOS demo applications include example interrupt handlers. Refer to the official RTOS demo application for the processor in use to find examples and reference source code.Interrupt entry, nesting, and exit is managed by the RTOS kernel port layer so interrupt handlers provided by the application writer can be standard C functions. Specific interrupt related pragmas, assembly code wrappers or attribute qualifiers are not required. Interrupt handling routes provided by the application writer are called by the RTOS with interrupts enabled. Also see the description of the configINTERRUPT_VECTOR_ADDRESS FreeRTOSConfig.h setting above.
Installing the FreeRTOS IRQ and SWI (SVC) interrupt handlersFreeRTOS_IRQ_Handler() must be installed as the Cortex-A's IRQ handler.FreeRTOS_SWI_Handler() must be installed as the Cortex-A's SWI (SVC) handler. If it is not possible to edit the interrupt vector code then map the FreeRTOS handlers to the required handler names using #defines in FreeRTOSConfig.h. For example, if the installed handlers are called IRQ_Handler() and SWI_Handler() respectively, then the FreeRTOS handlers can be mapped to these names by adding the following two lines to FreeRTOSConfig.h.
Cortex-A processor modes and stacksThe C start up code must, as a minimum, configure stacks for the IRQ and Supervisor modes of the Cortex-A processor. main() must be called from a privileged mode, preferably Supervisor mode.It is not necessary to allocate a stack to User/System mode unless main() is called from System mode (main() must not be called from User mode). If a stack is allocated to User/System mode it will not be used after the RTOS kernel has been started.
The RTOS stack overflow detection functionality only detects overflows in
task stacks, not IRQ or Supervisor stacks.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|
Latest News
NXP tweet showing LPC5500 (ARMv8-M Cortex-M33) running FreeRTOS. Meet Richard Barry and learn about running FreeRTOS on RISC-V at FOSDEM 2019 Version 10.1.1 of the FreeRTOS kernel is available for immediate download. MIT licensed. View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS. Careers
FreeRTOS and other embedded software careers at AWS. FreeRTOS Partners
|