Jump to content

bootloader and mios upload


Shum
 Share

Recommended Posts

Hi,

I have built the midibox64 core based on the new pic18f452 chip. To test if the core works, I pluged in my pic16f877 programmed with the old firmware, the LCD came to live and it works. This confirms the the core is ok. I burnt the bootloader_v1_2_pic18f452.hex into the pic18f452 using the MBHP burner without problem. The core sends out an upload request after power on. However when I upload the mios_v1_9_pic18f452.hex through the miosstudio, it somehow receives unexpected mios sysex message from the core and stops after awhile. I re-burnt the bootloader and uploaded the mios again, the problem ancountered. I am at a lost grateful someone can help, please

Shum

Link to comment
Share on other sites

Crikey if TK couldn't fix it I don't stand much chance but I'll try...

Do you have an example of the unexpected sysex sent by the core during upload? What does the LCD do during all this?

I'd be looking at the MIDI Interface and connections, or maybe power, just to hazard a guess....

Link to comment
Share on other sites

Crikey if TK couldn't fix it I don't stand much chance but I'll try...

yeah, agree :)

I would try these two most obvious steps first:

- uploading as .syx via another program

- another MIDI device and/or driver update? There are quite a number of MIDI devices having trouble transmitting sysEx properly (I tried a Hercules FW card last week and got a reproduceable kernel panic when transmitting a syx-file to my core  :o )

rgds, Michael

Link to comment
Share on other sites

yeah, agree :)

I would try these two most obvious steps first:

- uploading as .syx via another program

- another MIDI device and/or driver update? There are quite a number of MIDI devices having trouble transmitting sysEx properly

Oh yeh thanks very much for the vote of confidence, buddy ;D

Yeh I was thinking MIDI-OX etc...

And also wondering if it's another one of those evil USB interfaces... But I was trying not to make a speech about USB again ;) I thought that the incoming messages might hint at the location of the fault, either that the messages were normal, with some missing/corrupt bytes, like a bad solder joint on the midi connector on core; or random, like a cable/connector fault; or totally corrupt, like an interface/driver thing...

Something I should add:

I pluged in my pic16f877 programmed with the old firmware, the LCD came to live and it works. This confirms the the core is ok
Uhm, no it doesn't. It proves that the LCD works. You could have a bad solder joint on the midi interface and that wouldn't cause any problems there.

Hey, you did change the crystal over when you put in the PIC18 right?

Link to comment
Share on other sites

Hi Thersten,

Thanks a lot for your help through the email. I have taken too much of your time already so I come to the forum to seek assistance. The core I built is based on MBHP CORE V2b © T.Klose 2002-06-23. Initially I used the pic16f877-20 with the old midibox64 firmware to control the B4 synth. However, I am trying to migrate to the new pic with mios as it provides more memory and features. The problem that I am having is similar to the one posted by Digispunk. The core with the pic18f452 is with the bootloader burnt in and it sends out uploading request every 2 seconds. This seems that the core is functioning (LCD blank). However, I have problem uploading mios like what was mentioned by Digispunk. I do not know where I have gone wrong. The following was what I did;

1. Burnt bootloader V1_2 (new pic)

2. Plug pic in core and powed up - core sends out request message

3. Power off core. Open up Miso Studio and load mios v_1_9 hex file

4. Routed midi in/out accordingly

5. Checked the wait for uploading request box

6. Checked the with feedback from core

7. Click start on the Miso Studio

8. power up the core

The result - Mios Studio receives sysx date with check sum without error for few blocks. Thereafter Mios Studio receives enexpected mios sysex message as such - F0 F0 F0 F0 7E F0 00 01, expected is 00 00 7E 40 00. After 3 times the upload stops. Thanks

Shum

Link to comment
Share on other sites

Something that is new to me is, that some blocks can be uploaded correctly.

Does this happen randomly? Or are these always the same blocks?

Could it be a problem with the power supply? The PIC18F452 consumes (a little bit) more, since it runs at 40 MHz... especially during flash programming. Means: during code upload

In general multiple "F0 F0 F0 F0" indicate, that the core has been reset several times.

This can happen on:

  - no enough power

  - USART receive overrun error (unlikely so long the PC interface is working)

  - USART frame error on received bytes (can happen if the PC interface is running at a slightly incorrect baudrate)

