Skip to main content
Associate
September 18, 2024
Question

Best/fastest API for C# desktop app read/write memory of several STM32 mcu's via StLinks, V2.1 and V3.

  • September 18, 2024
  • 3 replies
  • 2531 views

Currently I tried STM32Programmer_CLI and ST-LINK_CLI, both more than 100 times slower than StmStudio - StLink - SWD - MCU. The solution can only work up to 4Hz with 1 mcu and less with >1 mcu. StmStudio can run at least 250Hz with more exchanged data.

I tried this: "C:\Program Files (x86)\STMicroelectronics\STM32Cube\STM32CubeProgrammer\bin\STM32_Programmer_CLI.exe" -c port=SWD sn={serialNumber} mode=HOTPLUG speed=Fast -r8 0x20000000 0x8"

I need to run up to 20 mcu's simultaneously (6 is minimum), at least one must exchange data faster than 10Hz, prefer >50Hz, the rest can run 1Hz or sub 1Hz. Must be able to be addressed by StLink serialnumber.

Mcu firmware is locked so far. Mcu Hardware (circuit/PCB) is locked, so stuck with SWD, no USB/serialport.

Would another interface improve interface speed, e.g. Segger J-Link?

I am currently trying to get StLink-lib.dll working, will it be faster?

 

Please note, I am a hardware designer so software is not my primary job.

ANY advice is appreciated, especially if it is detailed and easy to understand, assume I am new to this.

Any guides/videos on this topic would be great, but any help/insight really.

 

3 replies

1234PJAuthor
Associate
September 18, 2024

This will be used for production tuning/testing of boards, minimum 6pcs and maximum 20pcs.

The solution I have tried so far has a high overhead, meaning it will open/close for each command/request and it contains much more data than what is relevant.

Best case, I can open "a channel" to a mcu, at this time all the "overhead" data is relevant, after that it would be beneficial if only SN of the stlink + the data was exchanged, I assume this is what stmstudio does?

Currently we are running a testsoftware in NodeRed/CobeMON, but it is very difficult to change from one testsoftware to another and it is not very stable.

I am not fixed on using C#.

Visitor II
September 18, 2024

Segger J-Link can provide a better speed. 

1234PJAuthor
Associate
September 18, 2024

Do you know how mush faster it is?

What would my approach be, I assume there might be more than one API available?

 

Andrew Neil
Super User
September 18, 2024

That would be specific to Segger - nothing to  do with ST.

Probably better to ask Segger: https://forum.segger.com/index.php/Board/3-J-Link-Flasher-related/

 

 

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
Wasilewski.Piotr
Associate III
December 9, 2024

I'm using some high speed readout of ST-Link data in my MCUViewer software (It's like STMStudio, but actively maintained) - it's open source so maybe you can see how I've done it to get some inspiration :) JLink HSS mode is the fastest though (can reach tens of kHz with a few variables on JLink Ultra+).