cancel
Showing results for 
Search instead for 
Did you mean: 

STLink V3 host API

martonmiklos
Senior

In the UM2448 in the 11.5 section the following is present:

The STLINK-V3SET implements an USB interface dedicated to bridge functions from USB

to SPI/I2C/CAN/UART/GPIOs of ST microcontroller target. This interface is firstly used by

STM32CubeProgrammer in order to allow target programming through SPI/I2C/CAN

bootloader.

A host software API is provided in order to extend the use cases.

My questions would be:

  • What kind of host software API is going to be provided? (shared library+headers or something different)
  • What platforms are going to be supported?
5 REPLIES 5
wan512
Associate II

This API should be implemented in {STM32CubeProgrammer}/bin/CubeProgrammer_API.dll.

ConnectDfuBootloader
ConnectStLink
ConnectUsartBootloader
CubeProgrammerExit
CubeProgrammerInit
CubeProgrammerSetDebug
DeleteInterface
DeleteLoaders
DownloadFile
Execute
FileOpen
FreeFileData
GetDeviceGeneralInf
GetDfuDeviceList
GetStLinkList
GetStorageStructure
GetUsartList
InitOptionBytesInterface
MassErase
ReadMemory
ReadUnprotect
SectorErase
SetSkipErase
SwitchOptionBytesConfig
WriteMemory
WriteOptionBytes
checkDeviceConnection
getCancelPointer
getExternalLoaders
getTargetInterfaceType
removeExternalLoader
setDisplayCallbacks
setExternalLoaderPath
setLoadersPath

how about wrap them in python/js module officially?

martonmiklos
Senior

@wan512​ 

Well I am more curious about the I2C, SPI, CAN features.

They seems to be accessible from the same library at some level:

SPIInterface::isSecureBL()
SPIInterface::SendAddress(unsigned int)
SPIInterface::SPIInterface(int)
Brg::GetSPIbaudratePrescal(unsigned int, Brg_SpiBaudrateT*, unsigned int*)
SPIInterface::read32(unsigned int, char*, unsigned int)
SPIInterface::SPIInterface(int)
Brg::SetSPIpinCS(Brg_SpiNssLevelT)
SPIInterface::synchronize()
SPIInterface::isUBoot()
SPIInterface::displayConnectParam()
SPIInterface::ReadUnprotect()
SPIInterface::readData(unsigned int, unsigned char, int, FileData**, bool)
SPIInterface::GetCertificate(FileData**)
SPIInterface::getError(Brg_StatusT)
SPIInterface::receiveACK(int)
ConnectSPIBootloader
SPIInterface::sendByte(unsigned char)
SPIInterface::erase(unsigned short, unsigned short*)
SPIInterface::sendData(unsigned char*, unsigned short, unsigned short*)
SPIInterface::getRDPlevel()
SPIInterface::receiveAck(int)
SPIInterface::readBuffer(unsigned int, int, unsigned char*)
typeinfo for SPIInterface
SPIInterface::connect(QString)
SPIInterface::GetDeviceID()
SPIInterface::getAPnbr()
SPIInterface::readSspPartition(FileData**)
SPIInterface::sendBuffer(QByteArray)
SPIInterface::getPhase()
SPIInterface::reconnect()
Brg::WriteSPI(unsigned char*, unsigned short, unsigned short*)
SPIInterface::getDeviceID(unsigned short*)
vtable for SPIInterface
SPIInterface::displayDeviceInfo()
SPIInterface::programBuffer(unsigned int, char*, unsigned int, TargetMemory)
SPIInterface::sendSpecialCMD(unsigned char, unsigned short)
SPIInterface::read16(unsigned int, char*, unsigned int)
Brg::ReadSPI(unsigned char*, unsigned short, unsigned short*)
typeinfo name for SPIInterface
SPIInterface::receiveData(unsigned char*, unsigned int)
SPIInterface::ReconnectAfterReset(QString)
SPIInterface::~SPIInterface()
SPIInterface::start(unsigned int)
SPIInterface::read8(unsigned int, char*, unsigned int)
SPIInterface::checkRDPlevel()
SPIInterface::getDebugInterfaceInfo()
Brg::InitSPI(Brg_SpiInitT*)
SPIInterface::~SPIInterface()
SPIInterface::~SPIInterface()
SPIInterface::disconnect()
SPIInterface::getBLversion(unsigned char*)

The library itself seems to be written in C++ with Qt. Based on the available symbol names it might be possible to came up with an interface, but if it will be officially published that would be the best.

martonmiklos
Senior

FIY: ST mentioned December for the awaited libraries on their blog:

https://blog.st.com/stlink-v3set-in-circuit-debugger-programmer/

Similarly, the in-circuit debugger/programmer opens the door to an entirely new set of features as it allows PC developers to drive a couple of GPIOs from the new ST-LINK thanks to the DLLs that are planned for release in December. A

Unfortunately they didn't mention which year in December.... Any news on that one?

Nevermind, just saw the API folder in the new cube programmer. There is even example programs for visual studio.