The rest of the bytes behind F0 which don't match with a common upload request could be related to a driver quirk on the PC MIDI interface. But it can be ignored, because the previous bytes where already wrong

Best Regards, Thorsten.

Link to comment
Share on other sites

Hi Thorsten,

Thanks for the advice. Yes all the links of J3 are closed. How can I tell if the PC interface is running at incorrect baudrate. For information, I tried uploading the MIOS from different PC but also failed. Is it likely that the problem is in the conversion of the HEX to SYX file? Thorsten could you send me the MIOS syx file through email so that I can try it on the core again. Tell me, if it were the power supply (12v at 500 mA) or the USART problem, should I not have problem with the old pic16f877? Think I will leave this project aside to clear my mind. I will start afresh to check all the steps I had taken to troubleshoot. By the way Stryd_one, I miss typed the word MIOS as MISO. Perhaps I have had to much of Japanese food recently.

Thanks for the help everyone and with best regards.

Shum

Link to comment
Share on other sites

Hi Thorsten and Michael,

I started from scratch again and burnt the bootloder v1_2_pic18542 into the pic. Plug it into the core and power on and I got the  upload request.

I reconvert the MIOS hex to syx, at the end of the conversion there is an error message that says "you are trying to overwrite the Bootloader range! If you are using a 64k pic device add -mem_64k!" If I upload the MIOS it would overwrite the bootloader is'nt it.

Is there something I must do first before converting MIOS hex to syx?  ???

Ps I have the images but how I can attach them to this posting?

Hi Stry_one I take it that you are a Japanese food fan! ;)

Regards

Shum

Link to comment
Share on other sites

Yes. It's in the hex2syx.pl file:

# SYNTAX:
hex2syx.pl <hex-file>.hex [<-device_id 0x..>] [<-bankstick <0-7>] [-os_upload] [-force] [<-debug>]

In other words: you need to type [tt]hex2syx.pl myfile.hex -os_upload[/tt]

That's a precaution thing to prevent accidential overwriting of parts of the system!

Maybe we should think about mentioning this in the README.txt of mios_download.

I'd be very interested to hear the MIOSStudio-version you used for trying to upload the hex-file.

If you succeed now with sending the .syx-file (and I think chances are very high :)), it might be likely that there's an error in MIOSStudio (because this would be the second case with this specific upgrade error)...

please keep us up to date -

best regards,

Michael :)

Link to comment
Share on other sites

Hi Michael,

I have not uploaded the MIOS to the core yet. I want to be sure the MIOS.syx file is converted correctly first.  :) I typed in the following syntax "perl hex2syx.pl mios_v1_9_pic18f452.hex -os_upload" to start the conversion. As I mentioned before, at the end of the conversion, I got an error message warning me that I am trying to overwrite the Bootloader range! That means to say I cannot use the converted MIOS.syx file for the upload. If so how do I overcome this error?  ??? BTW how do I insert images on this posting/reply

Thanks

Regards

Shum

Link to comment
Share on other sites

perl hex2syx.pl mios_v1_9_pic18f452.hex -os_upload

I got an error message warning me that I am trying to overwrite the Bootloader range

just add "-force" to get a valid .syx-file:

[tt]./hex2syx.pl mios_v1_9_pic18f452.hex -os_upload -force[/tt]

[tt]Block 000400-0007FF allocated - Checksum: 4E

Block 000800-000BFF allocated - Checksum: 3A

Block 000C00-000FFF allocated - Checksum: 23

Block 001000-0013FF allocated - Checksum: 40

Block 001400-0017FF allocated - Checksum: 6A

Block 001800-001BFF allocated - Checksum: 5D

Block 001C00-001FFF allocated - Checksum: 35

Block 002000-0023FF allocated - Checksum: 51

Block 002400-0027FF allocated - Checksum: 11

Block 002800-002BFF allocated - Checksum: 7F

Block 002C00-002FFF allocated - Checksum: 42

Block 003000-0033FF allocated - Checksum: 2E

Block 007C00-007FFF allocated - Checksum: 51[/tt]

BTW how do I insert images on this posting/reply

If you reply, just open up "Additional Options" below the reply text field, there you can attach a pic.

Or upload your pic at imageshack or similar webservice and link it by 'img' and '/img' enclosed in brackets ;)

Link to comment
Share on other sites

Hi Shum,

