Black Lives Matter - Action and Equality. ... Adafruit joins the Stop Hate for Profit campaign.
0

Booting without opening disk station
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Booting without opening disk station

by Frank_Westerhof on Wed Mar 25, 2020 7:50 am

Hello,

I just recieved my first Adafruit Trinket M0 and modified a HID keyboard example, to just use it to control Powerpoints with 2 buttons.
I don't want users to have access to the contents, or have the folder opened, when connecting the unit.
Is it possible to connect the Adafruit Trinket M0 without opening the disk station?

Frank Westerhof

Frank_Westerhof
 
Posts: 4
Joined: Wed Mar 25, 2020 7:41 am

Re: Booting without opening disk station

by wildestpixel on Sun Mar 29, 2020 4:22 pm

I'll hazard a guess that you are looking to something like this to solve your issue :

https://www.windowscentral.com/how-configure-autoplay-windows-10

wildestpixel
 
Posts: 37
Joined: Wed Oct 23, 2019 1:14 am

Re: Booting without opening disk station

by Frank_Westerhof on Mon Mar 30, 2020 8:09 am

Hi wildestpixel, thanks for the response.

No, that won't do. The goal is to provide student PC's in a protected environment in a hospital each with 2 buttons, just to control a PowerPoint presentation. This works, but when connecting the unit, the WIndows PC will open the USB Storage device and when the PC is rebooted, the PC will try to boot from that device as well. I just want it to behave as an HID device.
The students must be able to connect any USB drive with their own work on it. They will expect an Explorer window to open when inserting their USB drives, so I cannot disable that. Neither am I in the position to make any changes to the Windows settings, since I'm from an external company. Of course I know how to change the BIOS settings, but that's not really an option as well.
The starting point is that I don't have any control over the PC that it is connected to, so I would like to be able to have the Trinket M0 run it's program without presenting it's USB Storage to Windows at all. I can hardly imagine that there isn't a mode like that, but I haven't found it yet...

Frank_Westerhof
 
Posts: 4
Joined: Wed Mar 25, 2020 7:41 am

Re: Booting without opening disk station

by tannewt on Tue Mar 31, 2020 4:37 pm

Hi Frank! We don't support not appearing as a disk drive because you would have no way to modify the code then.

If you want to try, you could disable the MSC interface in a custom build of CircuitPython. Instructions for building CircuitPython are here: https://learn.adafruit.com/building-circuitpython/

tannewt
 
Posts: 1669
Joined: Thu Oct 06, 2016 8:48 pm

Re: Booting without opening disk station

by Frank_Westerhof on Tue Mar 31, 2020 5:08 pm

Thanks tannewt, that’s clear.
I”ll figure something out and otherwise this great little thing will find some other use.
Cheers!

Frank_Westerhof
 
Posts: 4
Joined: Wed Mar 25, 2020 7:41 am

Re: Booting without opening disk station

by bludin on Thu Apr 16, 2020 11:38 am

@tannewt: couldn't we simply have an option to have the availability of the MSC interface depending on the state of a pin (at boot)? Or depending on the existence/content of a file (which could be changed through the REPL, for instance)? Or even just a ctrl-key in the REPL?

bludin
 
Posts: 15
Joined: Thu Apr 16, 2020 8:57 am

Re: Booting without opening disk station

by wildestpixel on Thu Apr 16, 2020 12:17 pm

bludin wrote:@tannewt: couldn't we simply have an option to have the availability of the MSC interface depending on the state of a pin (at boot)? Or depending on the existence/content of a file (which could be changed through the REPL, for instance)? Or even just a ctrl-key in the REPL?

I like the sound of this idea

wildestpixel
 
Posts: 37
Joined: Wed Oct 23, 2019 1:14 am

Re: Booting without opening disk station

by tannewt on Thu Apr 16, 2020 12:57 pm

bludin wrote:@tannewt: couldn't we simply have an option to have the availability of the MSC interface depending on the state of a pin (at boot)? Or depending on the existence/content of a file (which could be changed through the REPL, for instance)? Or even just a ctrl-key in the REPL?


We do already control the writability in boot.py.

One could add a state for not available at all but I'd rather spend that time on dynamic USB descriptors from boot.py. It'll solve more problems. Unfortunately, it's not a simple thing to add.

tannewt
 
Posts: 1669
Joined: Thu Oct 06, 2016 8:48 pm

Re: Booting without opening disk station

by danhalbert on Mon Apr 20, 2020 4:12 pm

Here's a Trinket M0 5.2.0 build that enables HID but nothing else. I use sopmething like this on a external volume control that runs CircuitPython. If I need to update it, I double-click to get TRINKETBOOT, and load a normal CircuitPython build, update the code, and then replace the uf2 with this.

Unzip before use.

trinket-5.2.0-hid-only.uf2.zip
(144.64 KiB) Downloaded 5 times

danhalbert
 
Posts: 2031
Joined: Tue Aug 08, 2017 12:37 pm

Re: Booting without opening disk station

by wildestpixel on Mon Apr 20, 2020 4:35 pm

Now that is a brilliant solution to this, but how much is needed to build this on an all device basis - would it be a pain?

I've a trinket M0 I will try with tomorrow (too much lockdown wine this evening)

wildestpixel
 
Posts: 37
Joined: Wed Oct 23, 2019 1:14 am

Re: Booting without opening disk station

by bludin on Mon Apr 20, 2020 5:01 pm

danhalbert wrote:Here's a Trinket M0 5.2.0 build that enables HID but nothing else. I use sopmething like this on a external volume control that runs CircuitPython. If I need to update it, I double-click to get TRINKETBOOT, and load a normal CircuitPython build, update the code, and then replace the uf2 with this....


Fantabulous :) That sound just like what I need ... except that I need it for the itsybitsy M4 express and with only the "REPL/stdin/stout over COM port" (CDC, I presume?) enabled. Is that easy to achieve even for a relative newb? I know there are detailed instructions for building CP. But as far as modifying the source goes, I would need some help to get started...

bludin
 
Posts: 15
Joined: Thu Apr 16, 2020 8:57 am

Re: Booting without opening disk station

by danhalbert on Mon Apr 20, 2020 7:24 pm

To narrow which USB devices are provided, in mpconfigboard.mk for your board, add the line:
Code: Select all | TOGGLE FULL SIZE
USB_DEVICES = "CDC,MSC,AUDIO,HID"
and delete the devices you don't want. For instance, for the UF2 I posted above, I set the line to:
Code: Select all | TOGGLE FULL SIZE
USB_DEVICES = "HID"

This Guide describes how to build CircuitPython: https://learn.adafruit.com/building-circuitpython

danhalbert
 
Posts: 2031
Joined: Tue Aug 08, 2017 12:37 pm

Re: Booting without opening disk station

by bludin on Wed Apr 22, 2020 9:35 am

Ah, that seems manageable :)
Thanks a lot!

bludin
 
Posts: 15
Joined: Thu Apr 16, 2020 8:57 am

Please be positive and constructive with your questions and comments.