tree: b21c201bb53f360e527e5cc69ddcc4c81114533b [path history] [tgz]
  1. dbus/
  2. docs/
  3. hammertests/
  4. init/
  5. rsyslog/
  6. udev/
  7. 2id.h
  8. BUILD.gn
  9. curve25519.c
  10. curve25519.h
  11. curve25519_test.cc
  12. dbus_wrapper.cc
  13. dbus_wrapper.h
  14. fmap_utils.cc
  15. fmap_utils.h
  16. hammer_info.py
  17. hammer_updater.cc
  18. hammer_updater.h
  19. hammer_updater_test.cc
  20. hammerd_api.cc
  21. hammerd_api.h
  22. hammerd_api.py
  23. hammerd_api_demo.py
  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. OWNERS
  31. pack_firmware.sh
  32. pair_utils.cc
  33. pair_utils.h
  34. pair_utils_test.cc
  35. process_lock.cc
  36. process_lock.h
  37. README.md
  38. setup.py
  39. uma_metric_names.h
  40. update_fw.cc
  41. update_fw.h
  42. update_fw_fuzzer.cc
  43. update_fw_load_ec_image_fuzzer.cc
  44. update_fw_test.cc
  45. usb_utils.cc
  46. usb_utils.h
  47. vb21_struct.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.