NorthboundNetworks / Bossa

Flash programming over USB for Atmel SAM microcontrollers (see also: SAM-BA)
GNU General Public License v3.0
7 stars 1 forks source link

SAM4 support: CHIPID_EXID #3

Closed vk5tu closed 8 years ago

vk5tu commented 8 years ago

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.

vk5tu commented 8 years ago

Add new class ChipId

Update references to uint32_t chipId to ChipId chipId in: