Jump to content

forward Sysex and blocked to update code via MIOS Dev


morphe777
 Share

Recommended Posts

Hello,

 

I am building a MIOS8 board that works for 4-5 weeks. I updated code in order to code a the Midi Thru function, and I added the following code : 

 

 

/////////////////////////////////////////////////////////////////////////////
// This function is called by MIOS when a MIDI byte has been received
/////////////////////////////////////////////////////////////////////////////
void MPROC_NotifyReceivedByte(unsigned char byte) __wparam
{
  static char fx_status;

  // normal MIDI events are forwarded in MPROC_NotifyReceivedEvnt
  // this function handles sysex and realtime messages
  if( byte & 0x80 ) { // Status message
    if( byte >= 0xf0 )
      MIOS_MIDI_TxBufferPut(byte); // transfer byte

    // determine status
    if( byte == 0xf0 ) {
      fx_status = 0xff; // forward until 0xf7
    } else if( byte == 0xf7 ) {
      fx_status = 0;    // f7 reached, no forward
    } else if( byte == 0xf1 || byte == 0xf3 ) {
      fx_status = 1;    // expecting one additional byte
    } else if( byte == 0xf2 ) {
      fx_status = 2;    // expecting two additional bytes
    } else {
      fx_status = 0;    // expecting no additional byte
    }
  } else {
    // check if fx status active
    if( fx_status ) {
      // forward data byte
      MIOS_MIDI_TxBufferPut(byte);

      // decrement counter if required
      if( fx_status != 0xff )
        --fx_status;
    }
  }
}

 

Unfortunately, since I update this code, I can not contact my midibox thanks to MIOS studio. 

Here is the error message of the MIOS Studio:

Detected MIOS8 and MIOS32 response - selection not supported yet!
Check MIDI IN/OUT connections
and Device ID!
 
My MidiBox still works, and the MIOS Studio still receives the Debug-Message.
 
Is there a way to reset the chip or send a blank code? I do not have the burner.
 
Thank you for your help.
Link to comment
Share on other sites

I find the solution by myself.

 

I disconnect the MIDI OUT (of the midi Box) and re-upload the MIOS 1.09.

As it can not get response, it asks for a reboot. Just before rebooting the midibox, I reconnect the midi out, then I reboot it. 

The MIOS 1,09 is then uploaded, and my bad code is erased. 

 

I have just delete the wrong part of the code, and re-upload my app. and now it works like a charm.

 

In conclusion, do not use this code (get on ucapps.de) if you need to update your code later...

Edited by morphe777
Link to comment
Share on other sites

There is an alternative solution, and you partly already used it:

 

Turn of the core and push the start button in MIOS Studio.

Then turn on the core again (supply power), and the upload will start via 1st level bootloader, and not via the (faulty) application.

 

This allows you to update your application directly, since it won't be started before the upload begins (and has been finished)

 

Best Regards, Thorsten.

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...
 Share

×
×
  • Create New...