Electronic – How to disable USB mass-storage in STLink on Nucleo

microcontrolleropenocdstm32

Is it possible to disable the USB Mass Storage option on the STLink hardware of the Nucleo board? I want to prevent mounting the device when I plug it into computers (while keeping the virtual com port).

I am using nucleo-32 and nucleo-64 boards by programming them with OpenOCD and then using STLink's virtual com port to handle USB comms with my target device. In this setup, having the STLink part of my board auto-mount itself every time I plug it is is distracting. In particular, I don't want the user to see the mounted disk to get a warning if it is unplugged without being unmounted.

I am working mostly in linux and there I should be able to make a udev rule to block mounting the USB Mass Storage device, which is my backup plan. However, I would like to disable this on the hardware itself, so that on Windows and Mac no mounting occurs. I guess it might be possible to reverse engineer the STLink firmware and re-flash with the USB Mass Storage device disabled. But I wonder if there is an easier way.

(I am most interested in the Nucleo-64 NUCLEO-F303RE board, but I think the answer will likely be relevant for all Nucleo boards.)

Best Answer

In the recent STLinkUpgrade 3.3.0 I can see checkbox "Change Type" offering "Debug + Mass storage + VCP" or "Debug + VCP". Seems like the way to go.

To download the latest and greatest version: https://www.st.com/en/development-tools/stsw-link007.html

Just click on the "Get Software".