Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Support mbed/stm32 devices like Arduino GIGA #98

Open
Haschtl opened this issue Jul 17, 2023 · 4 comments
Open

Support mbed/stm32 devices like Arduino GIGA #98

Haschtl opened this issue Jul 17, 2023 · 4 comments
Labels
topic: code Related to content of the project itself type: enhancement Proposed improvement

Comments

@Haschtl
Copy link

Haschtl commented Jul 17, 2023

This library currently only supports these architectures: avr, sam, samd
Is there any plan to support the newer STM32 boards like the Portenta boards or Arduino GIGA?

I recently bought the Arduino GIGA and justs expected this library to be supported.

@per1234 per1234 added type: enhancement Proposed improvement topic: code Related to content of the project itself labels Jul 17, 2023
@per1234
Copy link
Contributor

per1234 commented Jul 17, 2023

Hi @Haschtl. Thanks for your suggestion.

I see a "USBMIDI" library has been added to the arduino/ArduinoCore-mbed repository that contains the codebase of the Giga's "Arduino Mbed OS Giga Boards" platform:

arduino/ArduinoCore-mbed@35a9e18

Unfortunately even though the library was added to the repository, the platform packaging system has not been configured to include that library in the distributed "Arduino Mbed OS Giga Boards" platform. I'm not sure if that was an oversight, or done intentionally because the library is not yet ready for distribution. You could download the library files from GitHub and install them manually if you want to give it a try. They are here:

https://github.com/arduino/ArduinoCore-mbed/tree/main/libraries/USBMIDI


Related:

@Haschtl
Copy link
Author

Haschtl commented Jul 18, 2023

Thanks for the clarification!

I copied the USBMIDI-folder from the ArduinoCore-mbed repo to my arduino library (~/.arduino15/packages/arduino/hardware/mbed_giga/4.0.2/libraries) and compiled+uploaded the included example Basic.ino without problems. The device is detected as a MIDI-Device now!

@Haschtl
Copy link
Author

Haschtl commented Jul 18, 2023

The underlying USBMIDI library for GIGA is working, but MIDIUSB does not use it yet.
I had a look at the source code and tried to include the USBMIDI library from the mbed_giga package without success.
I thought adding something like this to MIDIUSB.h would be enough:

#elif defined(__MBED__)

#include "PluggableUSBMIDI.h"

#define EPTYPE_DESCRIPTOR_SIZE uint8_t
#define EP_TYPE_BULK_IN_MIDI EP_TYPE_BULK_IN
#define EP_TYPE_BULK_OUT_MIDI EP_TYPE_BULK_OUT
#define MIDI_BUFFER_SIZE USB_EP_SIZE
#define is_write_enabled(x) (1)

But there are still some undefined references (USBCON, EndpointDescriptor, IADDescriptor, InterfaceDescriptor, USB_EP_SIZE, D_IAD, D_INTERFACE, USB_ENDPOINT_OUT, USB_ENDPOINT_IN, EP_TYPE_BULK_OUT, EP_TYPE_BULK_IN)

I don't know if this approach is in any case correct...

My goal is to get lathoub's USBMIDI running. If MIDIUSB works with the GIGA, can I expect that lathoub's library will work, too?

@ik2wxx
Copy link

ik2wxx commented Oct 24, 2023

Thanks for the clarification!

I copied the USBMIDI-folder from the ArduinoCore-mbed repo to my arduino library (~/.arduino15/packages/arduino/hardware/mbed_giga/4.0.2/libraries) and compiled+uploaded the included example Basic.ino without problems. The device is detected as a MIDI-Device now!

BTW it works for writing messages, not for reading.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: enhancement Proposed improvement
Projects
None yet
Development

No branches or pull requests

3 participants