I guess that you are still not using the most recent hex2syx.pl script, which is part of the mios_v1_9_src package, and located in the tools/ directory (I wrote you about this some days ago, but I never got an answer, if you really tried it).

The old script doesn't know about the changed memory ranges.

So, with the new script you will be able to convert the .hex when you add the "-os_upload"

AC: I don't want to make the usage of this script too much public, since it is too difficult to handle (as you can see...) and the unidirectional upload without checking the error codes is too dangerous. It's better to have a flawless working MIOS Studio. So, if this tool (or Java) is the reason why the code upload doesn't work at Shum's PC(s), then we should find out, why

But before making such hypotheses, it would be an important input from Shum's side, if the upload is working with MIDI-Ox

Shum: here a direct link to the source package:

http://www.ucapps.de/mios/mios_v1_9_src.zip

you can find hex2syx.pl in the tools/ directory

Best Regards, Thorsten.

Link to comment
Share on other sites

I don't want to make the usage of this script too much public, since it is too difficult to handle (as you can see...)

I see :)

I'm always uploading with SysEx-Librarian because it's so comfortable, but of course you're right about the POV of a Windows-Machine (I forget that sometimes :) )

I've sent shum the .syx-files I used for my Core(s).

I'm very interested to see if they will work being uploaded with MIDI-Ox...

Best Regards, Michael

Link to comment
Share on other sites

Hi Thorsten,

I am sorry that I did not reply to the email. I did use the script from the Mios V1-9_SCR. I use the main.asm file to generate the hex file using the MPLAB. The I uploaded it to the core, however it failed to work as well. Since I have tried all the tools to upload MIOS, including the one from the SCR package and fail, it was too embarrasing to mentioned it. I looked through troubshooting guide and those from the forum postings I got the feeling the my SB AWE64 sound card/driver may be the problem (though it work on the old pic16f877 - midibox64 and also on syx transfer of soundbanks on my WX5 and VL70M). I have the following snap shorts from midiox - the result of the MIOS upload. I may have to buy another sound card, do you have any suggestions what I should buy or should I build the USB-Midi module?

Thanks

Regards

Shum

Link to comment
Share on other sites

Hi Shum,

I'm not totally sure about, but maybe you want to follow this description:

http://www.ucapps.de/howto_tools_hex2syx.html

it shows how to upload with MIDI-OX, which is proven to work.

But before trying MIDI-OX, you also might try this:

- increase the delay to 750 ms or 800 ms

- Have you burnt another ID into your chip than '0'?

=> "If a different device ID than 0x00 is assigned to your core, the .syx file has to be generated again with the "-device_id" parameter."

- unfortunately I don't know sysexBox, but I think that "MIOS format" should say rather "MIOS Update" (or sth similar) than "MIOS Program Memory"? (Just a guess...)

EDIT: just saw here (http://www.ucapps.de/howto_tools_syxloader_18f.html), you have to set to MIOS EEPROM memory and the selected ID will overwrite the chip ID. nevertheless, the ID has to match!

If I understand the messages right, your PIC is being reset when sending the 12th block. This seems very suspicious to me.

If upload fails again after increasing the delay (and maybe trying with MIDI-OX), I'd recommend to look at the board again to make sure you really have soldered everything right! I had such an issue myself, where I searched two weeks for an error and missed to look at the core which I soldered some time ago and thought of it would be okay; but in fact a wire was totally wrong... but the nasty thing is, that you might not notice it, until you come to one special point...

(if all these points are verified, I'd think about another midi-interface... maybe there's something wrong with your joystick/midi adapter? You're using such an adapter for AWE64, right?)

Kind regards,

Michael

Link to comment
Share on other sites

Hi Thorsten, Michael and Stryd_one,

Something simple and overlook!. It was the power supply unit. I measured the output voltage it registered 12V DC. It was because the same psu was used on the old pic16f877, it led me to believe that it was fine. Having read all the suggestions that were given, I finally measured the output with a scope. To my horrior, the ripple on the DC output was very high. I later found that the smoothing cap. was OC. I replaced it with a new 1000uf 25V and ripple was gone. Powered up the core and uploaded the MIOS. This time around it was easy and there was no error and the LCD showed "ready". I uploaded the main.syx for midibox64 and T.Thorsten came on the LCD. I appreciate all the help given to me and thanks guys!  :)

Best Regards

Shum

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