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
962 stars 72 forks source link

Try USBGadgetPin #670

Closed probonopd closed 10 hours ago

probonopd commented 6 days ago

Allow for

USBGadget=0  ; Default to 0 (not in gadget mode)
USBGadgetPin=26  ; Default GPIO pin 26

as per https://github.com/probonopd/MiniDexed/discussions/669:

If either USBGadget is set to 1 or USBGadgetPin is pulled down, then we enable gadget mode.

github-actions[bot] commented 6 days ago

Download the artifacts for this pull request:

probonopd commented 5 days ago

@blixabloxa would appreciate if you could test to see whether it works for you. Thanks!

blixabloxa commented 3 days ago

Hi probonopd,

I have a testing update.

I have tried to get this to work but I am not having success.

I have a RPi 3 A+ and have loaded the test build above, also adding the USBGadget and the USBGadgetPIN lines to my minidexed.ini file (I left it at the default GPIO 26)

Connecting GPIO 26 (physical pin 37) to Ground (physical pin 30) makes no difference at all. Changing the USBGadget setting from 0 to 1 works as expected.

Any advice on how to proceed, or do you want me to try something else?

Thanks,

Enzo

blixabloxa commented 3 days ago

Just had a look at the code. Not sure if it is an error, but the line to set USB Gadget mode to "0" is duplicated at line 40 and 49 - see image attached. Is this correct, or should line 49 be removed? Screenshot from 2024-07-02 23-34-12

probonopd commented 3 days ago

Thanks for investigating and you are spot on @blixabloxa. New build for testing should be available soon.

probonopd commented 3 days ago

New build for testing: MiniDexed_2024-07-02-af6dd22

blixabloxa commented 1 day ago

Hi probonopd,

Just tested the new test build (MiniDexed_2024-07-02-af6dd22) and it works.

Test 1 - USBGadget=0 and USBGadgetPin not connected to GND - Pass : USB Gadget mode not enabled. Test 2 - USBGadget=0 and USBGadgetPin connected to GND - Pass: USB Gadget mode enabled. Test 3 - USBGadget=1 and USBGadgetPin not connected to GND - Pass : USB Gadget mode enabled. Test 4 - USBGadget=1 and USBGadgetPin connected to GND - Pass: USB Gadget mode enabled.

Thanks for this. I will find it useful for when I build the hardware to go with it.

Let me know if you want me to test more scenarios related to this.

Regards, Enzo

probonopd commented 11 hours ago

Thanks for testing and for confirming @blixabloxa.