This repository contains the firmware source code, drivers, and a Python library for the following Pololu products:
The python directory of this repository contains a Python library
that implements the adapter's protocol, making it easy to control
the adapter from a Python program running on PC.
See python/README.md for more details.
After installing the arm-none-eabi-gcc toolchain, CMake, and Ninja,
navigate to the firmware directory in your shell and run these commands
to build the firmware:
cmake --preset release cd build_release cmake --build .
Alternatively, you can compile the firmware using the STM32 extension for VS Code.
To update the firmware on your board, you must first get it into bootloader mode, which means it is running the bootloader in the STM32's system memory.
The simplest way to start the bootloader is to open the adapter's virtual serial port with a serial terminal program, set the baud rate to 600, and then close it. Some general-purpose terminal programs that work for this are Google Chrome Labs serial terminal, Tera Term, and PuTTY.
If that method does not work, you can short together two exposed pads while powering up the board to force it into bootloader mode. Contact Pololu for more information.
After getting the board into bootloader mode, you can use the bootloader to
update the firmware. First install the [STM32CubeProgrammer software] from
ST. You can either load the firmware using the GUI provided by that software,
or the STM32_Programmer_CLI command-line interface. The firmware/program.sh
script in this repository shows an example of how to use the CLI.
Go to Window > Preferences > C/C++ > Code Style > Formatter. Select "BSD/Allman" and click Edit. Set the Tab Policy to "Spaces only" and set the indentation size to 2. Set the Profile name to "Pololu" and click OK. (This must be done once for each workspace.)
Now you can use the "Correct Indentation" or "Format" commands in the "Source" menu on your code.
This firmware includes code from the following third-party libraries:
The drivers directory of this repository contains a USB driver
for Windows enables it to recognize the adapter.
You can install the driver by right-clicking on pololu-usb-i2c-adapter.inf
and selecting "Install".
Driver installation is not required on Windows 10 and later, but installing the driver is recommended because it allows you to see the correct product name in the Device Manager instead of "USB Serial Device".