Skip to main content
Topic: I think I bricked my BP v3, updating to v4 (I didn't follow the instructions) (Read 6911 times) previous topic - next topic

I think I bricked my BP v3, updating to v4 (I didn't follow the instructions)

System info:
Intel Macbook Pro
Snow Leopard with latest updates
Older & latest version of Python Serial Library
Using "P24qp.py" to try to update BL to 4 series
Tried 2 x different USB cables
Tried 2 x different Macbook Pro's
Tried older & latest version of FTDI drivers
Tried Windows based EXE tools (VMware Fusion & Windows XP Pro - P24QP.exe & ds30 Loader GUI.exe)
Update files used were from "v2tov41-bootloader-update.zip"
The "P24qp.ini" file has the baud rate set at 115200 - this has always worked for me previously
Previously, as an example, I used the following to update the firmware on my BP:
'python P24qp.py -a v3-Firmware-v3.1.hex -s /dev/cu.usbserial-A1004cjE -v'
I normally use my BP from the terminal with the following command:
'screen /dev/cu.usbserial-A1004cjE 115200 8N1'

This is what I think I did to cause my problem (from shell history):
'python P24qp.py -a upgrader/BPv3-blupdater-v4.1.hex -s /dev/cu.usbserial-A1004cjE -v'
'python P24qp.py -a v4firmware/BPv3-Firmware-v4.1.hex -v /dev/cu.usbserial-A1004cjE'
'python P24qp.py -a v4firmware/BPv3-Firmware-v4.1.hex -s /dev/cu.usbserial-A1004cjE -v'
I believe the last command completed, with some write/verify errors.  I'm not sure if they are the typical write/verify errors (I've lost that history).

I did all the above, sequentially (I know - I didn't read the instructions carefully enough), with a jumper on the PGC & PGD pins, WITHOUT EVER REMOVING POWER.  I realize the second command is syntactically incorrect, and probably did nothing.  I'm including it for completeness.

Current status:
When the BP is connected, with the jumper on the PGC & PGD pins, the Power & Mode LEDs illuminate, as though it is ready for programming.
When the BP is connected, without the jumper on the PGC & PGD pins, the Power LED illuminates, as though it is ready for use.
A any baud rate (tried several from 1200 to 115200), without the jumper, I get no response from the BP, with the above screen command, EXCEPT at 9600, and I must press a key 9 or 10 times.  Then the Mode LED illuminates, and I get garbage for each key pressed.
If I set the baud rate in the "P24qp.ini" file to 9600, "P24qp.py" recognizes the BP, and attempts to program it:
Using Serial Port /dev/cu.usbserial-A1004cjE @ 9600
Reading 4 bytes from address 0x00FF0000
Found PIC24FJ64GA002
Erase Flash:
   Erasing 43 pages, starting at 0x00000000
   Erase complete
Writing 256 bytes to address 0x00000000
......

The programing says the following at the end:
Write operation complete.
Verified Okay.
   Verification complete, switching to user mode

But the BP does not switch modes, and there are WAY MORE ERRORS, than I have ever seen in the update process.  More verifies fail, than pass.

The Windows tool "P24QP.exe" will see the BP at 9600 baud, recognize it, and attempt to program it.  It fails with SEVERAL (more than typical) write/verify errors - just like "P24qp.py".  Then it opens a text file listing the output.

The Windows tool "ds30 Loader GUI.exe" pretty much does nothing.  It can't find the boot loader it wants to see, and doesn't want to touch the BP.  I've tried changing the baud rate when using "ds30 Loader GUI.exe", and it doesn't help.

If I attempt to program (with jumper) or use (no jumper) to the BP at any baud rate other than 9600, then 9600 does not work unless I disconnect & reconnect the BP.

What else can I include that might help?  I do not have a programmer for this specific chip, to try other tools.  If I have to purchase a programmer, and someone *KNOWS* that will allow me to fix my BP, any recommendations?

Thanks.

Re: I think I bricked my BP (Seeedstudio V3), updating to v4 Firmware

Reply #1
You did check the faq topic elsewhere in this forum? There are several links to screenshot and instructions..

From what I read you forgot to run the upgrade program (remove the jumper, reset it, connect it with 115200b/s follow the instructions) which should install the new bootloader...

Re: I think I bricked my BP (Seeedstudio V3), updating to v4 Firmware

Reply #2
As I said - I did not read the instructions thoroughly enough, before I began. 

That is my fault. 

You are correct - I never ran (and can't seem to now) the "update" program after the first programming.  I can't connect at 115200, with or without the jumper.  I can't get it to take any update (I've tried old firmwares, the plan original boot loader, etc.)

I have read everything I can find - FAQ's, forums, multiple how-to's, etc.  I spent most of yesterday reading & trying different things, after getting myself into this situation.

My original post is where I am now.

Do you have any suggestions or insights?

Re: I think I bricked my BP (Seeedstudio V3), updating to v4 Firmware

Reply #3
Some verify errors are irrelevant (between 0x400-0xbFF and 0xA800-0xABFF). As far as I can tell the bootloader (old version) is still working.

Please flash the updater to the bp using pq24q , remove the jumper and reset the bp, connect at 115200, follow the onscreen intructions

Re: I think I bricked my BP (Seeedstudio V3), updating to v4 Firmware

Reply #4
If you didn't run the upgrade program, then the v2 bootloader should still be working. You should also be able to connect to the terminal. Errors might be because of the partial bootloader write to the upper page. Can you please attach the error.txt to a message so I can look at it.
Got a question? Please ask in the forum for the fastest answers.

Re: I think I bricked my BP (Seeedstudio V3), updating to v4 Firmware

Reply #5
I'm sorry - I may not have given enough detail, or wasn't clear enough.

I cannot connect with ANY TOOL at 115200.  I get time out errors or no response, with any of the tools at 115200.

--------------------------------------------------------------
'python P24qp.py -a upgrader/BPv3-blupdater-v4.1.hex -s /dev/cu.usbserial-A1004cjE -v'
Using Serial Port /dev/cu.usbserial-A1004cjE @ 115200
Reading 4 bytes from address 0x00FF0000
RX Error:  0  bytes received
   Error reading from device!
   Device with ID: 65535 not listed in the config file!
--------------------------------------------------------------

If I attempt at 9600, the BP is recognized and the tools attempt to program it. 

The errors received are NOT normal.  It is probably 90% of the verifies that fail.

Re: I think I bricked my BP (Seeedstudio V3), updating to v4 Firmware

Reply #6
[quote author="ian"]
You should also be able to connect to the terminal.
[/quote]

I cannot connect at the terminal, at any baud rate.  If I initially try at 9600, and press enter (or any other key) 9-10 times, the Mode LED illuminates, and THEN I start to get garbage for each key press.  I get nothing in the terminal, at 9600 baud, until I press a key 9-10 times.  At 115200, I get nothing, no matter how many keys I press or how many times.  The USB light flashes at 9600, when attempting to program or use the BP, but does not at 115200.

The Python or Windows PIC24F Quick Programmer will not see or attempt to program the BP, at any baud rate except 9600.

I've tried to program the updater again, with PIC 24F Quick Programmer (at 9600), and have attached the ERROR.txt file.  The errors are consistent, no matter which tool I use.

One quick question - both the Python & Windows tool identify a "v1.2" when identifying the chip (at 9600).  Is this a hardware version or BL version?  If it's a BL version, shouldn't it be v2.0?

Re: I think I bricked my BP (Seeedstudio V3), updating to v4 Firmware

Reply #7
Some PICs only work at 9600 baud with the old bootloader. That is a know bug. The new bootloader fixes it. That part is fine.

By should be able to connect to the terminal I meant in normal operation. It's clear that you can't.

I have no idea what happens when you connect a terminal at 9600baud because no terminal code runs at this speed. The stuff you enter is interpreted randomly by whatever code is actually running. Could be the upgrader, bootloader, or random junk.

The version is the Microchip bootloader protocol version, it is correct. We called our compile of that v2.

I'll look at the errors now. If the bootloader is still connecting, then it's really good news. There's hope yet.

[s:]Have you connected to the Bus Pirate with a terminal prior to the upgrade? Did you do any upgrades prior to the v4 bootloader upgrade?[/s:] Sorry, I see where you wrote this now.
Got a question? Please ask in the forum for the fastest answers.

Re: I think I bricked my BP (Seeedstudio V3), updating to v4 Firmware

Reply #8
[quote author="ian"]
Some PICs only work at 9600 baud with the old bootloader. That is a know bug. The new bootloader fixes it. That part is fine.[/quote]

I have always (2 or 3 times) been able to successfully update my BP at 115200.  115200 was the only speed I could ever get it to work at, until my attempted v4 update.

I appreciate you taking the time to look at this.

Thanks.

Re: I think I bricked my BP (Seeedstudio V3), updating to v4 Firmware

Reply #9
Hi nicholfd,

Sorry for the spotty support so far, I've been soldering all afternoon and trying to answer emails on a net book by the soldering station.

Thanks for the extra info on the speed, that is an additional concern.

So I assume this happened:
1. You installed the updater correctly.
2. You immediately sent a stream of bytes (the firmware itself) into the updater terminal? The second and third programs completed with verify errors.

I'm really surprised the programming script didn't just quit if you didn't cycle the power because there's nothing in the upgrader that would send a handshake back to P24qp.

I can only see two outcomes from this sequence: 1. the firmware bytestream had 'yes' in it and triggered the upgrade, or 2. the updater just kept looping and showing the intro screen the whole time. Either way I don't see why it would damage the chip, config words, etc.

I see a few odd things in the error messages. I'm going to reload the v2 bootloader on a chip and diff it, there's too much to take in at a glance.

When you use the P24qp.exe in windows, do you press the erase button, and then the play button at the end? I ask because it sounds like you usually use the Python updater.

Could you please try this with the Windows updater:
1. Load a v3.6 firmware from an old upgrade archive.
2. Connect at 9600
3. UNcheck 'preserve configuration bits on erase'
4. Press the erase button
5. Press the program button
6. Press the play button
7. Try to connect.

Be careful between the erase and program: erasing the config bits is dangerous becuase if you lose power during the upgrade the Bus Pirate will be bricked and unable to start again.

Please post a copy of the error output.

I'm going to get something to diff your earlier errors against.

My best guess, if it's a 'bad error', is that the configuration words are messed up. Not sure why (how) that would happen, unless the second program was successful and you actually wrote the new firmware without the config words after erasing the old ones. Can you remember anything more about what happened the second and third time you ran the update (loading the v4 firmware with p24qp)?
Got a question? Please ask in the forum for the fastest answers.

Re: I think I bricked my BP (Seeedstudio V3), updating to v4 Firmware

Reply #10
Ok, your bootloader seems to be 100% intact :)

This is a big problem though:
Code: [Select]
Verify Error at 0xABFC should be: 0xF9DF but read: 0xFFFFFF
Verify Error at 0xABFE should be: 0x3F7F but read: 0xFFFFFF

Those are the configuration bits that choose the startup clock speed, etc. Could explain why you suddenly can only connect at 9600bps (bad clock configuration).

It's also possible that you enabled code protection or other fuses that prevent further writes to the chip flash. We'd have to compare 0xffff to the datasheet to be sure.

My guess would be that you successfully connected to the v2 bootloader, erased the whole chip, then uploaded the new firmware that doesn't include replacement configuration bits (standard for v4) and now it's operating on 0xffff, 0xffff.

Since you can still connect to the bootloader, you might be able to erase and reprogram the config bits if you uncheck that setting and upload a v3.6 firmware. That is the best option I see right now. The problem would be if one of the config bits now prohibits further writes, so the bootloader can't do its thing.
Got a question? Please ask in the forum for the fastest answers.

Re: I think I bricked my BP (Seeedstudio V3), updating to v4 Firmware

Reply #11
...the solution being to reflash the chip with either the v2 or v4 bootloader. You'd need a PIC programmer. Where are you? Maybe someone is close.

The cheapest PIC programmer is a PICKIT2, about $30. There are ebay clones too, but I hear that it's about the same price as the 'real deal'. I personally like the ICD2, but only because the PICKIT used to be so limited, the ICD2 is $150 ($50 less if you can muster a .edu email).
Got a question? Please ask in the forum for the fastest answers.

Re: I think I bricked my BP (Seeedstudio V3), updating to v4 Firmware

Reply #12
BTW - I've not seen any "spotty support".  I'm more than pleased with the quick responses and support provided.

I've never use the Windows tool, until troubleshooting my failed v4 upgrade.  I've always use the Python updater.  When troubleshooting with "P24qp.exe", I was just opening the firmware HEX, and choosing Write Device.  In troubleshooting, after reading some other posts, I tried unchecking the Preserve Flash option, and Writing Device.

Per your instructions, this is what I did:
Downloaded "BusPirate.firmware.v3.6.zip" and used firmware/tools in this zip

Unchecked Preserve Flash
(Only Program Memory was checked)

Clicked Erase Device
Finished operation...

Clicked Write Device
Writing: xxxx
Verify error received

Clicked Normal Execution Mode
(Warning dialog)
Run mode is set...
(Mode LED stayed illuminated)

Un-plugged BP
Removed jumper
Plugged BP in
'screen /dev/cu.usb.serial-A1004cjE 115200 8N1'

I see the same symptoms/behavior.  I can't connect, except as describe previously.

I don't remember anything from my original v4 update attempt, that I haven't posted.  I've done a lot of troubleshooting, and tried a lot of things since then.  I do *seem* to remember more than usual verify errors, on the attempt to write the v4 firmware, after writing the v2->v4 boot loader (using the Python script).

I've attechted the ERROR.TXT file.  Even zip'd it was too large.  I split it & zip'd each piece.

Re: I think I bricked my BP (Seeedstudio V3), updating to v4 Firmware

Reply #13
[quote author="ian"]
...the solution being to reflash the chip with either the v2 or v4 bootloader. You'd need a PIC programmer. Where are you? Maybe someone is close.

The cheapest PIC programmer is a PICKIT2, about $30. There are ebay clones too, but I hear that it's about the same price as the 'real deal'. I personally like the ICD2, but only because the PICKIT used to be so limited, the ICD2 is $150 ($50 less if you can muster a .edu email).
[/quote]
I'm in Columbus, Indiana.  Farm country!

I'd be willing to spend the $30 - chalk it up to a learning experience.  I'm not big into this, and the $100-$150 is more than I'm willing to invest.

I'll browse ebay.  If I decide against ebay, any recommended suppliers?

Thanks again!

Re: I think I bricked my BP (Seeedstudio V3), updating to v4 Firmware

Reply #14
Yup, same errors:
Verify Error at 0xABFC should be: 0xF9DF but read: 0xFFFFFF
Verify Error at 0xABFE should be: 0x3F7F but read: 0xFFFFFF

I'm guessing the blank configuration words trigger code protection or write protection, and you can't get anything new on the chip without resetting them with a proper programmer. We could be sure by looking at the datasheet, but I don't think it's worth it except as an academic exercise. This is one of the vulnerabilities that we corrected in the v4 bootloader.

I'm really sorry I can't come up with a crafty way to revive it. I will add a note to the upgrade instructions that this is a possible side effect of loading the v4 firmware with the p24qp utility. It wouldn't have happened with the windows program, so it never occurred to me, I see exactly what the p24qp script did that could have caused this (erasing the whole chip at once, not leaving config words intact).

I did a whois on your email, nice MAME btw, and unfortunately I don't have a 'guy' that does reflashes in your area. If you don't mind sending it to the EU, it can probably get back to you within 2 weeks of your mailing it.
Got a question? Please ask in the forum for the fastest answers.