Hello.
I'm a newbie to all this so might be a silly question. My problem: With the trinket already connected to RPi USB then powering up the RPi the demo main.py doesn't run ( no changing LED colour). If I power on the RPi (Raspbian) then connect the trinket after it's booted, it runs. In both situations the CIRCUITPY mounted disk is available, it's just that the main.py doesn't seem to run if the trinket is already connected at power up (just a solid green light).
What am I doing wrong?
Cheers,
Andrew
Trinket M0 & Raspberry Pi 4 - Not loading py code when Pi is
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- LockNumber25
- Posts: 3
- Joined: Fri Mar 26, 2021 8:24 am
- adafruit_support_mike
- Posts: 67485
- Joined: Thu Feb 11, 2010 2:51 pm
Re: Trinket M0 & Raspberry Pi 4 - Not loading py code when P
[moved to the CircuitPython forum]
- LockNumber25
- Posts: 3
- Joined: Fri Mar 26, 2021 8:24 am
Re: Trinket M0 & Raspberry Pi 4 - Not loading py code when P
Hi.
I figured this out in the end. I needed to add a short delay before the usb_hid call. I guess to allow the Pi time prepare the usb for hid? This wasnt required when connecting the trinket to my Mac.
I figured this out in the end. I needed to add a short delay before the usb_hid call. I guess to allow the Pi time prepare the usb for hid? This wasnt required when connecting the trinket to my Mac.
- tannewt
- Posts: 3315
- Joined: Thu Oct 06, 2016 8:48 pm
Re: Trinket M0 & Raspberry Pi 4 - Not loading py code when P
Yup, sounds like the trinket starts up and crashes due to lack of USB before the pi starts up and enumerates USB. With latest builds you can wait for `supervisor.usb_connected`. Just added in the last few weeks: https://github.com/adafruit/circuitpython/pull/3513
- LockNumber25
- Posts: 3
- Joined: Fri Mar 26, 2021 8:24 am
Re: Trinket M0 & Raspberry Pi 4 - Not loading py code when P
Awesome, thank you. I'll make use of that.
Please be positive and constructive with your questions and comments.