Kookabus-02 code

The host sees one I²C device at 0x14 to 0x17: the STM32F103 on the board, which runs the servo bus for you. The same commands will work over the UART header.

Getting started

  1. Fit a 20 A ATO fuse in F1. It ships separately.
  2. Give every servo a unique ID first. Out of the box, ST3215 servos all use ID 1, so connect them one at a time for this step.
  3. Plug the servos into any ports. All eight ports are one bus, so any servo can go in any port.
  4. Connect the host's Qwiic or PiicoDev port to J12 or J13 with a 4-way JST SH cable, or jumper wires to the J2 header. Use the other connector to chain further I²C boards. The board ships with pull-ups on; cut JP3 if the host or another board already has them.
  5. Connect 12 V to the XT60. The POWER LED lights.

Firmware and host examples

Not yet written. The firmware, its register map and the host examples will be published here before the board ships. Until then, this page lists what the firmware is planned to do.

The I²C address is set by jumpers A0 and A1: 0x14 as supplied, up to 0x17. The full table and the microcontroller pin map are in the control interface section of the specifications.

Flashing the microcontroller

The board uses an STM32F103C8T6 and has no USB port, so firmware is loaded in one of two ways. Use method 1 for the first flash.

The board needs power while you flash it: 12 V on the XT60, or 3.3 V from the ST-Link or USB-serial adapter through the header's 3V3 pin. Use one or the other, never both.

Method 1: ST-Link on the SWD header (recommended)

This works every time, even on a blank chip. You need an ST-Link V2 USB dongle (about AUD $10; the official STLINK-V3MINIE also works), four female-to-female jumper wires, and STM32CubeProgrammer (free from st.com, for Windows, macOS and Linux).

J15 pinBoardST-Link pin
1GNDGND
2NRSTRST (optional)
3SWCLKSWCLK
4SWDIOSWDIO
53V33V3, to power the board from the ST-Link. Leave unconnected when 12 V is connected.
  1. Connect the dongle to J15 as in the table.
  2. Power the board: either connect pin 5 to the ST-Link's 3V3, or plug in 12 V and leave pin 5 unconnected.
  3. In STM32CubeProgrammer choose ST-LINK, click Connect, open the .hex or .bin file, and click Download.

Arduino IDE alternative: install the STM32duino core (Boards Manager: "STM32 MCU based boards"), pick "Generic STM32F1 series", board part "BluePill F103C8", and set Upload method to "STM32CubeProgrammer (SWD)". The Upload button then flashes through the ST-Link.

Method 2: USB-serial adapter on the UART header

The chip has a serial bootloader built in, so no ST-Link is needed. You need a 3.3 V USB-serial adapter (CP2102, CH340 or FTDI).

  1. Connect to J14 (UART): adapter GND to pin 1, adapter TX to pin 2 (RX), adapter RX to pin 3 (TX). Connect pin 4 to the adapter's 3V3 only if 12 V is not connected.
  2. Hold BOOT, tap RESET, release BOOT. The chip is now in its bootloader.
  3. In STM32CubeProgrammer choose UART, pick the adapter's port, click Connect, then Download.
  4. Tap RESET to run the new firmware.
Close-up of the I²C, UART and SWD pin headers with their silkscreen pin labels, and the BOOT and RESET buttons
I²C header J2, UART header J14 and SWD header J15, with BOOT and RESET beside them.