+
Skip to content

Transmit Git Hash over CAN #487

Open
@BlakeFreer

Description

@BlakeFreer

When debugging, it can be very useful to know exactly what code is running on an ECU. We can indicate this by encoding the Git commit hash into the firmware and transmitting it.

#486 added some template messages for this, but they are currently unused.

BO_ 400 FcGitHash: 5 FC
 SG_ Commit : 0|28@1+ (1,0) [0|0] "" RPI
 SG_ Dirty : 32|1@1+ (1,0) [0|0] "" RPI

BO_ 410 LvGitHash: 5 LVC
 SG_ Commit : 0|28@1+ (1,0) [0|0] "" RPI
 SG_ Dirty : 32|1@1+ (1,0) [0|0] "" RPI

BO_ 420 TmsGitHash: 5 LVC
 SG_ Commit : 0|28@1+ (1,0) [0|0] "" RPI
 SG_ Dirty : 32|1@1+ (1,0) [0|0] "" RPI

BO_ 430 DashGitHash: 5 DASH
 SG_ Commit : 0|28@1+ (1,0) [0|0] "" RPI
 SG_ Dirty : 32|1@1+ (1,0) [0|0] "" RPI

Commit refers to the git commit hash. This is 40 hexadecimal characters which uniquely represent a specific commit. For example, at time of writing, main is at commit f05a8fd2b9f769ab9d19da817b42a93e50a8dc5e

40 hex characters is 160 bits which is far too long to send in a single CAN frame, but Git commonly uses just the first 7 characters f05a8fd as shorthand. This will fit in a message.

A "dirty" repository is when there are unstaged changes. It is important to include a Dirty flag in the message so that we know whether the code was modified without making a commit.

Task

  1. Modify cangen to include the current Git Hash and dirty flag in the generated _messages file.

    Consider looking at how we currently do the DbcHash

  2. Add code to each ECU to send the git hash message once per second.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载