README: update few readme notes

Add notes about dfu-util throwing an error and stlink actually working.

BUG=none
TEST=check on gitiles

Change-Id: I496942cad5eef78015a469cc4a1c4c0b7c3b078e
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec-aic-tester/+/6174675
Reviewed-by: Keith Short <keithshort@chromium.org>
Tested-by: Fabio Baltieri <fabiobaltieri@google.com>
Commit-Queue: Fabio Baltieri <fabiobaltieri@google.com>
1 file changed
tree: a940e71e507f908515b15ffdd9ed2f7b46ae8acf
  1. firmware/
  2. .clang-format
  3. .gitignore
  4. DIR_METADATA
  5. flash_npcx.py
  6. OWNERS
  7. PRESUBMIT.cfg
  8. README.md
README.md

EC AIC Tester

Firmware build, flash and debug

The firmware can be built and flashed both with or without the chroot, though it's recommended reusing the checkout that is part of a ChromiumOS SDK as that includes the necessary configuration to upload changes to Gerrit.

Chroot build

TODO

Out of chroot build

This setup reuses the repository that is part of the normal chroot setup, just adds a west workspace on top of it, which can coexist with the normal one managed with repo.

Venv setup (only needed once)

sudo apt install python3-venv
python3 -m venv ~/chromiumos/src/platform/ec-aic-tester/.venv

Enter the venv (once before either setting up or building):

source ~/chromiumos/src/platform/ec-aic-tester/.venv/bin/activate

Initialize the project modules and install dependencies (only needed once):

cd ~/chromiumos/src/platform/ec-aic-tester
pip install west
unset ZEPHYR_BASE # only needed if there's other Zephyr checkouts in the system
west init -l firmware
west update -o=--depth=1 -n
pip install -U -r zephyr/scripts/requirements.txt
west sdk install -t arm-zephyr-eabi
sudo apt install cmake ninja-build ccache dfu-util

Build and flash:

cd ~/chromiumos/src/platform/ec-aic-tester
west update # only needed if there was a breaking change in the modules
west build firmware
west flash

Build without a ChromiumOS SDK

It's possible to build, flash and debug the firmware without the whole chromiumos checkout, in that case just pick an arbitrary directory as a workspace instead of ~/chromiumos/src/platform/ec-aic-tester and initialize it with west init --mf firmware/west.yml -m https://chromium.googlesource.com/chromiumos/platform/ec-aic-tester, the rest of the process it the same.

This setup takes less disk space, but results in a checkout with no tools to upload changelists.

Using the usptream repositories instead of chromium mirrored ones

The project is setup to use the chromium mirror of Zephyr and modules, but can also be built against the upstream repositories directly. To do that use the west-upstream.yml manifest when initializing the west workspace, for example

west init -l firmware --mf west-upstream.yml

Build with a standalone full Zephyr checkout

The firmware can be built against an existing Zephyr project checkout, in that case follow the project Getting Started Guide, make sure that the ZEPHYR_BASE variable is set and run west build from the project firwmare directory.

Available runners

There‘s multiple options for flashing and debugging the board firmware, depending on what’s hardware is available.

USB-DFU

Just for flashing, uses the embedded USB DFU bootloader, requires no additional hardware. Put the board in DFU mode (press NRST while holding the BOOT0 button) and then run:

west flash -r dfu-util

NOTE: flashing with dfu-util normally fails in an error and requires a manual reset of the board

JLink

JLink can be used for both flahing and debugging, requires the J-Link Software installed.

Flash with:

west flash -r jlink

or start a debugging session with

west debug -r jlink

ST-LINK

ST-LINK requires the STM32CubeProgrammer host tools.

Flash with:

west flash -r stm32cubeprogrammer

or

west flash -r openocd

or start a debugging session with

west debug -r stm32cubeprogrammer

or

west debug -r openocd