PSTEST_STM32F746G_Discovery_Managed
Project-Based Workflow for Running C/C++ Tests and Collecting Coverage on STM32 Discovery Board Using Polyspace Test
This demo contains target registration files to register an STM32F746G Discovery board with Polyspace Test. After using the files to register this target, you will be able to:
- Build tests in a Polyspace Platform project using the GNU ARM toolchain for ARM Cortex-M processor families.
- Run tests on the registered target board and review test results
- Compute code coverage after running the tests on the target board
This demo shows the workflow for running tests on a target board using a Polyspace Platform project (in the Polyspace Platform user interface or at the command line). If you are used to authoring and running tests from within the STM32Cube IDE, see Running C/C++ Tests and Collecting Coverage on STM32 Discovery Board.
To register the target using the files in this repository, you need the following:
-
GNU ARM Compiler: Extract the GNU ARM compiler files into a folder that does not contain spaces. For instance, avoid a subfolder of
C:\Program Files
. - STM32CubeProgrammer: Install the STM32Programmer tool.
- STM32CubeF7: Clone the STM32CubeF7 Git repository. For instance, you can enter the following at the command line:
git clone --recursive https://github.com/STMicroelectronics/STM32CubeF7.git
The target registration files contain some information that is specific to the end user. Make sure you adapt this information to your installations before registering your target. If you forget to make the changes before registering your target, you can unregister the target, make the changes, and re-register the target.
- Download the demo and extract into a folder
pstest_custom_target_tutorial
. - Edit the paths in
STM32F746GPrefs.json
to point to your installation folders:
-
ProgrammerPath
: Enter the full path to the STM32Programmer executable,STM32_Programmer_CLI.exe
. -
GnuARMPath
: Enter the full path to the GNU ARM compiler compiler installation. This folder is the one where you extracted the GNU ARM compiler files in the Prerequisites section. The folder contains subfolders such asarm-none-eabi
,bin
,include
,lib
, andshare
. -
STM32CubeF7Path
: Enter the full path to the STM32 Cube F7 Git repository cloned in the Prerequisites section. -
ComPort
: Enter the STLink Virtual communication port, for instance,COM4
. In Windows, you can find the communication port by going to Device Manager and looking under Ports.
After configuring paths, you can register the target in the user interface or from the command line.
To register the target in the Polyspace Platform user interface:
- Open a project configuration. You can use any project including the project in the folder
pstest_custom_target_tutorial\ex
. - On the Build tab, click the gear icon next to Target board name.
- On the Manage Boards window, select Register a target.
- Navigate to the folder
pstest_custom_target_tutorial
and select the fileSTM32F746G_Discovery_PackageRegister.m
.
To unregister the target:
- Open a project configuration.
- On the Build tab, click the gear icon next to Target board name (Testing).
- On the Manage Boards window, select Unregister a target.
- Navigate to the folder
pstest_custom_target_tutorial
and select the fileSTM32F746G_Discovery_UnPackageRegister.m
.
You can also register and unregister the target at the command-line.
To register the target, at the command line, enter:
<pstest_install_root>/polyspace/bin/polyspace-test.exe -manage-target-package -register-from-file <target_install_root>/STM32F746G_Discovery_PackageRegister.m
To unregister the target, at the command line, enter:
<pstest_install_root>/polyspace/bin/polyspace-test.exe -manage-target-package -unregister-from-file <target_install_root>/STM32F746G_Discovery_PackageUnregister.m
Here:
-
<pstest_install_root>
is the Polyspace installation folder. -
<target_install_root>
is the path to the folderpstest_custom_target_tutorial
.
After you register the target, you can select this target for building and running the tests.
Select the previously registered target in your project configuration.
- Open your project configuration. You can use any project including the project in the folder
pstest_custom_target_tutorial\ex
. - On the Build tab, from the dropdown for Target board name (Testing), select
STM32F746G_Custom_Target
. - You should see the following selections for these options:
-
Processor:
ST-STM32F746NGH6
. You cannot change the processor. To see the processor characteristics, click the gear icon next to the dropdown -
Compilation toolchain (Testing):
GCC ARM Cortex M | STM32F746G
. You can pick a different compilation toolchain if available.
When you build a project and run tests, the build and run uses the target that you selected in the project configuration.
To build a project with the registered target board and toolchain, at the command line, enter:
<pstest_install_root>/polyspace/bin/polyspace-test.exe -build -project <project> -board STM32F746G_Custom_Target - toolchain "GCC ARM Cortex M | STM32F746G"
To run tests in a project with the registered target board and toolchain, at the command line, enter:
<pstest_install_root>/polyspace/bin/polyspace-test.exe -run -project <project> -board STM32F746G_Custom_Target - toolchain "GCC ARM Cortex M | STM32F746G"
Cite As
Nicolas Chatelain (2024). PSTEST_STM32F746G_Discovery_Managed (https://github.com/nchatela/PSTEST_STM32F746G_Discovery_Managed), GitHub. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxTags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
Versions that use the GitHub default branch cannot be downloaded
Version | Published | Release Notes | |
---|---|---|---|
1.0.0 |
|