Nios® V Processor Software Developer Handbook

ID 743810
Date 5/26/2023
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

11.2.2. FreeRTOS* Device Drivers

Each peripheral or each hardware component can provide include files and source files in the inc and src subdirectories of the component's HAL directory.

In addition to the HAL directory, a component can optionally provide a FREERTOS directory that contains code specific to the FreeRTOS environment. Similar to the HAL directory, the FREERTOS directory contains inc and src subdirectories. When you create a FreeRTOS project, the BSP Editor copies the include and source directories for a given peripheral to your BSP subdirectory. These include and source directories are added to the search path for the project.

You can use the FREERTOS directory to provide code that is used only in a multithreaded environment. Other than these additional search directories, the mechanism for providing FreeRTOS device drivers is identical to the process for any other device driver.

The HAL system initialization process calls the function ALT_OS_Init() before alt_sys_init(), which instantiates and initializes each device in the system. Therefore, the complete FreeRTOS API is cavailable to device drivers, although the system is still running in single-threaded mode until the program calls vTaskStartScheduler() from within main().