AnsweredAssumed Answered

direct USB comms to ST-Link

Question asked by Lynn Linse on Jul 31, 2017

Has anyone seen, or tried to use, a direct USB API to STM32 ST-LINK CLI v3.0.0.0 (the STLink on a STM32-NUCLEO board)? Ideally, for Windows 7 or newer?

I have some manufacturing tests, which validate HW on an STM32L152-based device. So far I've been using Python 3.6 subprocess.check_output(...) to run ST-LINK_CLI.exe. Works beautifully on my own 'engineering' computer, because IT trusts me to use USB flash and so on.

 

Unfortunately, our factory-floor computers are more paranoidly locked down, including security alerts when any USB flash is inserted (aka: when the ST-Link init's itself), plus it also seems the security locks do real-time checks when any program launches a sub-process. So use of ST-Link by sub-process takes seconds on my workstation, but takes over 60 seconds per command on the manufacturing PC - this really adds up after a dozen steps to clearing the STM32, set options bytes, reflashing & validating 3 flash blocks. While I could ask IT to make non-standard tweaks on the manufacturing PC, I am experienced enough to know that will be a recurring headache, as future PC "updates" will keep breaking any such non-standard tweaks. IT says direct USB access will be less affected than USB FLASH drives or spawning sub-shells.

 

(My plan B is to move my tests to Python under Linux on a Raspberry PI, which would bypass stock IT security rules. But that will be a lot of change.)

Outcomes