CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

How to do a field firmware update?

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
kbruin79



Joined: 02 Aug 2010
Posts: 30

View user's profile Send private message

How to do a field firmware update?
PostPosted: Tue Jan 22, 2013 1:58 pm     Reply with quote

Hello,

I am working on a small handheld device that uses a pic16f1939 and would like to know how to allow customers to perform a firmware update on this device?

From what I read, I could use a usb to serial converter and have a bootloader running on the chip but where can I find a reliable PC software interface that takes the hex file to communicate to the pic?

I have looked at a list of free open source ones, the problem is they have limited device support and not very user friendly.

Any suggestions on a reliable user friendly PC interface ?

Thanks in advance.
newguy



Joined: 24 Jun 2004
Posts: 1907

View user's profile Send private message

PostPosted: Tue Jan 22, 2013 2:46 pm     Reply with quote

The CCS load-n-go fits the bill. Sell one to the customer and have them install the CCSload program on their PC. Then just email them the hex file. They start up CCSload, download the program to the load-n-go, then use that to program the device. If it's possible or feasible for them to drag a laptop out the device, then a ICD-U64 is less than half the cost of a load-n-go and uses the same program (CCSload).
kbruin79



Joined: 02 Aug 2010
Posts: 30

View user's profile Send private message

PostPosted: Tue Jan 22, 2013 3:56 pm     Reply with quote

newguy wrote:
The CCS load-n-go fits the bill. Sell one to the customer and have them install the CCSload program on their PC. Then just email them the hex file. They start up CCSload, download the program to the load-n-go, then use that to program the device. If it's possible or feasible for them to drag a laptop out the device, then a ICD-U64 is less than half the cost of a load-n-go and uses the same program (CCSload).


Thanks for the suggestion however what I am looking for is a program that i can provide to the customer for them to install. Using this program they can update the handheld device by simply downloading the hex that I provide from my website.

Essentially it's the same firmware update procedure you follow when you buy an electronic device that requires constant firmware update.
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Tue Jan 22, 2013 4:34 pm     Reply with quote

The CCS Load-n-Go at $199 seems expensive to me for a user to do firmware update.
An ICD-U64 at $89 is half the price, but still a lot of money when you just want to do a firmware upgrade.
The Microchip PicKit3 can be configured as 'Programmer-to-Go'. Download the firmware on it, send to your customer. The customer connects the device and presses the button on the PicKit3. Ready. No PC required. costs $45

But... as a normal user I can't remember when I had to buy special equipment for upgrading my Phone, router or other consumer device. This can be achieved though the use of a bootloader firmware in the PIC and a program on the PC.

Many of the free PIC bootloaders use the bare hex-file as input transmitted from the PC over RS232 by a program like Hyperterm, Telnet, Putty, etc. This works and is OK for technical persons like us, but not something I would have done by a normal user. More professional is to hand the user a dedicated loader program; there exist several like that but most have closed source for the PC program.

It seems like not a lot is happening in bootloader developments, searching the internet I find many old (abandoned ?) projects.

Tiny PIC Bootloader has been around for a long time and has proven itself. Free. I like the protocol it uses to the PIC which supports several commands, including reading memory and setting fuses. PC source code is not available, too bad because I'd like to simplify the user interface even more for the standard user.

A fork from the Tiny PIC Bootloader with all source code available can be found on Google Projects: http://code.google.com/p/pic-bootloaders/ but even this project had it's last update two years ago (Dec-2010).
It is a console tool, not my preference as it makes it more difficult for the user to specify the COM port number (not many users know how to figure out the correct COM port number nowadays). A nice feature though is that they provided for embedding the firmware into the code, so you can send your users a one-click tool.

Perhaps it is best to take the bootloader firmware of the Tiny PIC Bootloader, reverse engineer the protocol and then write your own PC application.

Also have a look at Microchip Application note AN1310 - High-Speed Bootloader for PIC16 and PIC18 Devices


Last edited by ckielstra on Tue Jan 22, 2013 5:10 pm; edited 1 time in total
newguy



Joined: 24 Jun 2004
Posts: 1907

View user's profile Send private message

PostPosted: Tue Jan 22, 2013 5:03 pm     Reply with quote

