Skip to content

Commit

Permalink
Merge pull request #72 from g-oikonomou/contrib/cc2640r2
Browse files Browse the repository at this point in the history
Improve support for CC2640R2
  • Loading branch information
JelmerT committed Aug 22, 2018
2 parents edb3c8c + 40f87f5 commit 59fd804
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions cc2538-bsl.py
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,12 @@ def __init__(self, command_interface):
user_id = self.command_interface.cmdMemReadCC26xx(FCFG_USER_ID)
package = {0x00: '4x4mm',
0x01: '5x5mm',
0x02: '7x7mm'}.get(user_id[2] & 0x03, "Unknown")
0x02: '7x7mm',
0x03: 'Wafer',
0x04: '2.7x2.7',
0x05: '7x7mm Q1',
}.get(user_id[2] & 0x03, "Unknown")

protocols = user_id[1] >> 4

# We can now detect the exact device
Expand Down Expand Up @@ -870,12 +875,20 @@ def _identify_cc26xx(self, pg, protocols):
pg_str = "PG2.0"
elif pg == 7:
pg_str = "PG2.1"
elif pg == 8 or pg == 11:
elif pg == 8 or pg == 0x0B:
# CC26x0 PG2.2+ or CC26x0R2
rev_minor = self.command_interface.cmdMemReadCC26xx(
CC26xx.MISC_CONF_1)[0]
if rev_minor == 0xFF:
rev_minor = 0x00
pg_str = "PG2.%d" % (2 + rev_minor,)

if pg == 8:
# CC26x0
pg_str = "PG2.%d" % (2 + rev_minor,)
elif pg == 0x0B:
# HW revision R2, update Chip name
chip_str += 'R2'
pg_str = "PG%d.%d" % (1 + (rev_minor // 10), rev_minor % 10)

return "%s %s" % (chip_str, pg_str)

Expand Down

0 comments on commit 59fd804

Please sign in to comment.