Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Files Are Only Loaded When Programming Switch Is Active. #18

Closed
GamehunterKaan opened this issue Sep 17, 2021 · 12 comments · Fixed by #25
Closed

Files Are Only Loaded When Programming Switch Is Active. #18

GamehunterKaan opened this issue Sep 17, 2021 · 12 comments · Fixed by #25

Comments

@GamehunterKaan
Copy link

When Pico Is Plugged It Automatically Launches File Explorer And Interrupts The Payload.To Prevent That Files Should Be Only Loaded When The Board Is In Programming Mode.

@GamehunterKaan GamehunterKaan changed the title Files Are Only Loaded When Programming Switch. Files Are Only Loaded When Programming Switch Is Active. Sep 17, 2021
@dbisu
Copy link
Owner

dbisu commented Sep 18, 2021

Potentially a call to storage.disable_usb_drive() could be added to boot.py. I might make that a second switch, in case someone wants to use the storage during a script for payload distribution or data dumping.

@dbisu
Copy link
Owner

dbisu commented Sep 18, 2021

Just realized that call is only available in the latest CircuitPython, not CircuitPython 6.3. I would need to test this project against CircuitPython 7.x before being able to turn off the host PC storage.

@GamehunterKaan
Copy link
Author

I tried running the code with CircuitPython 7.x but for some reason it goes into read only mode and doesn't work.

@GamehunterKaan
Copy link
Author

Ok I Nuked It And Installed Hid Libraries For CircuitPython 7.x.Seems To Be Working Fine For Now.

@dbisu
Copy link
Owner

dbisu commented Sep 19, 2021

OK. I'll look at updating the project once 7.x is officially released. In the meantime, if you want to try with a switch, you can create a boot.py like this.

from board import *
import digitalio
import storage

noStorageStatus = False
noStoragePin = digitalio.DigitalInOut(GP15)
noStoragePin.switch_to_input(pull=digitalio.Pull.UP)
noStorageStatus = not noStoragePin.value

if(noStorageStatus == True):
    # don't show USB drive to host PC
    storage.disable_usb_drive()
    print("Disabling USB drive")
else:
    # normal boot
    print("USB drive enabled")
```

@GamehunterKaan
Copy link
Author

I Dont Have Any Jumper Wires Right Now.I Will Give Feedback When They Arrive.(In 2-3 Days Hopefully)

@prajwal-bm
Copy link

this is not working for me can any one help, i fallowed all the steps but it is not working

@GamehunterKaan
Copy link
Author

GamehunterKaan commented Sep 21, 2021

It Just Tested It Works Perfectly Fine For Me.Nuke Your Pico First To Reset It,Download CircuitPhyton 7.x,Download Adafruit HID Libraries For 7.x And Then Make Sure You Connect The Correct Pins. https://i.imgur.com/f28d2u4.jpg

@GamehunterKaan
Copy link
Author

@dbisu CircuitPython 7.0.0 Is Officially Released.

@dbisu
Copy link
Owner

dbisu commented Sep 21, 2021

I'll get a card added to update the project to version to 7.0.0. Sounds like it will be mostly validation testing.

@Decapitater
Copy link

Any updates gentelmen ? The project seems to be updated

@dbisu
Copy link
Owner

dbisu commented Oct 1, 2021

I might have some time this weekend to look at this again.

@dbisu dbisu linked a pull request Oct 3, 2021 that will close this issue
@dbisu dbisu closed this as completed in #25 Oct 3, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants