roll: third_party/pigweed 74 commits

b71abe8012cb8ce pw_target_runner: Increase maximum message size fo
bf88de9f5c04467 pw_system: Reusable DeviceConnection functionality
ada3a6bb4f662b4 pw_web: Add filter field buttons and placeholder
db01bc93c1a3857 pw_web: Include core .proto files in the npm bundl
a047c412171136c pw_toolchain_bazel: Add native binary for clang-ti
f2e580ecbc81acb pw_bluetooth_sapphire: Remove modulo operator from
cca41e3e720679b third_party/freertos: Add missing CM33_NTZ header
8abeae9d31fcdbe pw_web: Add newlines, separators, and clear for ou
88dbbf23b2f7c6c bazel: Run all tests with googletest backend in CI
b9de0f451197083 pw_env_setup: Use full paths for proj action impor
41a0140c8ece3f4 third_party/googletest: Fix the docs
b041517545b70d1 bazel: Add missing dependencies
9b979cb0cbec695 pw_bluetooth_sapphire: Add Bazel build files to li
932c44e8e5c240e pw_system: Add web console option
7eb32bb61f56148 pw_web: Set min width for message
b4987e47aef3696 pw_stream_uart_mcuxpresso: Clean up dma stream com
1d8d68b37b99966 third_party/icu: Update Bazel rules for dependent
a10dc77e7bf9af0 pw_system: Add missing work queue thread
dbda0e98bd7b9b7 pw_system: Clean up pw_system/threads.cc
cd7e34bbe9e8dcb pw_function: Dynamic allocation for upstream host
61c6b9a2ed03145 pw_web: Implement console-level split panels
27aedcf1158eb97 pw_cpu_exception_cortex_m: Add armv6-m support
e6ad28bbb6ac1c6 pw_web: Update REPL styles
2f86c6dfec93ea9 pw_web: Repl kernel interface and litjs component
97aecb2d19d2df0 pw_build: Add flags_from_dict
73ef002b92f1710 docs: Fix shortlink URL
45fd25bd3ef49ea pw_console: Headless mode with web/ws server runni
fa6e930113bd0e6 pw_presubmit: Narrow copyright notice exclusions
c16a0a5640a7649 dotfiles: Add copyright notice
1e211349047f0ad pw_log_string: Require backend_impl to be set expl
9c624cddf114a93 pw_presubmit: Add copyright notice to some test da
eaebb102be62e06 docs: Add shortlink to pw_enviro draft
205872022755bb3 pw_system: Configurable thread stack sizes
911590baa5a54e9 pw_bluetooth_sapphire: Use pwemb namespace alias i
b403402a8a6ac9c pw_presubmit: Exclude test_data from bazel_lint
ceeae0cc9df8910 .github: Add copyright notice
c89c0361d2438b6 pw_bluetooth_sapphire: Unmask LE Connection Comple
fea8942141d1d72 pw_bluetooth_sapphire: Implement ExtendedLowEnergy
6901feb705154f7 pw_bluetooth_sapphire: Enable bt-host component
4e95e9dc76dda66 pw_bluetooth_sapphire: Support ISO Channel FIDL Pr
1fc96205b72d872 bazel: Don't propagate flags to exec config
1d190f27e281304 pw_presubmit: Exclude files from copyright
afe76e45d26332d pw_bluetooth_sapphire: Add ISO support to controll
73623f58298ca29 pw_malloc_freertos: Fix typo
1154e3a6281e5ce pw_bluetooth_sapphire: Tag integration test
500cb93ede4eb89 pw_bluetooth_sapphire: Implement ExtendedLowEnergy
011d6ca73ef6992 pw_cli: Interactive user index prompt
7c60abf8f32f5cb pw_assert: Split up Bazel assert backend, part 2
211982ec49e2c55 pw_bluetooth_proxy: Delete "sendGattNotify"
418b923b27fbdc2 roll: Update Bazel to 8.0 rolling release
ebb087cf8898715 pw_bluetooth_sapphire: Add packet filtering consts
a4580add7631db4 targets/rp2040: Fix FreeRTOS tick rate
d310201c65256e8 pw_bluetooth_sapphire: Update LEAdvertisers to use
68186af7cb61ccc pw_bluetooth_sapphire: Use Emboss for android vend
71fe6b57143dac8 rp2040: Log on successful flash
a4a547c51f98ea5 pw_bluetooth_sapphire: Use Emboss versions of a2dp
858b5b2a275d57f pw_bluetooth_proxy: Include <optional> in proxy_ho
a4f432177a7e2cf pw_bluetooth_proxy: ProxyHost supports multiple se
6f7b53311728507 roll: Update Bazel to 7.2
c434a087580547b pw_allocator: Remove unnecessary template
6a928e54c51c63c pw_toolchain: Disable PIE for Golang
3178503b13226d7 pw_rpc: Expand comment for internal::ClientServerT
40ced78e4ae4490 pw_presubmit: Don't automatically use exclusions
0a4a217f91f65fb pw_async2: Add missing thread_stl dependency
a5f72ef6f5e0e78 roll: go
434ae75c94cbd00 roll: cmake
ca9cf97101655f2 third_party/mbedtls: Remove old build file
9ea805fc87d0853 pw_cpu_exception: Remove multiplexers
1fe2f388a99a60c third_party/mbedtls: Rename build file
d4308f754669e92 pw_rpc: Update docs
1643306da16c9b2 third_party/emboss: Add missing ir_data_utils.py t
db3b2adb2df73dc bazel: Provide backend collections as dicts
4a79fe82a35e6b8 third_party/emboss: Update emboss to v2024.0702.21
4749e232d808939 pw_trace: Remove backend multiplexer

