Armando Montanez | 0874558 | 2019-12-12 10:51:50 -0800 | [diff] [blame^] | 1 | .. _chapter-stm32f429i-disc1: |
| 2 | |
| 3 | .. default-domain:: cpp |
| 4 | |
| 5 | .. highlight:: sh |
| 6 | |
| 7 | ---------------- |
| 8 | stm32f429i-disc1 |
| 9 | ---------------- |
| 10 | The STMicroelectronics STM32F429I-DISC1 development board is currently Pigweed's |
| 11 | primary target for on-device testing and development. |
| 12 | |
| 13 | Building |
| 14 | ======== |
| 15 | To build for this target, change the ``pw_target_config`` GN build arg to point |
| 16 | to this target's configuration file. |
| 17 | |
| 18 | .. code:: sh |
| 19 | |
| 20 | $ gn gen --args='pw_target_config = "//targets/stm32f429i-disc1/target_config.gni"' out/disco |
| 21 | $ ninja -C out/disco |
| 22 | |
| 23 | or |
| 24 | |
| 25 | .. code:: sh |
| 26 | |
| 27 | $ gn gen out/disco |
| 28 | $ gn args |
| 29 | # Modify and save the args file to update the pw_target_config. |
| 30 | pw_target_config = "//targets/stm32f429i-disc1/target_config.gni" |
| 31 | $ ninja -C out/disco |
| 32 | |
| 33 | Testing |
| 34 | ======= |
| 35 | The default Pigweed build target will build all of the pigweed module unit |
| 36 | tests. These tests can be run on-device in a few different ways. |
| 37 | |
| 38 | Run a unit test |
| 39 | --------------- |
| 40 | Test if using ``out/disco`` as your build directory, tests will be located in |
| 41 | ``out/disco/obj/[module name]/[test_name].elf``. To run these on device, the |
| 42 | stm32f429i-disc1 target provides a helper script that flashes the test to a |
| 43 | device and then runs it. |
| 44 | |
| 45 | .. code:: sh |
| 46 | |
| 47 | # Setup pigweed environment. |
| 48 | $ . env_setup/setup.sh |
| 49 | # Run test. |
| 50 | $ stm32f429i_disc1_unit_test_runner /path/to/binary |
| 51 | |
| 52 | Run multiple tests |
| 53 | ------------------ |
| 54 | Running all tests one-by-one is rather tedious. To make running multiple |
| 55 | tests easier, use Pigweed's ``pw test`` command and pass it your build directory |
| 56 | and the name of the test runner. By default, ``pw test`` will run all tests, |
| 57 | but you can restrict it to specific groups using the ``--group`` flag. |
| 58 | Individual test binaries can be specified with the ``--test`` flag as well. |
| 59 | |
| 60 | .. code:: sh |
| 61 | |
| 62 | # Setup pigweed environment. |
| 63 | $ . env_setup/setup.sh |
| 64 | # Run test. |
| 65 | $ pw test --root out/disco/ --runner stm32f429i_disc1_unit_test_runner |