Skip to content

Commit fd0cb87

Browse files
committed
Fix system crash when using bossac on UART
The crash is caused by an attempt to write to flash address space (0x804000). The address has been changed to the middle of SRAM (0x20004000). This bug does not show up when using USB CDC.
1 parent 2473c8a commit fd0cb87

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/FlashFactory.cpp

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

5959
case 0x10010005:
60-
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);
6161
break;
6262

6363
//

0 commit comments

Comments
 (0)