Skip to content
This repository was archived by the owner on Mar 7, 2026. It is now read-only.

Commit bb7a433

Browse files
committed
Feature: samd: Add support for PIC32CM MC Family
This change adds support for the PIC32CM MC family, a cost-optimized version of the SAM C2x series. The family includes four members: - PIC32CM1216MC000(32|48) - 128K flash, 16k ram, 32 or 48 pins - PIC32CM6408MC000(32|48) - 64K flash, 8k ram, 32 or 48 pins Signed-off-by: GP Orcullo <kinsamanka@gmail.com>
1 parent 31d30ad commit bb7a433

1 file changed

Lines changed: 28 additions & 3 deletions

File tree

src/target/samd.c

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
* * SAMD21J18A (rev B)
3030
* * SAML21J17B (rev B)
3131
* * SAMC21N18A (rev E)
32+
* * PIC32CM1216MC00048 (rev B)
3233
*/
3334

3435
/*
@@ -405,6 +406,10 @@ samd_descr_s samd_parse_device_id(uint32_t did)
405406
case 4:
406407
samd.series = 9;
407408
break;
409+
case 7:
410+
/* PIC32CM MC00 */
411+
samd.series = 7;
412+
break;
408413
default:
409414
samd.series = 0;
410415
break;
@@ -476,6 +481,20 @@ samd_descr_s samd_parse_device_id(uint32_t did)
476481
}
477482
samd.variant = 'A';
478483
break;
484+
case 7U: /* PIC32CM MC00 */
485+
if (devsel & 0x1) {
486+
/* PIC32CM6408MC000xx */
487+
samd.flash_size = 65536;
488+
samd.ram_size = 8192;
489+
samd.mem = 8;
490+
} else {
491+
/* PIC32CM1216MC000xx */
492+
samd.flash_size = 131072;
493+
samd.ram_size = 16384;
494+
samd.mem = 16;
495+
}
496+
/* PIC32CMxxxxMC000(32|48) */
497+
samd.pin = (devsel & 0x6) ? 48 : 32;
479498
}
480499

481500
return samd;
@@ -526,9 +545,15 @@ bool samd_probe(target_s *t)
526545
/* Protected? */
527546
const bool protected = (ctrlstat & SAMD_STATUSB_PROT);
528547

529-
snprintf(priv_storage->samd_variant_string, SAMD_VARIANT_STR_LENGTH, "Atmel SAM%c%02d%c%d%c%s (rev %c)%s",
530-
samd.family, samd.series, samd.pin, samd.mem, samd.variant, samd.package, samd.revision,
531-
protected ? " protected" : "");
548+
if (samd.series == 7) {
549+
snprintf(priv_storage->samd_variant_string, SAMD_VARIANT_STR_LENGTH,
550+
"Microchip PIC32CM%02u%02uMC000%02u (rev %c)%s", samd.mem > 8U ? 12U : 64U, samd.mem, samd.pin,
551+
samd.revision, protected ? " protected" : "");
552+
} else {
553+
snprintf(priv_storage->samd_variant_string, SAMD_VARIANT_STR_LENGTH, "Atmel SAM%c%02d%c%d%c%s (rev %c)%s",
554+
samd.family, samd.series, samd.pin, samd.mem, samd.variant, samd.package, samd.revision,
555+
protected ? " protected" : "");
556+
}
532557

533558
/* Setup Target */
534559
t->driver = priv_storage->samd_variant_string;

0 commit comments

Comments
 (0)