# UTAT Firmware Development Environment

My firmware development environment for the University of Toronto Aerospace Team 

https://docs.zephyrproject.org/latest/develop/getting_started/index.html

```sh
west init zephyrproject
cd zepyhrproject
west update

west zephyr-export

cd zepyhr
west sdk install

west build -p always -b nucleo_g431rb samples/basic/blinky
west flash --runner pyocd # had to su root first to run this (after running nix develop)

# MCUBoot
cd ~/utat-dev/zephyrproject
west build -p always -b nucleo_g431rb bootloader/mcuboot/boot/zephyr -d build/mcuboot   -- -DEXTRA_CONF_FILE=mcuboot-nucleo-g431rb.conf
west flash -d build/mcuboot --runner pyocd # (as root, with nix develop)

cd zephyr
# Package 1
west build -p always -b nucleo_g431rb samples/basic/blinky -d build/app  -- -DCONFIG_BOOTLOADER_MCUBOOT=y -DCONFIG_MCUBOOT_GENERATE_UNSIGNED_IMAGE=y
west flash -d build/app --runner pyocd  # (as root, with nix develop)

# Package 2
west build -p always -b nucleo_g431rb samples/basic/blinkyslow -d build/blinkyslow -- -DCONFIG_BOOTLOADER_MCUBOOT=y -DCONFIG_MCUBOOT_GENERATE_UNSIGNED_IMAGE=y
pyocd flash --target stm32g431rbtx --base-address 0x08014800  build/blinkyslow/zephyr/zephyr.signed.hex
```