Jump to content

USB Host support for MBHP_CORE_STM32F4


TK.
 Share

Recommended Posts

Hi,

could be related to a power issue: how do you power the STM32F4DISCOVERY and your MIDI controller in host mode?

could also be related to an application issue: which application are you using, resp. if you wrote one by yourself: how is the MIDI data processed?

Best Regards, Thorsten.

Link to comment
Share on other sites

When using in host mode, board is powered through debug usb port connected to laptop usb3.0 ports. I don't have powered usb hub. I have a PSU which I could use here, that is first thing I'll try. If I could use debug usb port for only power, it would be great, but I tried connecting it to 2.1A phone charger, and it just kept blinking...

When in device mode, power is coming from two ports into debug usb port and usb-otg port (not supplying usb midi controller from mcu board also helps, I suppose).

As of my application, it is basically modified MIOS32 tutorial 24 I2S synth example, so midi data is processed exactly like in that example. Only change regarding midi from my side is me adding undef line for usb host mode.

I'll return as soon as I get to trying it out with more powerful supply.

Thanks,

Djordje

Link to comment
Share on other sites

Hi, I get similar behavior as described by Djordje using my STM32F4discovery as a USB-host Midi Bridge. Trying to play a Yamaha P-80 from a Oxygen61 controller a get plenty of hanging notes. I guess it could be a problem queuing the received midi messages from the USB-host, which are processed in real time and resend to the other MIDI-Ports.

How can this behavior be debugged? Which development environment is need for debugging. Can point someone to related documents, tutorials or application notes?

Best regards, Matthias

Link to comment
Share on other sites

25 minutes ago, aramz said:

Hi, I get similar behavior as described by Djordje using my STM32F4discovery as a USB-host Midi Bridge. Trying to play a Yamaha P-80 from a Oxygen61 controller a get plenty of hanging notes. I guess it could be a problem queuing the received midi messages from the USB-host, which are processed in real time and resend to the other MIDI-Ports.

How can this behavior be debugged? Which development environment is need for debugging. Can point someone to related documents, tutorials or application notes?

Best regards, Matthias

Hi Matthias,

What's the version number printed on the Discovery board? Did you try removing the solder bridges as detailed in the post above?

Best,
 

Link to comment
Share on other sites

  • 2 weeks later...

If i am using J2 to power my STM32F4 core with a 5v supply and i  want to try USB host mode.....i should put a jumper in at J17?

Then I will need to be careful not to use an external power source and plug the USB into my computer at the same time?

Is this correct? I'm afraid to fry stuff as i love my seq right now.

I'm trying to use an akai mpd18 as a USB input to the seq. the mpd18 has usb only.

otherwise i will have to buy a kenton USB host to use these devices?

 

 

Edited by k-rAd MB6401
Link to comment
Share on other sites

Ok. I'm pretty sure my problem is the cable.  

 

I installed a USB b jack on my seqv4 case that connects to the micro usb on the discovery board.

So now i need a way of converting an OTG cable to usb b on both ends. doh:

 

i made a usb b to usb b cable but that only worked for powering the device and the midibox wont go into host mode.

Is there any way that i can add a couple resistors to my diy cable to make it otg? 

 

edit: i think i screwed my self by putting a usb b jack on the midibox as i only have access to 4 pins of the micro usb on the discovery. I wanted a more robust connector. i think micro usb is too precarious. damn.

Edited by k-rAd MB6401
Link to comment
Share on other sites

To clarify the above post: if J2 is used for power, then J17 should be open.

For externally powered Cores, I recommend (and will likely consider) the following style of cable (YMMV, not tested yet):

http://www.ebay.com/itm/Right-angle-OTG-Micro-usb-B-5pin-male-to-A-female-panel-mount-Screw-Cable-25cm-/381713301841

Heh, just for fun, these are the shipping criteria:

Quote

Shipping and handling

 
Item location: Guangzhou, China
Shipping to: Worldwide
 
