Skip to content

Commit 3e35adb

Browse files
committed
Merge pull request shumatech#6 from 8devices/arduino
Fix crash for SAMD and add support for SAMD21J18A.
2 parents 28128e8 + fd0cb87 commit 3e35adb

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/FlashFactory.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,13 @@ FlashFactory::create(Samba& samba, uint32_t chipId)
5151
// SAMD21
5252
//
5353
case 0x10010000:
54-
flash = new NvmFlash(samba, "ATSAMD21J18A", 0x000000, 4096, 64, 1, 16, 0x804000, 0x20008000, 0x41004000, true);
54+
case 0x10010100:
55+
flash = new NvmFlash(samba, "ATSAMD21J18A", 0x000000, 4096, 64, 1, 16, 0x20004000, 0x20008000, 0x41004000, true);
5556
// 0x41004000 == Base address for the NVMCTRL module
5657
break;
5758

5859
case 0x10010005:
59-
flash = new NvmFlash(samba, "ATSAMD21G18A", 0x000000, 4096, 64, 1, 16, 0x804000, 0x20008000, 0x41004000, true);
60+
flash = new NvmFlash(samba, "ATSAMD21G18A", 0x000000, 4096, 64, 1, 16, 0x20004000, 0x20008000, 0x41004000, true);
6061
break;
6162

6263
//

src/Samba.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ Samba::init()
143143
printf("Unsupported ARM920T architecture\n");
144144
}
145145
// Check for supported M0+ processor
146-
else if (cid == 0x10010000 || cid == 0x10010005)
146+
else if (cid == 0x10010000 || cid == 0x10010100 || cid == 0x10010005)
147147
{
148148
return true;
149149
}
@@ -608,6 +608,7 @@ Samba::reset(void)
608608
{
609609
// SAMD21G18 or SAMD21J18
610610
case 0x10010000:
611+
case 0x10010100:
611612
case 0x10010005:
612613
// http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0484c/index.html
613614
writeWord(0xE000ED0C, 0x05FA0004);

0 commit comments

Comments
 (0)