RTX5 RTOS Bare-metal Streamline example for Cortex-A9 - Arm®Development Studio
This Bare-metal Streamline example shows RTX5 RTOS on a Cortex-A9 processor, collection of profiling information from RAM with DSTREAM, and analysis in Streamline.
Purpose and scope
This Bare-metal Streamline example shows RTX5 RTOS on a Cortex-A9 processor, collection of profiling information from RAM with DSTREAM, and analysis in Streamline.
This example is intended to be built with Arm Compiler for Embedded 6. If you wish to modify and rebuild the example, you must use Arm Compiler for Embedded 6 to rebuild it.
This example is intended to run on the Cortex-A9x1 FVP model supplied with Development Studio. A ready-made launch configuration RTX5_Cortex-A9_Blinky_Streamline_FVP.launch is provided to run the example on the Cortex-A9x1 FVP model.
Overview of the example code
The example comprises a simple application in main.c that creates and executes a number of threads.
It calls RTX5 RTOS functions from the referenced CMSIS Pack, and outputs characters to a UART via a simple driver retarget.c and uart.c.
It gets compiled with barman.c that was generated by Streamline to provide all the necessary bare-metal Streamline features.
The application in main.c illustrates the use of Streamline annotations (both marker and channel annotations).
Some additional "plumbing" code is provided in main.c to initialize barman, to allow barman to read the current task from RTX5, and for RTX5 to inform barman when a task switch occurs.
To avoid having to modify the CMSIS Pack, armlink's $Sub/$Super mechanism is used to "patch" the original RTX5 functions, to allow some extra work to be done between caller and callee.
The result is that all the plumbing code between RTX5 and barman is collected together into a single C file. This helps to simplify future maintenance and should ease the porting to other RTOSes and/or toolchains.
For example, GNU ld has the "--wrap" command-line option that works in a similar way.
Building the example
A pre-built executable is provided, so there is no need to build the example unless you modify the source code.
This example can be built with Arm Compiler for Embedded 6 using the supplied Eclipse managed builder project, or directly on the command-line with the supplied makefile.
The example depends on the CMSIS Packs ARM.CMSIS.6.0.0, ARM.Cortex_DFP.1.0.0, and ARM.CMSIS-RTX.5.8.0. These will be installed automatically by the Pack Manager,
unless "Automatically install missing Packs when loading projects" in the "CMSIS Packs" preference page has been unticked.
To install the CMSIS Packs manually, switch to the CMSIS Pack Manager perspective then, in the Packs tab, enter "ARM.CMSIS",
locate 6.0.0 in the list, then click on Install. Do the same for the other Packs.
If building on the command-line with the supplied makefile, you must also set the CMSIS_PACKS environment variable in the makefile to the Pack's installation folder.
CMSIS Packs are Open Source. The source code can be downloaded from
GitHub.
Building on the command-line
Before building this example, first install the ARM.CMSIS.6.0.0 Pack using the Pack Manager, then edit the makefile to set CMSIS_PACKS to its folder path.
To build the example on the command-line with the supplied make utility:
On Windows, open an Arm DS Command Prompt from the Start menu, run the select_toolchain utility, and select Arm Compiler for Embedded 6 from the list
On Linux, run the suite_exec utility with the --toolchain option to select the compiler and start a shell configured for the Development Studio environment, for example: ~/developmentstudio/bin/suite_exec --toolchain "Arm Compiler for Embedded 6" bash
Then navigate to the ...\RTX5_Cortex-A9_Blinky_Streamline directory, and type:
make
The usual make rules: clean and all are provided in the makefile.
Building within the IDE
To build the supplied projects within the IDE:
In the Project Explorer view, select the project you want to build.
Select .
Running the example on Cortex-A9x1 FVP model
Select .
In the Debug Configurations dialog, expand the list of Generic Arm C/C++ Application configurations on the left-hand side,
and select RTX5_Cortex-A9_Blinky_Streamline_FVP.
Click on Debug to start debugging. The example executable will be downloaded to the target,
and the program counter PC will be set to the entry point of the image.
Run the executable by clicking on the green Continue button in the Debug Control view, or by pressing F8 on the keyboard. Text output appears in the Telnet window.
After a few seconds, stop execution by clicking on the yellow Interrupt button in the Debug Control view, or by pressing F9.
Open the Scripts view, then drag and drop barman_in_memory_helpers.py from the Project Explorer view to the Scripts view.
In the Scripts view, expand Use case then Scripts in then barman_in_memory_helpers.py.
Right-mouse-click on Dump buffer and select Configure and enter the name of a file to receive the dumped capture data, for example barman.bin.
Right-mouse-click on Dump buffer and select Run barman_in_memory_helpers.py::Dump buffer. Check the Commands view that the capture data was dumped correctly.
Launch Streamline, and use to browse to and select barman.bin.
In the Streamline Data panel, right click on the capture file and select Analyze.... Use Add ELF image... to browse to and select the executable image RTX5_Cortex-A9_Blinky_Streamline.axf, then click Analyze.
After a few moments processing the data, Streamline presents a Timeline view containing charts of counters selected in barman.xml.
If you wish to change the selection of counter charts displayed in the Timeline, you can do so via , and follow the prompts. This will generate new barman.c/.h/.xml files. You will then need to rebuild the image and run it again to collect the profiling data for your new counters selection.
See also:
Copyright© 2010-2024 Arm Limited (or its affiliates). All rights reserved.