Excludes: APO/FPO, Africa, Central America and Caribbean, South America, American Samoa, Cook Islands, Fiji, French Polynesia, Guam, Kiribati, Marshall Islands, Micronesia, Nauru,
New Caledonia, Niue, Palau, Papua New Guinea, Solomon Islands, Tonga, Tuvalu, Vanuatu, Wallis and Futuna, Western Samoa, Albania, Andorra, Austria, Germany, Guernsey, Ireland,
taly, Jersey, Latvia, Liechtenstein, Luxembourg, Macedonia, Monaco, Montenegro, Svalbard and Jan Mayen, Switzerland, United Kingdom, Vatican City State, Brunei Darussalam, Cambodia,
Hong Kong, Laos, Macau, Bermuda, Greenland, Mexico, Saint Pierre and Miquelon, Iraq, Israel, Kuwait, Lebanon, Afghanistan, Armenia, Azerbaijan Republic, Bangladesh, Bhutan, China,
Georgia, India, Kazakhstan, Kyrgyzstan, Maldives, Mongolia, Nepal, Pakistan, Sri Lanka, Tajikistan, Turkmenistan, Uzbekistan

 

Edited by latigid on
Link to comment
Share on other sites

1 hour ago, latigid on said:

To clarify the above post: if J2 is used for power, then J17 should be open.

 

 

This is true. For safety reasons j17 should be open when powering the core externally to prevent frying your computer when you plug in the usb. However, when you need to power a midi controller through the usb and you are using external power for your core, j17 must be closed to give 5v to the midi controller. So now you have to be carefull and never plug the midibox into the computer with the external power supply connected.

I still need a solution for a usb otg cable with a usb b jack on the end. ;)

If i make this cable will it also work when the midibox is not a host? Or will i have to switch the cable for a normal usb when doing a sysex dump.

This would be not cool as i would have to open up my seq every time i wanted to switch from otg to normal usb

.

I hope this makes sense. Thanks for any insights.

 

Maybe all i need to do is short pins 4 and 5 on the micro end of the cable inside my box.????

 

 

IMG_0412.JPG

usb otg.jpg

Edited by k-rAd MB6401
Link to comment
Share on other sites

1 hour ago, k-rAd MB6401 said:

This is true. For safety reasons j17 should be open when powering the core externally to prevent frying your computer when you plug in the usb. However, when you need to power a midi controller through the usb and you are using external power for your core, j17 must be closed to give 5v to the midi controller. So now you have to be carefull and never plug the midibox into the computer with the external power supply connected.

I still need a solution for a usb otg cable with a usb b jack on the end. ;)

If i make this cable will it also work when the midibox is not a host? Or will i have to switch the cable for a normal usb when doing a sysex dump.

This would be not cool as i would have to open up my seq every time i wanted to switch from otg to normal usb

.

I hope this makes sense. Thanks for any insights.

 

Maybe all i need to do is short pins 4 and 5 on the micro end of the cable inside my box.????

 

 

IMG_0412.JPG

usb otg.jpg

Yea, there isn't really a switchable cable as far as I see. Problem is for an OTG cable you need a reg USB A socket on the other end, by spec, and for a reg microUSB B cable you have a USB A plug or mini A. About all you can do is like you say, mod the Disco board with a switch to GND pin 4 and use a USB B to xxUSB on your Akai. You could put a panel mount DPDT switch in to connect the GND to pin 4 and the other half to close J17. Wouldn't switch it with the power applied :(

Yogi

BTW nice case, like the sockets on the top :)

Edited by yogi
Link to comment
Share on other sites

Hey yogi. Thanks a lot. I pretty much came to the same conclusion. Add a switch to ground pin 4 of the micro usb on the disco board. 

I'll most likely leave a jumper in at j17 and just never use the Ac plug when connected to a computer for Sysex updates  

 

Thanks for the kind worlds. I need to post some pics of my box all finished. As soon as I had the thing working I sort of stopped documenting. It's just so fun to play with. 

Link to comment
Share on other sites

So I looked at a Disco board and it looks like CN5 pin 4 goes to R59 0 Onms, you should be able to solder to one end of it with some 30awg 'wire wrap' and test with it pulled to GND (any convenient board GND).

Your case looks really handy for accessing the IO. With sockets on the back it is a neater look if everything is static; but if you have to play with cables often, you end up having to pick it up and turn everything. Like it.

Good luck, Yogi

 

Link to comment
Share on other sites

Wow yogi. Thanks for looking into the disco board for me. I will try this and report back. 

 

Yeah i I wanted all the jacks to be accessible. I hate reaching behind stuff to find a jack. Also the seq was intended to sit in front of a modular setup. So it's not static at all. The cv/gate, clock, and triggers are used for different things in every patch. Bending the front panel was a little scary but fun. ;)

 

My my whole life is playing with cables. 

seqv4 progress.JPG

K-rAd_seqv4nmodular.JPG

K-rAd_MBseq_jacks.JPG

K-rAd_seqv4 usb b.JPG

Edited by k-rAd MB6401
Link to comment
Share on other sites

