Jump to content

update via UART midi


Zam

Recommended Posts

Hi all

I'll like to update NG app and config via UART but I can't reach the core with MIOS studio

I have a multicore setup, one "master" USB (4 port) to computer and 2 stave (soon 4) with direct UART midi interconnection to master core.

Midi data between cores is fine (at 10x speed, no optocoupler) as slave to computer via master.

At master I have router active, USB2->IN1 and OUT1->USB2 (for first slave)

BUT I can't connect  the slave core via master and USB2 port at MIOS studio, do I overlook something ?

I have a vaguely memory that connection is constrained to USB1 port, but can't find back where I've seen this in the past...nor forum or wiki.

The idea is to not have to connect each core directly to computer to update config... but everything working from a single USB cable (which is already the case except for the config update via MIOS studio...)

Best

Zam

Link to comment
Share on other sites

I can't help out too much, but maybe the way Wilba's Main Board for the SID is built would work here? Add a 2x4 pin header and wire the midi in from each core to one side and the other side to the midi in socket. Normally the jumper is on the first pins to communicate with core #1.  Then move the jumper to switch which core you are "talking" to?

Just an idea.

Link to comment
Share on other sites

Hello Goyou

Not sure to get what you say, if it's a kind of UART line selector between core, this won't work for me, I need all Slaves connected to Master all the time, each slaves show up (for DAW) as different midi device with 4 USB enabled at master (and router config)

But I think I find something at mios32_midi.c which seem to lock mios sysex command to USB0 (USB1 port)

/////////////////////////////////////////////////////////////////////////////
// This function parses an incoming sysex stream for MIOS32 commands
/////////////////////////////////////////////////////////////////////////////
static s32 MIOS32_MIDI_SYSEX_Parser(mios32_midi_port_t port, u8 midi_in)
{
  // ignore realtime messages (see MIDI spec - realtime messages can
  // always be injected into events/streams, and don't change the running status)
  if( midi_in >= 0xf8 )
    return 0;

  // TODO: here we could send an error notification, that multiple devices are trying to access the device
  if( sysex_state.general.MY_SYSEX && port != last_sysex_port )
    return -1;

  // USB upload is only allowed via USB0
  // this covers the scenario where other USB1..7 ports are used for MIDI Port forwarding, and a MIOS8 core
  // is connected to one of these ports
  // MIOS Studio reports "Detected MIOS8 and MIOS32 response - selection not supported yet!" in this case
  // By ignoring >= USB1 <= USB7 we have at least a workaround which works (for example) for MIDIbox LC
  if( port >= USB1 && port <= USB7 )
    return -1;

  last_sysex_port = port;

Best

Zam

Link to comment
Share on other sites

UPDATE !

Seem I find out :rolleyes:

so I change

if( port >= USB1 && port <= USB7 )

to

if( port >= USB5 && port <= USB7 )

(to have access to 4 slaves at 4 usb 0 to 3)

And in the mean time I set different ID to each cores in the bootloader.

So far I'm able to access first Slave core at UART1 from Master core via USB2 port in MIOS studio !

 

Best

Zam

Link to comment
Share on other sites

Hello Fantom

No I don't try with optocoupler, but I try at 31.25kb standard speed, I'm able to reach the slave core as loading .NGC in the file browser (very slowwwwwwww) but unable to update without trouble.

I don't think it's the issue, as my cores share same PSU and stand side by side so UART direct interconnection is less than 10 cm

Also if I have to choose I prefer to have the actual 10x speed 312.5kb than abilities to reach the core...

I have no pull up resistor neither current limiting, maybe I can try that.

But as usual midi data is fine, maybe it's something with the long sysex for MIOS command, I'll will investigate more around buffer or if there is a special handler for those sysex when using UART in/out ...

Anyway thanks for your idea

Best

Zam

Edited by Zam
Link to comment
Share on other sites

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...
×
×
  • Create New...