
ABOUT
The KS043 StanLink is a multi-purpose tool with the following features:
- USB-CAN adapter, supporting firmware based on the slcan normaldotcom/canable-fw: Firmware for the CANable USB to CAN adapter (github.com)
- STLink-V2 compatible programmer (SWCLK, SWDIO)
- USB-Serial adapter (CH340, TX/RX/RTS/CTS/DTR, RS485 or 5V TTL)
- Downstream USB-A port
- Upstream USB-C port
- 3.5VDC – 28VDC input, provided by either USB or external power input.
USB-CAN
USB-CAN is based on the STM32F070CB MCU and SN65HVD230 CAN transceiver.
USB-CAN source is available on GitHub: LekElectronics/SLCAN (github.com)
Firmware can be loaded in 2 ways – DFU bootloader, or using STLink SWCLK/SWDIO pins.
DFU-Bootloader
Press and hold button SW1 CAN BOOT0, while keeping this held momentarily press and release SW2 CAN RESET. The STM32F070CB MCU will enter USB DFU mode. Use a tool like STM32CubeProgrammer (Windows) or dfu-util (Linux) to download firmware into the MCU.
STLink-Programming
SWCLK and SWDIO pins for the STM32F070 are available on connector J7.
SWCLK – J1 pin 13
SWDIO – J7 pin 11
GND – J7 pin 14
ST-Link V2
ST-Link is comprised of a STM32F103C8T6.
Initial firmware STLinkV2.J16.S4.bin can be found on GitHub: OneKiwiTech/stlink-v2: stlink bootloader & resources (github.com)
Programming this STLinkV2.J16.S4 firmware into the STM32F103C8 using a genuine STLink programmer can be done by connecting SWCLK, SWDIO and GND pins to header J8.
GND – J8 pin 3 “G”
SWCLK – J8 pin 2 “CK”
SWDIO – J8 pin 1 “IO”

After firmware has been programmed, run ST-Link Utility or STM32CubeProgrammer to update the firmware to the latest version.
After the firmware has been upgraded to the latest version, programming ping are available on connector J4.
SWDIO – J4 pin 8
SWCLK – J4 pin 5
GND – J4 pin 4
UART
A CH340 USB-serial converter is available, with RS485 or TTL signals available:
TXD/RXD
CTS/RTS
DTR
RS485A/RS485B
The DTR pin can operate in different modes depending on the jumper on J10.
Jumper J10 in the 1-2 position will operate the DTR pin in push-pull mode. This is useful when you need to actively drive another circuit high or low.
Jumper J10 in the 2-3 position will operate the DTR pin in open-drain mode. This is useful when you want to simulate a button press (such as connecting in parallel with a BOOT0 pin on an external MCU.
Jumper J10 disconnected will operate the DTR pin in RS485 TXEN mode, it will automatically change to high level to drive the RS485 transmitter while sending data and change to low level after serial data is finished transmitting.
Jumper J9 is used to determine how received data should be applied to the CH340 RX pin.
Jumper J9 in the 1-2 position will connect the CH340 RX pin to the IO connector.
Jumper J9 in the 2-3 position will connect the CH340 RX pin to the RS485 transceiver.
USB Downstream
5V power for the USB downstream connector can be provided by the upstream port, or by an on-board 5V regulator.
For low power peripherals, the upstream port may be sufficient to provide the power to your downstream peripherals.
In cases where the upstream port can not provide enough power, connect external power to J5 (between 6.5VDC and 28VDC) and the on-board 5V regulator will provide power to the downstream USB port.