PD Buddy Sink Firmware
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
Clara Hobbs b372835fc3 Wrote a real README il y a 7 ans
ChibiOS @ 7cac0e4b08 Added LICENSE (GPLv3) and ChibiOS submodule il y a 7 ans
boards/PD_BUDDY Added license headers il y a 7 ans
src Wrote a real README il y a 7 ans
.gitignore Added a simple LED blinking firmware il y a 7 ans
.gitmodules Added LICENSE (GPLv3) and ChibiOS submodule il y a 7 ans
LICENSE Added LICENSE (GPLv3) and ChibiOS submodule il y a 7 ans
Makefile Wrote a mostly-complete USB PD 2.0 implementation il y a 7 ans
README.md Wrote a real README il y a 7 ans
chconf.h Added license headers il y a 7 ans
halconf.h Added license headers il y a 7 ans
mcuconf.h Added license headers il y a 7 ans

README.md

PD Buddy firmware

This is the firmware for the PD Buddy project. Currently, this specifically means the PD Buddy Sink. The firmware is currently under heavy development, but is partially functional.

Prerequisites

To compile the firmware, you must first install the GNU ARM Embedded Toolchain. Details of its installation is beyond the scope of this README. Once the toolchain is installed, clone this repository with:

$ git clone --recursive http://git.clayhobbs.com/clay/pd-buddy-firmware.git

This will give you a complete copy of the repository, including the ChibiOS submodule.

You will also need to install some program to flash the firmware. The simplest option is dfu-util, as it requires no extra hardware. If you prefer to use SWD, you could also use stlink or OpenOCD.

Compiling

With all the dependencies installed, the firmware can be compiled as follows:

$ cd pd-buddy-firmware
$ make

This compiles the firmware to build/pd-buddy-firmware.{bin,elf}.

Flashing

The firmware can be flashed in any number of ways, including but not limited to the following:

dfu-util

Set the boot mode switch on the PD Buddy Sink to DFU mode and plug it into your computer. Flash the firmware with:

$ dfu-util -a 0 -s 0x08000000:leave -D build/pd-buddy-firmware.bin

Don’t forget to set the switch back to normal mode after unplugging the device.

stlink

If you have an ST-LINK/V2, you can use it to flash the firmware via SWD as follows:

$ st-flash write build/pd-buddy-firmware.bin 0x8000000

OpenOCD

OpenOCD can also be used to flash the firmware. For example:

$ openocd -f interface/stlink-v2.cfg -f target/stm32f0x.cfg -c "program build/pd-buddy-firmware.bin verify reset exit"

Usage

Currently, there isn’t much to say here. Plug it into your power supply, and the PD Buddy Sink will negotiate 2.25 A at 20 V. This can be configured by editing dpm_desired_v and dpm_desired_i in src/device_policy_manager.c, then recompiling and reflashing.