Observations on updating RN4871 firmware with Update Tool
Today I successfully brought a RN4871 back from the bricked state to normal functionality, so I thought I would summarize the procedure with some details I observed along the way. Thanks to traversjames for your suggestions on going to page 43 of the PICtail manual.
First of all, the condition of my RN4871 had become totally non-responsive. (The hazards of the development process, I guess.) Even with careful booting up with RX_IND held low and BT_RST brought high by my PIC, I verified with a scope that there was absolutely no activity on the serial TX pin from the RN4871, much less a full "%REBOOT%" message. It was dead. I had previously changed the baudrate to 2400 baud and for several days it worked fine at that baudrate.
From reading what others have posted here, I gathered that the critical pin for using the Update Tool is P2_0 (pin 16 on the RN4871). This pin must be pulled low before power is applied, or at least before letting the RN4871 come out of reset, because it is only sampled at the time. So I did that with a clip lead.
The Update Tool must also have control of the serial lines, RX and TX. In my application circuit, RX and TX go directly to TX and RX on my PIC. In order to avoid driving a line from two sources at once, I have a provision in my PIC program that will put both RX and TX in passive (input) mode when I power up with a certain jumper on my board. This allows me to communicate with the RN4871 directly with a terminal.
If you haven't already made one, I highly recommend building a dedicated interface circuit to convert between a DB-9 standard RS-232 connector and four micro clip leads labelled GND, Vcc, TX, RX. I use logic-level FETs to perform the necessary inversion and level shifting of RX and TX and a 9-volt battery to generate voltages sufficient for most RS-232 ports on computers. Having a Vcc line into this box lets it work with both 5-volt and 3-volt circuits. I use mine in practically every project that involves serial ports.
I downloaded RN487x Firmware Update Tool -IsUpdate.zip and RN487x Firmware v1.18.3 - Apr14.zip from Microchip. I unzipped both packages into the same folder. The first package contains only the isupdate.exe application. The other package contains BT5505_BLEDK3_RELEASE_SHADOW.H00, BT5505_BLEDK3_RELEASE_SHADOW.H01, BT5505_BLEDK3_RELEASE_SHADOW.H02, BT5505_BLEDK3_RELEASE_SHADOW.H03, and a PDF file of release notes.
I have a USB to RS-232 converter plugged into my Windows computer. When I run isupdate.exe, one of the choices for the Access Port is COM3, which is this serial port. The baudrate is set to 115200, which caused me some concern, since I had changed the baudrate of my RN4871. But it appears that when in the update mode (P2_0 pulled low) the RN4871 always goes to 115200 regardless of what was set in application mode, so that was a good thing. Following the instructions on page 43 of the PICtail manual, I changed the memory type/subtype to "flash" and "Embedded flash". Nothing else needed changing.
Then I powered up my application circuit, making sure that:
1. Jumper telling the PIC to "go passive" was in place.
2. P2_0 was pulled low.
3. RX, TX, Vcc, GND taps for my interface circuit were connected.
Then I clicked on "Connect." Connection with the RN4871 succeeded and the other buttons in the Update Tool were no longer grayed out.
I clicked on the upper "Browse" button and selected all four of the .H0x files that had been unpacked earlier. (I don't know if that was necessary. Maybe the Update Tool would have found them on its own.)
I clicked on "Update", and then watched as the displayed filled out just as shown in the PICtail manual. It took less than half a minute. It ended with "End of Write Memory.". Then I clicked on Disconnect and powered down the application circuit.
Then I removed the P2_0 jumper, ran a terminal program on my PC, and powered up the application circuit. "%REBOOT%" appeared at 115200 baud, and response to "$$$" and commands was as expected. Apparently updating the firmware also resets the application baud rate setting.
So that's it. Everything is back to working as it was before the RN4871 was bricked.