This is a new port of FreeRTOS (V8.2.2) to run it as 32-bits mode on the new architecture of ARM processor (ARMv8).
Overall description
-------------------------
The main goal of this demonstration is to port FreeRTOS in order to integrate it in a layer of ARM Trusted Firmware.
The ARM trusted firmware is an ARMv8 open source framework that enables the usage of Trustzone and boots a Secure payload and a Non trusted firmware (See the link https://github.com/ARM-software/arm-trusted-firmware/blob/master/docs/user-guide.md for more information about ATF).
In this demonstration, FreeRTOS will be executed in the Secure world (BL3-2) while a General-Purpose Operating system (e.g Linux) will be executed in the Normal world (BL3-3) concurrently. An EL3 firmware application (BL3-1) is in charge of the context switching operation to share CPU resources between the two operating systems.
This FreeRTOS port example is composed by two tests:
The first (QueueMsgTask) could be run on the ARM Fast Model virtual platform and execute only two tasks synchronized by a queue and print a message on UART to inform the user of test state.
The second one (JunoLedBlinking) could be run only on ARM JUNO Development platform because this test controls the LED lighting sequentially (To see LEDs you have to remove the cover of the JUNO platform).
FreeRTOS compilation
--------------------------------
The compiler used for this example is "arm-none-eabi". As FreeRTOS includes a standard C library and "arm-none-eabi" is a bare metal compiler, you have to use newlib to compile this FreeRTOS port.
1. Execute the script "newlib_Instalation.sh" to install the library necessary for the compilation.
2. Then you can compile a test example:
- ARM FastModel example => make fvp
- JUNO platform example => make juno
3. Finally you have to integrate the binary "FreeRTOS_port_Aarch32.bin" generated in the ARM Trusted Firmware binary. Clone the repository where the service for a 32-bit Secure Payload has been implemented.
- git clone https://github.com/virtualopensystems-kchappuis/arm-trusted-firmware.git -b tspd_aarch32_service
4. Compile the ARM Trusted Firmware: (For more information about ATF compilation, please refers to https://github.com/ARM-software/arm-trusted-firmware/blob/master/docs/user-guide.md#5--building-the-trusted-firmware).
ATF compilation for ARM Fast Models:
make -j`getconf _NPROCESSORS_ONLN` \
BL33=<path-to>/<bl33_image> \
CROSS_COMPILE=<path-to-aarch64-gcc>/bin/aarch64-linux-gnu- \
DEBUG=0 \
TSP_AARCH32_MODE=1 \
PLAT=fvp SPD=tspd_aarch32 all fip
ATF compilation for ARM JUNO Development Platform:
make -j`getconf _NPROCESSORS_ONLN` \
CROSS_COMPILE=<path-to-aarch64-gcc>/bin/aarch64-linux-gnu- \
BL33=<path-to>/<bl33_image> \
BL30=<path-to>/<bl30_image>
DEBUG=0 \
TSP_AARCH32_MODE=1 \
PLAT=juno SPD=tspd_aarch32 all fip
5. Now you have to add the FreeRTOS (FreeRTOS_port_Aarch32.bin) in the BL3-2 layer of ARM Trusted Firmware binary (fip.bin).
<ATF_path>/tools/fip_create/fip_create \
--dump <ATF_binary_path>/fip.bin \
--bl32 <FreeRTOS_binary_path>/FreeRTOS_port_Aarch32.bin
6. Now you could launch the test.
- To launch a test on ARM Fast Model virtual platform, please refers to this part:
"https://github.com/ARM-software/arm-trusted-firmware/blob/master/docs/user-guide.md#7--preparing-the-images-to-run-on-fvp"
Command example:
<path-to>/FVP_Base_AEMv8A-AEMv8A \
-C pctl.startup=0.0.0.0 \
-C gicv3.gicv2-only=true \
-C bp.secure_memory=1 \
-C cluster0.NUM_CORES=4 \
-C cluster1.NUM_CORES=0 \
-C cache_state_modelled=1 \
-C bp.pl011_uart0.untimed_fifos=1 \
-C bp.secureflashloader.fname=<path-to>/<bl1-binary> \
-C bp.flashloader0.fname=<path-to>/<FIP-binary> \
-C bp.virtioblockdevice.image_path=<path-to>/<file-system-image>
- To launch a test on ARM JUNO Development Platform, please refers to this part:
"https://github.com/ARM-software/arm-trusted-firmware/blob/master/docs/user-guide.md#9--running-the-software-on-juno"
For more information, you could find a step by step guide on Virtual Open Systems website (http://www.virtualopensystems.com/en/solutions/guides/) which describes the process to run a test on JUNO board.
FreeRTOSv8.2.2_ARMv8port.tar.gz