/u2f-token

u2f token firmware for stm32f103 and efm32hg boards

Primary LanguageCGNU General Public License v3.0GPL-3.0

Turning cheap Chinese ST-Link clone into security key

This repository contains necessary changes to the original project to turn cheap Chinese ST-Link clone into security key that you can use for two-factor authentication. These changes will allow you to connect the user presence button to pin PB8 which may be better suited than the original pin PA5.

Original README file is located here.

Hardware modifications

Chinese ST-Link clone

ST-Link top view with button

Schematics of ST-Link hardware modifications

ST-Link botton view

Build

Use target ST_DONGLE_PUSH_PB8, e.g.

make TARGET=ST_DONGLE_PUSH_PB8

Flash STM32 clones with OpenOCD

Some Chinese ST-Links may contain clone of the original STM32F103 microcontroller, possibly CKS32F103C8T6. This manifests during flashing with the following errors:

Warn : UNEXPECTED idcode: 0x2ba01477
Error: expected 1 of 1: 0x1ba01477

This can be fixed by overriding CPU ID on OpenOCD command line:

openocd -f interface/stlink-v2.cfg -c 'set CPUTAPID 0x2ba01477' -f target/stm32f1x.cfg ...