Robert Rolf wrote: >> ----- Original Message ----- From: "Bob Axtell" >> To: "Microcontroller discussion list - Public." >> Sent: Wednesday, October 27, 2004 2:33 AM >> Subject: [PIC] Easy Internal Firmware Change >> >> >>> In the PIC16F88 there is enough room to keep two >>> complete copies of the program code. Most of my >>> projects (all MPASM) rarely use 2K words. >>> >>> This allows my client to install new firmware by simply >>> including a few special commands into his application >>> that will send 16-word packets of firmware data- which >>> is installed a paragraph at a time into UPPER memory as >>> they come in as serial UART commands. His serial protocol >>> is error-free, of course, to make sure the data arrived intact. >> > > Do you also check that the firmware itself is intact (CRC?) > given that even with error-free communications, winblows can > still hiccup and introduce errors. Its an error-free protocol, and if the receiver has a checksum error it gives a NAK, causing the APP to resend the bad packet. The PIC says it didn't receive it properly, and won't use it. Good point about an overall firmware CRC check, though. > > >>> When the firmware is installed completely into upper memory, >>> it is then copied to the LOWER (operating half), the upper half >>> copy is erased, and the WDT is allowed to force a reset. Takes >>> about 200 words in upper memory for the UPPER to LOWER >>> transfer code, so I can have a firmware size up to 1792 words >>> easily. Do I update the transfer code? In realtime, of course. It >>> never gets copied down to the lower half, though. >>> >>> And my client is STILL protected from firmware theft if the CP >>> bit is 0. What an awesome chip! >> > > > Do you encrypt the upload and decrypt it in the loader? > If not, what stops his customer from logging the > upload data and figuring out what's going on (assuming its > a field update)? > Good encryption will cost many, many bytes. I do a shifting algorithm which won't stop Homeland Security, but will stir the pot some. I should have mentioned it. --Bob > R > > > _______________________________________________ > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > -- Note: Attachments must be sent to attach@engineer.cotse.net, and MAY delay replies to this message. 520-219-2363 _______________________________________________ http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist