travisgoodspeed / goodwatch

Replacement board for Casio Calculator Watches using the CC430F6147
508 stars 55 forks source link

OTA Updater #152

Open AkaBkn opened 3 years ago

AkaBkn commented 3 years ago

This pull request adds the functionality to update the firmware over radio.

How to use:

  1. Press SET when in app (it will use your codeplug frequency)
  2. use bin/ota-updater-rfcat.py [-f FREQ] firmware/goodwatch.hex (uses RfCat/rflib)

How it works:

Updater blob:

Until further tests, this code is labeled as #worksforme (but it works quiet good: flashing firmware in 8s)

travisgoodspeed commented 3 years ago

I've resolved the conflict from other recent merges.

Some quick thoughts:

  1. It would be handy to be able to transmit through a serial-attached watch, but the goodwatch.py protocol is pretty crufty. Maybe we should burn it to the ground and aim for some sort of compatibility with rfcat?
  2. It's nice and small.
  3. The Makefile has some illegal indentations, and convert.py is missing a hashbang line at the top.
AkaBkn commented 3 years ago
  1. I would have done that too, if I had a second watch. I think we need multiple solutions for that, some people have a second watch, some people a rfcat and others maybe a hackrf/sdr.
  2. I fixed it with latest commit (also did some other fixes/comments/cleanup)
travisgoodspeed commented 3 years ago

Took another gander at the code:

  1. Do you intend to fork radio.c and radio.h? This isn't necessarily a problem, but I'd like to double-check that there's a good reason not to just link against the standard ones.
  2. The codeplug frequencies aren't used by very many applets, and they might be cut out in the near future. Perhaps we should use a fixed frequency, or one fixed freq per band?
AkaBkn commented 3 years ago
  1. Yhea, I copied them and stripped out things not needed (maybe not necessary if linker will strip unneeded stuff reliably). I just didn't wanted to clobber your files, also, if something changes in radio.c & radio.h in firmware, it will not break the updater.. packet.c/packet.h are also copied, altough, there i changed things to make it work better (alignment of rxbuffer, rx overflow handling).
  2. I used to have fixed frequencies, but for the pull request I thought it would be better/genuine to use codeplug.