AT90USB + bootloader + firmware update via PC application

Go To Last Post
5 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

I was looking for some information about firmware update via pc application (my own pc application) on AT90USB.. (at90usb646 in my case) but didnt find nothing special (usb case).

I have project on at90usb646 with LUFA HID implementation (great library Dean - thanks!). I have PC application written in Visual C++ (MFC) with AtUsbHid ATMEL dll library - it's working and communicating with uC. All what I need is additional option in my PC application for firmware update (with security of hex file) - sth. like "check firmware update and update" (fully automatically). I know that I need special bootloader for AVR, and now I have some questions:

1. Can it be LUFA bootloader? and which one? (CDC or DFU?)
2. How to prevent the theft of .hex file? how to successfully secure it?
3. How to jump to bootloader section and back to application with any hardware intervention?

If someone have additional information (forum links, articles etc) it would be great! I don't have 'start point' where I can looking for information/solution for my problem.

Thanks for help! and sorry for my english mistakes..

greetings!
Arthur

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

1) You could implement your own HID based one if you like. If you went for DFU you'd have to implement the same program that FLIP uses in your own PC app - far simpler to stick with CDC or HID.

2) Atmel have examples of (non USB) bootloaders that either use DES(3) or AES to encrypt the data. You will face a bit of a challenge to fit all you need in the BLS space available in the chip perhaps. Though it looks like the 646 does offer an 8KB option.

3) Always, when you use a bootloader you set the BOOTRST fuse so that at power on the first opcode fetch is from the start of the bootloader not 0x0000. The bootloader then looks for a trigger to decide whether to stay in bootloading mode or to pass control to the app at 0x0000. The AT90USB chips have a secondary mechanism besided BOOTRST which is the HWBE fuse and it enables a power on decision to be made via the state of the ALE/_HWB pin.

As you are using LUFA you can "borrow" the actual SPM code from Dean's examples even if you don't use the higher level comms protocol stuff (CDC/DFU). This would allow you to create a HID based bootloader.

Cliff

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

thanks for reply!

First of all I'll try with DFU bootloader without any encryption in my own pc app (I hope it's fastest and the easiest way). If it will works, I will try to implement HID bootloader + encryption. A lot of work to do.. much more that I thought at the beginning. Thanks for help!

greetings
Arthur

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Personally I wouldn't waste time on DFU - to do the decryption thing you need to write your own USB enabled bootloader anyway so I'd base it on whatever USB class you are most familiar with.

Note that if the BL does use AES/DES or similar it will have to contain the key which means that if someone "breaks into" the chip they can find out what this is. Companies in the Far East offer to "break into" AVR chips for as little as $100-$500 so I wouldn't spend too much of your life worrying about this as you can only prevent "casual hacking". Anyone who is determined WILL break into your system.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:

Note that if the BL does use AES/DES or similar it will have to contain the key which means that if someone "breaks into" the chip they can find out what this is. Companies in the Far East offer to "break into" AVR chips for as little as $100-$500 so I wouldn't spend too much of your life worrying about this as you can only prevent "casual hacking". Anyone who is determined WILL break into your system.

Is it so cheap nowadays? good to know...