5

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.)

Andrew Straw
  • 163
  • 2
  • 6

2 Answers2

4

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".

2

It works only for boards with ST-Link V2. Boards with ST-Link V3 do not have this 'type' option, e.g. NUCLEO-H743ZI (V2) is fine, NUCLEO-H743ZI2 (V3) does not.

  • Hi, "*It works only for boards with ST-Link V2 [...]*" That doesn't seem to answer the question at the top of the page. Are you responding to the (currently only other) [answer](https://electronics.stackexchange.com/a/429632) by *Radek Šenfeld*? I see you are new here (welcome!) & it seems you are using the site like a forum, with just one type of "post". Things are different here; *answers* (where you posted) must answer the original question (top of the page). Although you can't write a comment, if you confirm you are replying to that answer, I'll *ask* for it to be converted to a comment. – SamGibson Oct 08 '20 at 20:02
  • You can (while this "answer" still exists) reply to me in a comment - please click the "add a comment" link below, to reply to my comment above. Thanks (Please *don't* write another "answer"!) – SamGibson Oct 08 '20 at 20:03