https://pigweed.googlesource.com/pigweed/pigweed
third_party/pigweed Rolled-Commits: f219e65ac4075ab..b71abe8012cb8ce
Roller-URL: https://ci.chromium.org/b/8742662329257914145
GitWatcher: ignore
CQ-Do-Not-Cancel-Tryjobs: true
Change-Id: I58b49938e9a4d7f12a50a4d02f66662f79650367
Reviewed-on: https://pigweed-review.googlesource.com/c/gonk/+/222561
Bot-Commit: Pigweed Roller <pigweed-roller@pigweed-service-accounts.iam.gserviceaccount.com>
Commit-Queue: Pigweed Roller <pigweed-roller@pigweed-service-accounts.iam.gserviceaccount.com>
Lint: Lint 🤖 <android-build-ayeaye@system.gserviceaccount.com>
1 file changed
tree: 3a4a89a6ac57fa90df71b56ed3fd55b367d21466
  1. applications/
  2. build_overrides/
  3. fpga/
  4. lib/
  5. pcb/
  6. scripts/
  7. targets/
  8. third_party/
  9. tools/
  10. .gitignore
  11. .gitmodules
  12. .gn
  13. banner.txt
  14. bootstrap.sh
  15. BUILD.gn
  16. BUILDCONFIG.gn
  17. OWNERS
  18. pigweed.json
  19. README.md
README.md

Gonk

Getting Started

  1. Clone the repo

    git clone https://pigweed.googlesource.com/gonk
    
  2. Source bootstrap.sh to download all compilers and tooling into the environment directory:

    . ./bootstrap.sh
    

    This should init all git submodules for you.

  3. From here on the Pigweed environment is activated. You can activate the environment in a new shell without re-running bootstrap by sourcing activate.sh

    . ./activate.sh
    

Compile:

Build for the host and device by running:

pw build

This is mostly a shortcut with nice output for running gn gen out/gn and ninja -C out/gn.

The build commands are defined in: //tools/gonk_tools/build_project.py.

Gonk Verilog:

The Verilog build requires the following to be installed on Linux:

sudo apt install fpga-icestorm nextpnr-ice40 yosys

Run this to compile:

pw build