20 hours ago, yogi said:

So I looked at a Disco board and it looks like CN5 pin 4 goes to R59 0 Onms, you should be able to solder to one end of it with some 30awg 'wire wrap' and test with it pulled to GND (any convenient board GND).

Your case looks really handy for accessing the IO. With sockets on the back it is a neater look if everything is static; but if you have to play with cables often, you end up having to pick it up and turn everything. Like it.

Good luck, Yogi

 

Confirmed R59.

IMG_0415.JPG

Link to comment
Share on other sites

  • 4 weeks later...

Hi everyone,

I'm sorry I didn't respond earlier, I had was caught up in some boring stuff so I couldn't try any of this until now.

To answer little too late to latigid on, I'm using newer version of disco board: MB997D

I've updated the firmware to 2.27.15, and now I don't need to break links on board, it is working when powering it without debug usb host.

Now I've tried following:

- power through CN1 (2.1A USB charger), 5V connected to PA9 (J7 closed), usb midi keyboard connected through usb otg cable - board boots up, it works but I get hanging or missed notes.

- power through J2, J7 closed, usb midi kb through usb otg cable, same as above - missing and hanging notes

- J7 closed, no external supply (CN1 or J2), CN5 connected to pc in device mode, same usb midi keyboard connected to pc, mios32 midi device connected to midi keyboard on pc - everything working fine, no missing or hanging notes here.

Just a note: I am not using midibox motherboard (as it isn't shipped to my country, and I didn't get in touch with smashtv), I am just making needed connections with jumper wires directly on disco board.

Does anyone use midibox's usb midi host on regular basis, without having these hanging/missing notes? Perhaps my otg cable adapter doesn't transfer enough current to keyboard?

Thanks in advance,

Djordje

Link to comment
Share on other sites

  • 1 month later...
On 6.7.2014 at 11:32 AM, TK. said:

It was an interesting experiment anyhow.
 
Yes, of course it works :smile:
 
But if the STM32F4 Discovery board is powered by the Debug USB Socket, the Micro-USB will only output ca. 4.3V which is not enough for the GM5
 
Solution: plug a 5V PSU to J2 of the MBHP_CORE_STM32F4 module, and let the USB PWR jumper J17 stuffed:

mbhp_core_stm32f4_usb_host_4.jpg
 

All 5 MIDI IOs of the GM5 are recognized, and can be used for MIDI message processing.

 

Best Regards, Thorsten.

Hi, when I connect my GM5 I can only see and use 4 MIDI IO's

USB1-4

How can I find and use the 5th?

I run 0.88

Link to comment
Share on other sites

  • 2 weeks later...
On 8/13/2016 at 5:20 PM, k-rAd MB6401 said:

Confirmed R59.

IMG_0415.JPG

i have soldered a wire from ground to the side of R59 closest to the usb jack and it works. I finally got around to trying this. Now i can use my mpd18 with a homeade usb -b  to usb -b cable. Having 16 pads hooked up to the 16 trigger outs is going to be sweet!

Cheers

Edited by k-rAd MB6401
Link to comment
Share on other sites

  • 3 months later...

Thorsten, it would be great to connect computer (QWERTY) USB keyboard to MBHP_CORE_STM32F4 module.

1. It would give a quick (and dirty) start for beginners who are too lazy to solder a couple of DIN modules

2. There are a lot of keyboards for gamers with N-key rollover and latency up to 0.2ms (if polled more frequently then 1000 times per second :-) ). E.g. Bloody Lightstrike series from A4tech. So they can be used as kinda hex-keyboards, however without note velocity support. I used to play chromatic accordion and I find gaming keyboards pretty much applicable as a replacement.

Link to comment
Share on other sites

  • 1 year later...

I am interested in this subject too regarding connecting keyboads and game controllers to my gear. How far did this progress?

My main interest is of course to attach common controllers to my MIDI gear and I need an option to modifiy the midi data to met my systems' requirements.

Are there any performance tests, regarding a) latency and b) bandwidth?

I have a system with USB , but this is commercial and requires licensing and an FPGA core, so I am looking for a freely distributable solution.

The tasks are : Picking up the USB-MIDI Data from master keyboards and common USB-controllers, change resolution and mix it with high resolution data from my rotary encoders and add slow data from switches. AFAIR the system here is already capable to merge the DIN5 MIDI with USB-MIDI?  I need some high speed pins or a parallel out to drive my FPGA-system. A high speed SPI would be an idea.

 

Link to comment
Share on other sites

  • 2 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...