Skip to content

Commit

Permalink
Fix flashing of CC3200
Browse files Browse the repository at this point in the history
`sig` vs `sign` attribute for signed parts.

CL: none

PUBLISHED_FROM=4effbf0d8bd95d2a6684412c394a49fbf59a2ee2
  • Loading branch information
Deomid Ryabkov authored and cesantabot committed Dec 3, 2018
1 parent 33205bf commit 33d4b5c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 2 additions & 0 deletions common/go/fwbundle/fw_part.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ type firmwarePart struct {
CC32XXFileAllocSize int `json:"falloc,omitempty"`
CC32XXFileSignature string `json:"sig,omitempty"`
CC32XXSigningCert string `json:"sig_cert,omitempty"`
// Deprecated, not being used since 2018/12/03.
CC3200FileSignature string `json:"sign,omitempty"`

// Other user-specified properties are preserved here.
properties map[string]interface{}
Expand Down
10 changes: 7 additions & 3 deletions mos/flash/cc3200/flasher.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,14 @@ func Flash(fw *fwbundle.FirmwareBundle, opts *FlashOpts) error {
if err != nil {
return errors.Annotatef(err, "%s: failed to get data", p.Name)
}
if p.CC32XXFileSignature != "" {
fs, err := fw.GetPartData(p.CC32XXFileSignature)
sig := p.CC32XXFileSignature
if sig == "" {
sig = p.CC3200FileSignature
}
if sig != "" {
fs, err := fw.GetPartData(sig)
if err != nil {
return errors.Annotatef(err, "%s: failed to get signature data (%s)", p.Name, p.CC32XXFileSignature)
return errors.Annotatef(err, "%s: failed to get signature data (%s)", p.Name, sig)
}
if len(fs) != cc32xx.FileSignatureLength {
return errors.Errorf("%s: invalid signature length (%d)", p.Name, len(fi.Signature))
Expand Down

0 comments on commit 33d4b5c

Please sign in to comment.