I currently own 2 MIDI 4X4 from Miditech/Midiplus manufacturer. I thought it was possible to stack the 2 on the same PC to get 8x2 ports IN/OUT. But as theses devices have exactly the same product and vendor ID, and no serial, it is in fact impossible to do that without conflicts (it seems however some people installed 2 MIDI 4X4 successfully on the same computer...). So the only alternative was to buy a 8x8 interface from the same manufacturer, for three times the price of the MIDI 4x4.
More recently, one of my interfaces started to work incorrectly, indicating to me corrupted firmware.
I asked the Miditech and Midiplus support and they were kind enough to provide to me an updated firmware kit, but for the NEW version. Happy to learn that my interface was the "old" one, however still sold on many websites today. I tested that update package without any success. My version was not update-able at all they said.
I couldn't accept that a device (almost) still in order with USB, 8 ports 4 IN - 4 OUT goes directly in the trash bin. With nothing to lose, I opened the box, and inside I discovered that the microcontroller was a STMF103RC, a very common uC on musical gears (the Arturia Minilab and the Novation launchkey and launchpad are using it for example).
Here starts the idea of a possible hack: I have a board available with a programmable and powerful chip, native USB, plus all the circuitry for 4 MIDI IN / 4 OUT. Why not rewriting a new firmware from scratch as I did for other uC like of the AVR family? I could even extend that firmware to enable merge mode, thru mode, specific routing and filtering modes. So, building an ultimate USB MIDI interface better than the original...
First StepsThe STMF103 has an internal bootloader working with the UART Serial 1. The bootloader mode is activated by maintaining the Boot0 pin to HIGH and the Boot1 pin to LOW. So I desoldered 2 resistors on the board because they were disabling that mode, made a small reset button / "boot1 HIGH" circuit, and soldered the boot 0 to ground.
I also connected TX and RX of the serial 1 to a small plug. That was easy because some large labelled TXn / RXn pads exist on the MIDI 4x4 motherboard. I connected that plug to an USB Serial TTL, and 2 H later, I was able to upload a new firmware in the thing.
The original Miditech / Midiplus firmware is protected against being read. I had to accept the "The chip will be entirely erased if you continue.." warning. Not a problem as hacking the existing firmware was not my goal at all.
SMTDUINOTo preserve and reuse my existing software libraries, I choose to use STMDUINO.
It is a port of the Arduino platform to the ARM STM32 chip family from ST Micro. So you can develop "sketches" as usual, with the Arduino IDE, and reuse your existing "Arduino" code.
I flashed a modified STMDuino generic bootloader2.0 to the board with STMFLASH and tested the 4x4 board as a generic STMF103RC in the Arduino IDE. My MIDI demo sketch worked at the first compilation. And I could address the 4 serial ports connected to midi jacks.
I have rewritten entirely the firmware from a blank page, and I have extended its features to enable routing: "4 merge" mode, thru mode, split mode, etc. So I can say my modified USB interface 4X4 is now better than the original - very stable and most importantly stackable, as I changed the Product ID!
The STM32F103 is really, really fast - no lag at all, even at 300 BPM with 4 IN/OUT working. At this time, I use the box with the new firmware in my MIDI setup :-) !
The code is easily adaptable to any other multi-jack USB interface.
Comments
Please log in or sign up to comment.