hithere Posted April 17, 2006 Report Share Posted April 17, 2006 Hi. I have a core R3 board from smashtv and a PIC from him wich was programmed with bootloader V1_1a (if I read it correctly)Yesterday I got mios studio running and tried to upload the mios from mios_update_v1_9.zip/pic18f452/mios_v1_9_pic18f452.hexIt started to upload all checksums where ok untill suddenly there was some address range error no. 5.After that the chip sent out 2 upload requests on every startup instead of just one.I then uploaded the new version of the bootstrapper the same way through mios studio and that upload worked fine without any errors, and after that the pic sent out an upload request every second, just like it did before.Then I uploaded "update_without_installed_mios.hex" or "update_with_old_mios.hex", I can't remember which one, but only one of them worked, and after that it still sent update requests every second.Then I again uploaded mios_v1_9_pic18f452.hex and everything went fine, all checksums where ok, and it uploaded successfully.But now there are no upload requests coming from the pic, and in fact no communication from it whatsoever. Not on startup, and not when I turn some pots that I connected to the analog inputs (afterwards, so they are not what caused this)Have I somehow ruined the bootstrap loader, or the flash? can I reset the chip and do it from scratch somehow, without a burner?Thanks for reading this long post!hithere Quote Link to comment Share on other sites More sharing options...
TK. Posted April 17, 2006 Report Share Posted April 17, 2006 Hi,The big problem is, that you haven't read the README.txt file, at the first lines it's clearly stated:Note that in most situations, only **one** .hex file needs to be uploaded via MIDI. Please read this README carefully in order to select the right binary.Oversight: A) fresh new PIC18F452 with old Bootloader V1.1b B) old MIOS installation C) virgin PIC18F452, own PIC programmer available D) checking if Bootloader V1.1b or V1.2 is installed E) installing Bootloader V1.2 and MIOS V1.9 on a PIC18F4620A) you got a preburned PIC18F452 from SmashTV or Mike with the old Bootloader v1.1b, and haven't installed MIOS yet. In this case, upload -> pic18f452\midi\update_without_installed_mios.hexvia MIDI like described at the http://www.ucapps.de/mios_bootstrap.html page.This .hex file contains MIOS V1.9 and the update program. The updater will: - do a CRC check in order to ensure that the whole binary has been uploaded - replace Bootloader V1.1b by Bootloader V1.2 Some debug messages will be print on screen and sent via MIDI:The LCD will show (if connected): CRC: CBCF ok Countdown: 10The MIDI IN monitor of MIOS Studio will show: Sysex message: F0 0C 0B 0C 0F F7 CRC Checksum [D0 0A] channel 1: key pressure A#-1 pressure: 0 Countdown 10 [D0 09] channel 1: key pressure A-1 pressure: 0 Countdown 9 [D0 08] channel 1: key pressure G#-1 pressure: 0 Countdown 8 [D0 07] channel 1: key pressure G-1 pressure: 0 Countdown 7 [D0 06] channel 1: key pressure F#-1 pressure: 0 Countdown 6 [D0 05] channel 1: key pressure F-1 pressure: 0 Countdown 5 [D0 04] channel 1: key pressure E-1 pressure: 0 Countdown 4 [D0 03] channel 1: key pressure D#-1 pressure: 0 Countdown 3 [D0 02] channel 1: key pressure D-1 pressure: 0 Countdown 2 [D0 01] channel 1: key pressure C#-1 pressure: 0 Countdown 1 [D0 00] channel 1: key pressure C-1 pressure: 0 Countdown 0 [D0 1A] channel 1: key pressure D1 pressure: 0 Update complete Sysex message: F0 00 00 7E 40 00 01 F7 Reboot (upload request) [D0 1A] channel 1: key pressure D1 pressure: 0 Update completeOnce the update has been completed, the LCD will show (if connected): Bootloader up-to-dateAfter this procedure you can upload the application.... a lot of step by step guides for the other cases...[/code]for your case, A) was the right selection - are there any details in A) which confused you? I would like to know this in order to improve the documentation.Yesterday I got mios studio running and tried to upload the mios from mios_update_v1_9.zip/pic18f452/mios_v1_9_pic18f452.hexIt started to upload all checksums where ok untill suddenly there was some address range error no. 5.After that the chip sent out 2 upload requests on every startup instead of just one.this was the wrong selection, but it doesn't hurt - mios_v1_9_pic18f452.hex doesn't contain the start vector at 0x0000, so the dummy start vector which branches to the old bootloader was not overwritten.The result: no effectI then uploaded the new version of the bootstrapper the same way through mios studio and that upload worked fine without any errors, and after that the pic sent out an upload request every second, just like it did before.This should *never* be made because it cannot work (I'm writing this for the case that somebody else is trying the same)So, what happend: the old bootloader wrote the new bootloader to 0x000-0x3ff. But it has modified the reset vector. After a reset, the PIC first branches to the old bootloader, and after 2 seconds to the new bootloader.Both bootloaders have different access rights - and this can lead to data loss.So again: never upload the bootloader .hex file directly, always use the update packages I've prepared.Thats also the reason, why you can find the bootloader binary in the "burner/" directory, and not in the "midi/" directory.Then I again uploaded mios_v1_9_pic18f452.hex and everything went fine, all checksums where ok, and it uploaded successfully.this was done by using the new bootloader, which allows to overwrite 0x7c00-0x7fff - the address range where the old bootloader was located. So, you've overwritten the old bootloaderHave I somehow ruined the bootstrap loader, or the flash?yes, you've ruined the bootloader mechanism. The old bootloader prevented to modify the reset vector at 0x0000, now the PIC branches to 0x7c00 after reset, which doesn't contain valid code anymore.can I reset the chip and do it from scratch somehow, without a burner?no. I would propose to send the PIC to somebody who has a burner. He can burn the bootloader again into the chip. Please note: if he burns V1.2, you need to follow the step-by-step guide of case C)Please never ignore a README.txt file!The bootloader mechanism is very save in the meantime, but there are cases which can lead to failures if you don't follow the right guide.Best Regards, Thorsten. Quote Link to comment Share on other sites More sharing options...
hithere Posted April 17, 2006 Author Report Share Posted April 17, 2006 for your case, A) was the right selection - are there any details in A) which confused you? I would like to know this in order to improve the documentation.No, your documentation is very clear, just stupid me not to read the readme.txt :-\ I just read through the step by step guide on the "Bootstrap Loader" page, and when that didn't work, I decided it had to be that my bootstrapper was to old, so I uploaded that as well.I guess you could put a note on the "Bootstrap Loader" page saying: "Don't try to upload the bootstrap loader through Mios Studio!, read the readme for info.." for the impatiently challenged people like me... ;DI found a JDM kit in my box from smash, so I will put that together and find some computer with a serial port to fix my PIC.Would it work with some kind of serial to USB converter plug?Thanks a bunch for the detailed reply! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.