ckielstra wrote:
(snip)This works and is OK for technical persons like us, but not something I would have done by a normal user.


That's exactly why I suggested the programmer approach. A "normal user" will probably have difficulty with a USB to serial dongle's PC software unless that software is as simple as double-click to program. Unless you're capable and/or willing to write your own windows-based download program, the "normal user" WILL screw this up.

...Not to mention what will happen when they inevitably lose the USB to serial dongle you supply and try it with a "this looks the same" replacement they find online and subsequently run into driver or PC software issues.
bkamen



Joined: 07 Jan 2004
Posts: 1615
Location: Central Illinois, USA

View user's profile Send private message

PostPosted: Tue Jan 22, 2013 5:49 pm     Reply with quote

If you look in the CCS library, there's a serial bootloader.

From there, you can use the wonderful Windows GUI based SIO.exe which is CCS's loader that runs from a PC.

I don't believe it's free to give away -- but has a very low licensing fee.
You could sell that to your customer and then they'd use ANY serial port they can come up with (USB or legacy) to field program a PIC.

Call and talk to CCS -- but you can also look at the bootloader which is included with PIC-C in the meantime.

Keep in mind, your device also needs to support self programming.

-Ben
_________________
Dazed and confused? I don't think so. Just "plain lost" will do. :D
temtronic



Joined: 01 Jul 2010
Posts: 9221
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Tue Jan 22, 2013 7:25 pm     Reply with quote

.. you've opened up a 'can of worms'!
Firmware updates are usually disasters waiting to happen.
No such thing as 'a reliable user friendly PC interface '.

Whatever path you choose, beta test 'the system' with REAL people NOT techs! Grab mothers,uncles,old guys, and let them read your onscreen instructions and see if THEY can get the job done. NO prompting, no verbal suggestions(cough,cough,ahems allowed).REAL tests with REAL people.
I'll lay odds you'll reevaluate your first attempt 3 or 4 times.


good luck !
hth
jay
bkamen



Joined: 07 Jan 2004
Posts: 1615
Location: Central Illinois, USA

View user's profile Send private message

PostPosted: Tue Jan 22, 2013 7:48 pm     Reply with quote

temtronic wrote:
.. you've opened up a 'can of worms'!
Firmware updates are usually disasters waiting to happen.
No such thing as 'a reliable user friendly PC interface '.


Ha! Did I say reliable?

Or even "User friendly"?

haha. No.

Quote:

Whatever path you choose, beta test 'the system' with REAL people NOT techs! Grab mothers,uncles,old guys, and let them read your onscreen instructions and see if THEY can get the job done. NO prompting, no verbal suggestions(cough,cough,ahems allowed).REAL tests with REAL people.


Amen to that!
_________________
Dazed and confused? I don't think so. Just "plain lost" will do. :D
newguy



Joined: 24 Jun 2004
Posts: 1907

View user's profile Send private message

PostPosted: Tue Jan 22, 2013 9:12 pm     Reply with quote

temtronic wrote:
Whatever path you choose, beta test 'the system' with REAL people NOT techs!


Even our in-house techs will, more often than not, completely screw things up. Evil or Very Mad
Ttelmah



Joined: 11 Mar 2010
Posts: 19496

View user's profile Send private message

PostPosted: Wed Jan 23, 2013 3:25 am     Reply with quote

Also, if you use either a bootloader, or your own programmer code, 'device check' your file. So if you have (say) a hex file that is for your product 'controller-X, version 3', have each controller having an board ID number, and make your code check that the ID on the file, matches the one on in the device, before it'll allow you to proceed. Avoids the disaster where code for version 3 hardware is loaded into a version 4 board, by somebody who doesn't read the 'limitations' page, or who thinks "I'll be smart", before uploading.....

Best Wishes
CHCHPIC



Joined: 15 Aug 2012
Posts: 1

View user's profile Send private message

Tiny Bootloader
PostPosted: Wed Jan 23, 2013 1:51 pm     Reply with quote

As a comment, A few years ago we approached the developer of Tiny PiC Bootloader and for a small cost, it think it was 50 euros he provided the source code for us to modify.
We have been successfully bootloading new firmware on our sites in New Zealand over an RS485 bus for 3 years will little trouble.

Regards

Mark
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group