The Bossa code extensively uses an integer chipId — derived from CHIPID_CIDR — to identify the device. All SAM4 devices have the same chipId as the identifying data for the devices has overflowed into an extension register named CHIPID_EXID.
Atmel say that for earlier platforms CHIPID_EXID is reliably zero and can be read without fault. Therefore both CHIPID_CIDR and CHIPID_EXID can be read at the same time.
The question is then do we do the Right Thing or a Hack. The Right Thing is to replace the integer chipId with an object containing both chipID and CHIPID_EXID. The Hack would be to OR CHIPID_EXID into selected unused bits of chipID.
See Chapter 32 Chip identifier of the SAM4E datasheet.
The Bossa code extensively uses an integer
chipId
— derived fromCHIPID_CIDR
— to identify the device. All SAM4 devices have the same chipId as the identifying data for the devices has overflowed into an extension register namedCHIPID_EXID
.Atmel say that for earlier platforms
CHIPID_EXID
is reliably zero and can be read without fault. Therefore bothCHIPID_CIDR
andCHIPID_EXID
can be read at the same time.The question is then do we do the Right Thing or a Hack. The Right Thing is to replace the integer
chipId
with an object containing bothchipID
andCHIPID_EXID
. The Hack would be to ORCHIPID_EXID
into selected unused bits ofchipID
.See Chapter 32 Chip identifier of the SAM4E datasheet.