• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1.. _target-stm32f429i-disc1-stm32cube:
2
3---------------------------
4stm32f429i-disc1: STM32Cube
5---------------------------
6.. warning::
7  This target is in a very preliminary state and is under active development.
8  This demo gives a preview of the direction we are heading with
9  :ref:`pw_system<module-pw_system>`, but it is not yet ready for production
10  use.
11
12
13The STMicroelectronics STM32F429I-DISC1 development board is currently Pigweed's
14primary target for on-device testing and development. This target configuration
15uses :ref:`pw_system<module-pw_system>` on top of FreeRTOS and the STM32Cube HAL
16rather than a from-the-ground-up baremetal approach.
17
18-----
19Setup
20-----
21To use this target, Pigweed must be set up to use FreeRTOS and the STM32Cube HAL
22for the STM32F4 series. The supported repositories can be downloaded via
23``pw package``, and then the build must be manually configured to point to the
24locations the repositories were downloaded to.
25
26.. code:: sh
27
28  pw package install freertos
29  pw package install stm32cube_f4
30  pw package install nanopb
31
32  gn args out
33    # Add these lines, replacing ${PW_ROOT} with the path to the location that
34    # Pigweed is checked out at.
35    dir_pw_third_party_freertos = "${PW_ROOT}/.environment/packages/freertos"
36    dir_pw_third_party_stm32cube_f4 = "${PW_ROOT}/.environment/packages/stm32cube_f4"
37    dir_pw_third_party_nanopb = "${PW_ROOT}/.environment/packages/nanopb"
38
39Building and running the demo
40=============================
41This target has an associated demo application that can be built and then
42flashed to a device with the following commands:
43
44.. code:: sh
45
46  ninja -C out pw_system_demo
47
48  openocd -f targets/stm32f429i_disc1/py/stm32f429i_disc1_utils/openocd_stm32f4xx.cfg -c "program out/stm32f429i_disc1_stm32cube.size_optimized/obj/pw_system/bin/system_example.elf reset exit"
49
50Once the board has been flashed, you can connect to it and send RPC commands
51via the Pigweed console:
52
53.. code:: sh
54
55  pw-system-console -d /dev/{ttyX} -b 115200 --proto-globs pw_rpc/echo.proto --token-databases out/stm32f429i_disc1_stm32cube.size_optimized/obj/pw_system/bin/system_example.elf
56
57Replace ``{ttyX}`` with the appropriate device on your machine. On Linux this
58may look like ``ttyACM0``, and on a Mac it may look like ``cu.usbmodem***``.
59
60When the console opens, try sending an Echo RPC request. You should get back
61the same message you sent to the device.
62
63.. code:: sh
64
65  >>> device.rpcs.pw.rpc.EchoService.Echo(msg="Hello, Pigweed!")
66  (Status.OK, pw.rpc.EchoMessage(msg='Hello, Pigweed!'))
67
68You are now up and running!
69