The bitstream files will be written with the .bin extenson under ./out/gn/obj/fpga/*/*.bin along with log output files.

For example:

$ ls ./out/gn/obj/fpga/toplevel/
nextpnr-log.txt
toplevel.asc
toplevel.bin
toplevel.json
toplevel_timing_report.json
toplevel_timing_report.txt
yosys-log.txt

Gonk fpga config Example

Flash the stm32f7 and launch the write_fpga.py script on a bitstream file.

Flash via DFU

  1. Unplug gonk from USB and replug with MODE button held down.

  2. Run gonk-flash on the MCU binary. This uses pyfu-usb.

    gonk-flash --bin-file ./out/gn/arduino_size_optimized/obj/applications/fpga_config/fpga_config.bin
    

Write the FPGA bitstream

  1. Write an FPGA bitstream with the write_fpga.py script:

    gonk \
      --bitstream-file ./out/gn/obj/fpga/toplevel/toplevel.bin
      --database ./out/gn/arduino_size_optimized/obj/applications/fpga_config/bin/fpga_config.elf \
      --log-to-stderr
    

    You can redirect host and device logs to separate files with:

    gonk \
      --bitstream-file ./out/gn/obj/fpga/toplevel/toplevel.bin
      --database ./out/gn/arduino_size_optimized/obj/applications/fpga_config/bin/fpga_config.elf \
      --host-logfile gonk-host-logs.txt \
      --device-logfile gonk-device-logs.txt
    

Alternative: Flash with BlackMagic Probe

./scripts/flash-with-blackmagic-probe.sh ./out/gn/arduino_size_optimized/obj/applications/spi_flash_test/bin/spi_flash_test.elf

Generating the Gonk Python Bundle

On Linux with the FPGA toolchain available run:

pw build

The zip file containing all the dependencies for the gonk python tooling is located in:

out/gn/obj/gonk_bundle.zip

Inside are the Python wheels for gonk_dist, gonk_firmware, and all third_party dependencies.

gonk_bundle
├── python_wheels
│   ├── appdirs-1.4.4-py2.py3-none-any.whl
│   ├── astroid-3.0.1-py3-none-any.whl
│   ├── ...
│   ├── gonk_dist-0.0.1+20240305140627-py3-none-any.whl
│   ├── gonk_firmware-0.0.1+20240305140542-py3-none-any.whl
│   ├── ...
│   └── wheel-0.40.0-py3-none-any.whl
├── requirements.txt
├── setup.bat
└── setup.sh

pw_system Example

Run on Host

Run the host app and connect to it via pw-system-console:

./out/gn/host_device_simulator.speed_optimized/obj/applications/system_example/bin/system_example & \
  pw-system-console --socket-addr default \
    --proto-globs third_party/pigweed/pw_rpc/echo.proto ; \
  killall system_example

Run on Device

Flashing

openocd -s $PW_PIGWEED_CIPD_INSTALL_DIR/share/openocd/scripts \
  -f $GONK_ROOT/targets/stm32f769i_disc0_stm32cube/openocd_stm32f7xx.cfg \
  -c "program out/gn/stm32f769i_disc0_stm32cube.size_optimized/obj/applications/system_example/bin/system_example.elf reset exit"

Updating STM32Cube

Checkout the desired commits in each of these submodules:

third_party/stm32cube_f7/cmsis_core
third_party/stm32cube_f7/cmsis_device
third_party/stm32cube_f7/hal_driver

Then run from Gonk root:

python -m pw_stm32cube_build gen_file_list third_party/stm32cube_f7

Pin Map

Misc

NetSTM32 PinSTM32 FunctionFunction
STATUSPB13GPIO_OutputSTAT LED

SPI Flash Connection

NetFPGA IO#STM32 PinSTM32 FunctionFlash Pin
ICE_SPI_SS71PD2GPIO_OutputS#
ICE_SPI_MISO68PB4SPI1_MISODQ1
ICE_SPI_MOSI67PB5SPI1_MOSIDQ0
ICE_SPI_SCK70PB3SPI1_SCKC
FLASH_HOLD63PC11GPIO_OutputHOLD#/DQ3
FLASH_WP64PC12GPIO_OutputW#/VPP/DQ2

FPGA Connection

NetFunctionFPGA IO#STM32 PinSTM32 FunctionNotes
FPGA_IO_SPARE_0_2rst_i135PA0GPIO_OutputActive high
FPGA_IO_SPARE_0_0mode_i137PB11GPIO_OutputFPGA operation mode
DSPI_CSvalid_o75PB6GPIO_OutputData/Transfer Valid
FPGA_IO_SPARE_1_1miso_i101PC2SPI1_MISO
FPGA_IO_SPARE_1_0mosi_i99PC3SPI1_MOSI
I2C_O_SDAcs_n79PB9SPI1_NSS
FPGA_IO_SPARE_0_1sclk_i136PB10SPI1_SCK
FPGA_IO_SPARE_2_049PA7
FPGA_IO_SPARE_2_148PA6
FPGA_IO_SPARE_2_247PA5
FPGA_IO_SPARE_2_345PA4

Capture ADC samples and plot

  1. First bootstrap, run pw build and flash gonk using DFU.

    . ./bootstrap.sh
    
    pw build
    

    Unplug gonk from USB and replug with MODE button held down.

    Run gonk-flash on the MCU binary. This uses pyfu-usb.

    gonk-flash ./out/gn/arduino_size_optimized/obj/applications/fpga_config/fpga_config.bin
    
  2. Start capturing ADC samples with:

    python tools/gonk_tools/write_fpga.py \
      --bitstream-file ./out/gn/obj/fpga/toplevel/toplevel.bin \
      --database ./out/gn/arduino_size_optimized/obj/applications/fpga_config/bin/fpga_config.elf \
      --host-logfile gonk-host-logs.txt \
      --device-logfile gonk-device-logs.txt \
      --log-to-stderr
    
    • Press Enter to stop or start ADC continuous updates. It will begin automatically on startup.
    • Press ctrl-c to quit.
  3. Plot the logs from gonk-device-logs.txt with:

    python tools/gonk_tools/plot.py -i gonk-device-logs.txt -o plot.svg