probonopd / MiniDexed

Dexed FM synthesizer similar to 8x DX7 (TX816/TX802) running on a bare metal Raspberry Pi (without a Linux kernel or operating system)
https://github.com/probonopd/MiniDexed/wiki
1.13k stars 81 forks source link

Update USBGadgetPin and add appropriate boot messages. #674

Closed diyelectromusic closed 4 months ago

diyelectromusic commented 4 months ago

As discussed here: https://github.com/probonopd/MiniDexed/discussions/669

Kevin

probonopd commented 4 months ago

Thanks @diyelectromusic. Build for testing: MiniDexed_2024-07-10-acc9e26

@blixabloxa could you please test this as well?

Let me know when you think it's ready to merge. Thanks!

github-actions[bot] commented 4 months ago

Build for testing: MiniDexed_2024-07-11-1d37225 Use at your own risk.

blixabloxa commented 4 months ago

Hi All,

I've performed some tests on the test build (MiniDexed_2024-07-10-acc9e26), and the TL;DR is PASS. Not my decision, but I am OK with this being merged.

The general operation of these options as I understand it -

  1. If USBGadget=0 (default), then USB Host Mode is enabled no matter what you have set for USBGadgetPin, or whether the GPIO pin you have configured for USBGadgetPin is grounded or not (set LOW or HIGH).
  2. If USBGadget=1 and USBGadgetPin=0, then USB Gadget Mode is enabled. USB Gadget pin operation is not enabled, no GPIO pins are configured for USB Gadget Mode.
  3. If USBGadget=1 and USBGadgetPin=x, then USB gadget Mode is enabled with USB Gadget pin operation enabled on GPIOx. Pulling GPIOx to GND will enable USB Gadget Mode. Leaving GPIOx HIGH will enable USB Host Mode.

I think that's the way it has been designed to work by Kevin - let me know if I am mistaken.

My test set-up is a RPi 3A+, with a jumper between GPIO 26 and GND (physical pin 37 and pin 30). I used a laptop with Waveform and Abelton Lite DAWs to confirm USB Gadget Mode successful operation. Disconnecting or connecting the jumper between GPIO26 and GND after initial boot-up didn't change the USB Gadget Mode state of the Minidexed, i.e. it continued to operate as it was configured at boot time.

Test 1 -

 USBGadget = 0
 USBGadgetPin = 0 or 26

Test 2 -

USBGadget = 1
USBGadgetPin = 0

Test 3 -

USBGadget = 1
USBGadgetPin = 26

Test 4 -

USBGadget = 1
USBGadgetPin = 26

Thanks again for creating this fantastic project, and for applying this useful user enhancement.

Let me know if you want me to test some other scenarios.

Enzo

probonopd commented 4 months ago

Thanks Enzo for your systematic tests. Will merge as soon as Kevin confirms it is ready to merge.

diyelectromusic commented 4 months ago

That pretty much describe how I was hoping it would work - many thanks for taking the time to verify it for us.

So yes, if people are happy with that behaviour, I'm good to go :)

I'll get on an update the wiki to try to capture the above!

Kevin

probonopd commented 4 months ago

Thank you very much @diyelectromusic. If I remember correctly, I had edited 2 pages in the wiki regarding USB Gadget mode, so be sure to catch it in both places.

diyelectromusic commented 4 months ago

Wiki now updated. Have a read and see if that makes sense!

Kevin