tree: eeec6122c1423f0848a3a0264e7b140fe87a7068 [path history] [tgz]
  1. BUILD.gn
  2. COMMIT-QUEUE.ini
  3. OWNERS
  4. README.md
  5. curve25519.c
  6. curve25519.h
  7. curve25519_test.cc
  8. dbus/
  9. dbus_wrapper.cc
  10. dbus_wrapper.h
  11. docs/
  12. fmap_utils.cc
  13. fmap_utils.h
  14. hammer_info.py
  15. hammer_updater.cc
  16. hammer_updater.h
  17. hammer_updater_test.cc
  18. hammerd_api.cc
  19. hammerd_api.h
  20. hammerd_api.py
  21. hammerd_api_demo.py
  22. hammertests/
  23. init/
  24. main.cc
  25. mock_dbus_wrapper.h
  26. mock_fmap_utils.h
  27. mock_pair_utils.h
  28. mock_update_fw.h
  29. mock_usb_utils.h
  30. pack_firmware.sh
  31. pair_utils.cc
  32. pair_utils.h
  33. pair_utils_test.cc
  34. process_lock.cc
  35. process_lock.h
  36. rsyslog/
  37. setup.py
  38. udev/
  39. uma_metric_names.h
  40. update_fw.cc
  41. update_fw.h
  42. update_fw_test.cc
  43. usb_utils.cc
  44. usb_utils.h
hammerd/README.md

hammerd: A daemon to update hammer

Summary

hammer is the base of detachable, connected via USB over pogo pins. hammer runs its own upgradable firmware (base EC, running EC codebase on STM32F072), is attached to a touchpad (with its own upgradable FW), and is able to pair with the detachable.

We need a userspace daemon, running on the AP, that does the following things related to hammer:

  • Waits for a base to be attached on detachable's pogo pins port, and then performs the following tasks as required.
    • Base EC FW update
    • Base touchpad FW update
    • Base pairing
    • Tell base to increment its rollback counter (if necessary)
    • Interaction with Chrome:
      • Shows notification during update (EC+touchpad)
      • Shows notification that a new base is connected (pairing)

Triggered On Boot

Before the UI starts, hammerd is invoked to check whether the base is attached and need update or not. If so, then hammerd update the base EC firmware and touchpad firmware.

Triggered On Attachment

hammerd is also invoked when the base is attached to check whether the base needs update. But hammerd ONLY send a DBus signal to notify Chrome UI in critical case (firmware is broken or critical update appears), NOT updating anything.

Update Manually

We can also manually update firmware by running: start hammerd UPDATE_IF="always" It is useful in development or debugging.