ST Link v2 clone as a dev board

Notes on using an Aluminium case ST Link v2 clone as a development board. In summary, it can:

  • Talk to the host over USB
  • Blink the built-in LED (!)
  • Drive a RGB LED via PWM
  • Drive a 40 RGB LED pHAT over SPI
  • Drive a 320x240 LCD over fast bitbanged SPI

Docs

Programming

I used a Segger J-Link to load the pre-built STM32duino bootloader. As the LED is on PA9, use the generic_boot20_pa9.bin version.

Pins

FunctionPinFeedback pin
RSTPB6PB5
SWDIOPB14PB12
SWCLKPA5 + PB13None
SWIMPB8 + PB11PB7 + PB9 + PB10
LEDPA9N/A

The ‘feedback’ pins have an extra 100 R to 680 R resistor between the main pin and the feedback pin. I assume this is used to detect if the DUT is driving the pin at the same time as the debugger.

Functions

PortDefault alternateRemap alternate
PA5SPI1_SCK, ADC12_IN5None
PA9 (LED)USART1_TX, TIM1_CH2None
PB5I2C1_SMBAITIM3_CH2, SPI1_MOSI
PB6I2C1_SCL, TIM4_CH1USART1_TX
PB8TIM4_CH3I2C1_SCL, CANRX
PB7I2C1_SDA, TIM4_CH2USART1_RX
PB9TIM4_CH4I2C1_SDA, CANTX
PB10I2C2_SCL, USART3_TXTIM2_CH3
PB11I2C2_SDA, USART3_RXTIM2_CH4
PB12SPI2_NSS, I2C2_SMBAI, USART3_CK, TIM1_BKINNone
PB13SPI2_SCK, USART3_CTS, TIM1_CH1NNone
PB14SPI2_MISO, USART3_RTS, TIM1_CH2NNone

Or, transposed:

FunctionAvailable featuresBut…
I2C1SCL, SCL, SDASDA is behind a 680R (might be OK)
I2C2SDA, SMBAI, SDANo SCK
SPI1SCK, MOSIMOSI is on a remap, and remap is all or nothing
SPI2SCK, MISO, NSS
USART1TX, RXUsable
USART3RX, CTS, RTS, CK, TXTX and RX are on the same pin
Avatar
Michael Hope
Software Engineer