Merge remote-tracking branch 'upstream/master'

Conflicts:
	boards.txt
	platform.txt
This commit is contained in:
ladyada 2017-04-21 14:17:17 -04:00
commit 10a9c83c3d
39 changed files with 6408 additions and 15 deletions

View file

@ -1,3 +1,8 @@
SAMD CORE 1.6.13 2017.03.31
* Added SDU (SD card Updater) library.
* Fixed 8MHz clock being generated incorrectly. Thanks @keestux
SAMD CORE 1.6.12 2017.02.07
* Fixed type conflict of utoa function. Thanks @kbumsik

View file

@ -123,7 +123,6 @@ adafruit_feather_m0_express.bootloader.file=feather/samd21_sam_ba.bin
#adafruit_metro_m0.bootloader.tool=openocd
#adafruit_metro_m0.bootloader.file=metro/samd21_sam_ba.bin
#
# Adafruit Circuit Playground M0
# ------------------------------
#adafruit_circuitplayground_m0.name=Adafruit Circuit Playground Express

View file

@ -0,0 +1,403 @@
:10000000FC7F002015060000050600000906000020
:1000100000000000000000000000000000000000E0
:100020000000000000000000000000000D060000BD
:100030000000000000000000110600004907000059
:1000400010B5064C2378002B07D1054B002B02D0AE
:10005000044800E000BF0123237010BD5C000020B5
:1000600000000000A818000008B5084B002B03D0C2
:100070000748084900E000BF07480368002B03D089
:10008000064B002B00D0984708BDC046000000007A
:10009000A8180000600000205800002000000000A8
:1000A000154A164B1178002909D115491878097895
:1000B0004118C9B21970802012494003C8611178F3
:1000C0000131C9B211701978F02902D819780929BB
:1000D00009D80B4908784042C0B2087018780978EE
:1000E0004118C9B2197012781B789A4203D1802244
:1000F000044B5203DA6170477800002001000020B1
:10010000000000200044004110B5C3699C07FCD4E6
:1001100003680224A3430360C46901231C42FBD18A
:100120000468234303600368DC07FCD4C46901232B
:100130001C42FBD1C469DC401C42F7D1084B1A4376
:100140000260C3695A07FCD4C0239B0243608181CB
:10015000C3699C07FCD4036802221343036010BDEB
:1001600004000040037EDA07FCD5018570470000DB
:10017000027E01235107FBD5428B1A4207D1428BE5
:10018000DA401A4203D1428B92081A4202D0034B42
:1001900001221A70008DC0B27047C046790000205D
:1001A00070B50368041C988B1A1C0821FF320842A2
:1001B00026D0802099839872112353704021144BCC
:1001C000917150715E68134DC0202E40800506432A
:1001D0005E605E693540284358610F4818600F48DB
:1001E00018615D680E4828408025AD02284358609C
:1001F0005868800B8003586000235171237105E01B
:10020000137ADA0602D5201C00F0D8FA207970BDE6
:1002100098010020FFFFFF8F9800002018010020A8
:10022000FF3F00F0002303714371044B01608360C2
:100230000B78022213430B707047C046A1010000E7
:1002400038B5364B2021DA6901200A43DA61344B94
:1002500006241A7802431A70324B0F221978914300
:1002600019701978214319702F490C7820430870B0
:1002700019780A401A701A7860210A431A702B4BB9
:100280002B4A5A805A7852B2002AFBDB294B0121B3
:100290001A780A431A709A78D107FCD42648026863
:1002A000510B1F221140914200D1052111408C01B8
:1002B0001D8D22492940214319850468A10C0A405B
:1002C0001F2A00D11D221C8D1F210A408C4322436E
:1002D0001A8502680721D20D0A408A4200D1032202
:1002E0000A40188D1103164A02400A431A851978EC
:1002F0007F220A401A701A78042112480A431A70A1
:1003000058621A890C218A431A811A8901218A4369
:100310001A810021802201F044F938BD0004004018
:10032000584400413C44004159440041000C004005
:100330000640000000500041246080003FF8FFFFAD
:10034000FF8FFFFF98010020F7B5141C1F4A5F01C3
:1003500001971D1CD319061C5869271C4000400F2B
:1003600003301033C74006D00F1C80225968120694
:100370000A435A6009E02F1C7B1E9F41144BBF01AA
:10038000FF18381C221C01F003F901990F480835A9
:1003900042181761131C5269A104920B890C920335
:1003A0000A435A6159690B4A0A405A616B01F318B2
:1003B0000222DA715979802252420A435A716B0142
:1003C000F318DB799A07FAD5201CFEBD98010020AE
:1003D00018010020FF3F00F0F8B51A4E051C3378D5
:1003E000141C002B12D1184B184A1A645A6C920B29
:1003F00092035A64586C164A02405A64A2235B0066
:10040000EA5C40200243EA54012333704827FF3757
:10041000EA5D0123134012D00B4B5A6C9204920CEC
:10042000A24202D25C6CA404A40C081C221C074942
:1004300001F0AEF80123EB550023337000E01C1CE3
:10044000201CF8BD7A00002098010020D800002070
:10045000FF3F00F0FF3083792022002900D11022D5
:100460001343837170470000084BFF305A69920BA9
:1004700092035A6102230372827980235B42134301
:100480008371037A9A07FCD57047C0469801002013
:1004900080235B421943C9B28172704770B5A023B3
:1004A00003225B00C254134B134A5C6CC0211440FE
:1004B00089050C4346255C64FF35402444550F4DA7
:1004C00030261D6490256D0046555D6B154029430F
:1004D000922559636D0080214155094D1D63B0255A
:1004E0006D0044555C6F22405A67B2235B00C154D3
:1004F00070BDC04698010020FFFFFF8FD80000208C
:100500005801002030B5364A1E235168082099430F
:1005100002231943516033498A6902438A61324890
:10052000324A9082908A03439382D3689807FCD51D
:100530002F4B012018701878C40704D52C48407838
:1005400040B20028F7DB01209860587840B20028BC
:10055000FBDB284C26484460587840B20028FBDB7F
:1005600082242348E4014480587840B20028FBDB11
:10057000908C8024A0439084D068C506FCD51E4C86
:100580001A48C462D4681948E506FBD5848C1B4D13
:100590002C438484D4681548E506FBD5848C022559
:1005A0002C438484D0680406FCD51048C0684506F6
:1005B000F8D5D068C406FCD500229A605A7852B2A9
:1005C000002AFBDB0E480A4A50605A7852B2002AD1
:1005D000FBDB00230B724B728B72CB7230BDC046BB
:1005E00000400041000400400C06000000080040EC
:1005F000000C004001050100B805FF7D040A000061
:10060000000703000EBEFEE70DBEFEE705BEFEE7D7
:1006100002BEFEE70E4A0F4838B5824204D10E4AA8
:100620000E4B93420ED10AE00D4C9442F7D00023BA
:10063000D1188842F3D9E55804330D60F8E700F08B
:1006400011F804E09342FAD2002102C3FAE7FEE770
:10065000000000205C000020A40300205C000020BB
:10066000AC1800002E4A38B51368141C01331ED094
:10067000D1B200291BD12B4B1878012318402A4BEB
:100680000AD11D6829498D4201D118600FE0196017
:10069000274901390029FCD11960236883F30888B0
:1006A000FF239A43234B9A601D4B5B681847FFF763
:1006B00029FF62B600F09AFD00F04CF81E4B802234
:1006C00052039A601D4B1E4A041C5A60194AC021ED
:1006D000106A09060002000A0143116200229A60B2
:1006E00007221A60A368201C9847164B002801D0E7
:1006F00001221A701A78002A05D0002000F088FA2A
:1007000000F000FBFCE71B78002BEBD100F0E2FDD2
:100710000028E7D0012000F07BFA00F0F3FAFCE7B4
:100720000020000038040040FC7F00203581730762
:1007300048E8010000ED00E00044004110E000E066
:10074000E70300007B00002008B5FFF7A9FC00F0DC
:10075000C3FA08BD10B5054B054C2360FFF770FDCB
:10076000201C2168FFF75EFD201C10BD00500041D9
:100770001802002070B5051CC0B0081C161C0C1C0B
:1007800000F017FF40006A460323023053701070D8
:1007900076080123E218013A11785A00002906D19F
:1007A000281C69460023FFF7CFFD40B070BDB3425F
:1007B000F6DA684681520133ECE70000F7B5BA4A31
:1007C00004681378B949271CFF37051C10203872BC
:1007D0000B705378B648B74E037093783380D17856
:1007E000338809020B4333801179B34B1980517957
:1007F00018880902084318809079B0490880D27996
:100800000888120202430A8040227A71A84F3A787F
:10081000A64F120238780F1C0243A9488446181CC0
:10082000624500D1C2E020DC802149008A4200D12B
:100830006EE109DC812A00D192E0822A00D195E0A4
:10084000802A00D064E18BE081235B009A4200D1D2
:10085000CFE000DA58E1C0239B009A4200D157E173
:10086000984B9A4200D14FE152E190231B019A42EA
:1008700069D015DCD023DB009A4222D088231B01EB
:100880009A4269D0A023DB009A4200D040E1201CAC
:10089000FFF7EAFD3188286889B2FFF7F9FD3BE1EF
:1008A000894B9A4200D12FE100DC31E1874B9A421B
:1008B00000D11DE1864B9A4200D029E133886B714B
:1008C00022E133881B0A012B08D10B8812222868E9
:1008D000934201D80A8892B27E4911E133881B0AFB
:1008E000022B08D10B8843222868934201D80A883A
:1008F00092B2794904E133881B0A032B00D007E147
:100900003388DBB2012B17D0002B07D0022B00D08D
:10091000FEE00A882868D2B2704911E0042201A8DA
:100920006F4900F035FE3B8804222868934201D8C5
:100930003A8892B201A9E3E00A8828686949D2B2EC
:10094000FFF718FFE8E03388201C2B71FFF78CFDC0
:10095000201CFFF7A3FDDFE0291C01C90122CFE025
:10096000614900230B8028680222CAE05E49002208
:100970000A801888502210405C4A10701E880F2090
:10098000304018801888032800D9C1E012781B88ED
:1009900008335B01E418A379002A01D09B0600E02C
:1009A000DB06DB0F0B8028680222A9E019887F2272
:1009B00091434E4AC9B2117018880F210140198025
:1009C0003188002900D0A3E01988002900D19FE0D8
:1009D0001988032900D99BE012781B8808335B0132
:1009E000E318002A02D020225A718DE0102159719B
:1009F0008AE002887F239A433C4BD2B21A70018866
:100A00000F220A4002803288002A00D080E002884B
:100A1000002A00D17CE00288032A00D978E01B7804
:100A2000002B1FD0038808335B01E3189B799A06DB
:100A30006AD50388202208335B01E3181A71038802
:100A400008335B01E318DB795F065DD5038840223C
:100A500008335B01E318DA710388022208335B0173
:100A6000E3181EE0038808335B01E3189B79D9067D
:100A70004AD50388102208335B01E3181A710388F2
:100A800008335B01E318DB799A063DD50388202201
:100A900008335B01E318DA710388012208335B0134
:100AA000E3181A7130E0C046980000207D00002055
:100AB00082000020840000208600002080000020AA
:100AC000020300000103000021200000A12100001A
:100AD00021220000FC15000004000020E8150000A1
:100AE000D8150000DC1500007E0000207C000020EE
:100AF0000B8808222868934201D80A8892B20749D5
:100B00000023FFF721FC07E0201CFFF7ADFC03E00A
:100B1000201C0121FFF79EFCF7BDC04648000020C5
:100B200007B5054B0122019001A91868131CFFF7B6
:100B30000BFC01200EBDC0461802002013B5054B6A
:100B40006C4607341868211C0122FFF745FC207809
:100B500016BDC0461802002010B5074C201CFFF738
:100B60001FFB031C0020834205D022684823FF336B
:100B7000D05C0123184010BD1802002010B5054AB2
:100B80000C1C031C191C10680123221CFFF7DCFB42
:100B9000201C10BD1802002070B5084C061C201C3B
:100BA0000D1CFFF7FDFA0023984205D02068311C88
:100BB0002A1CFFF711FC031C181C70BD1802002032
:100BC000F8B50C4C051C201C0E1CFFF7E9FA00239D
:100BD000271C341C98420AD0002C07D0291C221C48
:100BE0003868FFF7F9FB241A2D18F5E7331C181C99
:100BF000F8BDC0461802002008B5031C081C111CD3
:100C00009847024B64221A8008BDC0468C00002021
:100C1000012805D1054B064A1A60064B187004E0FE
:100C2000002802D1044A014B1A6070478802002054
:100C300030160000940000207C16000030B50A1C1D
:100C40001C4985B00978031C00292AD0042A01D147
:100C5000006804E0022A01D1008800E00078520018
:100C600004A98B180B3B9C1AA3420BD00F21014007
:100C7000092902D83025294300E0373119700009CD
:100C8000013BF1E701A930230B7078234B700A2058
:100C90008B1898700D20D870074B04321B68D868E9
:100CA00003E005490968C868191CFFF7A5FF05B0EE
:100CB00030BDC046880000208802002072B6EFF3E5
:100CC0000883044A1360036883F30888436818475D
:100CD0007047C0468C020020084B1A88002A03D0B7
:100CE0001A88013A92B21A80054B1A88002A03D05A
:100CF0001A88013A92B21A807047C0468C000020D0
:100D00008A000020F0B591B008A9CC4A0B1C31CA6A
:100D100031C351CA51C360CA60C3C94BC9489A683C
:100D20007A255203520F92005258C74902609C68BC
:100D3000A4B262430C60C54900240A60C44A14602E
:100D4000C44C2570C44CC54D2368281C1B69402128
:100D50009847002802D0C24B64221A80C14B00225F
:100D60001860C14B1D60C14BC04DBE4F1A602A6850
:100D70003B689A42E6D2BC4B1B681A78FF2A00D126
:100D800014E2232A00D0EBE1B94E3378002B06D0D1
:100D9000B14BB8491B680222D868FFF72DFFAD4B55
:100DA0001B78532B3CD13B682A6893421ED9AE482E
:100DB00001322A609A1AB04B01681B680131016048
:100DC000AE4E9A4201D2326000E03360A0483268F1
:100DD0000068049000F0DCFB336829685A182A6028
:100DE000A14A1668F1181160A54A13702B68013BDF
:100DF0002B609D4B1A68013A1A60A14B9E4A1B78E2
:100E000011688B420AD222689148C91A0068926917
:100E10009047002802D0924B64221A80C0468DE190
:100E2000522B0AD18A48944A2368006811685B698A
:100E3000039098476422934B0DE04F2B05D1844BD0
:100E40008D4A1B6812681A7078E1482B05D1804BD7
:100E5000894A1B6812681A8070E1572B05D17C4BB8
:100E6000854A1B6812681A6068E16F2B03D1784BC2
:100E70000121186807E0682B08D1754B7E481B6874
:100E800002211B880360FFF7D9FE57E1772B06D1BB
:100E90006F4B79481B6804211B680360F3E7472BFD
:100EA00013D1754B1868FFF709FF774B1B6883F365
:100EB000088862B6754B1B78002B00D13EE1664B6B
:100EC00006201B681B68984738E1542B04D1012386
:100ED0003370614B1B6864E04E2B0CD13378002BD0
:100EE00006D15D4B63491B680222D868FFF784FE78
:100EF0000023337022E1562B57D123686449D86808
:100F00000122FFF779FE23686249D8680322FFF7C0
:100F100073FE614D2368291CD8680122FFF76CFE1F
:100F200023685E49D8680D22FFF766FE2368291CF6
:100F3000D8680122FFF760FE4B4F4C4D5849002303
:100F400039602B603A1C281C13685E1C16601B78E5
:100F50000593002B03D0036801330360F4E73E4E92
:100F60002A683368D868FFF747FE33684A49D8686B
:100F70000122FFF741FE059929604A4939603A4A42
:100F80001368581C10601B78002B04D0374B1A686C
:100F900001321A60F3E733682A68D868FFF72CFE3D
:100FA0003368D86833490222C6E0334A582B17D138
:100FB000244E264D366813682A68B10093420AD23F
:100FC0001F4D5808E861384828801D4D287DC60708
:100FD000FBD55B18F2E7204B34491B68D868AAE0C0
:100FE000592B79D112681A4B3149002A02D11B685A
:100FF0000B606CE0124D086819686B68104E802514
:10100000AB4392087360002A61D02A4B0C4D2B80B1
:101010000B4E337DDD07FBD500230A4D2D6801956E
:10102000AD08AB4203D3244D054E358046E09342D4
:10103000F9D09D00465901334E51EEE710160000DD
:10104000004000414002002038020020340200200D
:101050008402002030020020880200204402002088
:101060008A000020280200202C0200203C020020E0
:1010700088000020701600009002002094020020DA
:10108000240200208C0000208C020020940000200C
:101090004C160000751600004E1600009816000051
:1010A000501600005C16000002A5FFFF6516000048
:1010B0009000002044A5FFFF04A5FFFF3F4E357DB3
:1010C000EE07FBD59D0049194019D21A9BE73C4B0E
:1010D0003C491B68D8682EE05A2B2FD13A4B176831
:1010E0001D680026EF19BD4206D02878311C00F09B
:1010F00013F90135061CF6E7314B34491B68012210
:10110000D868FFF779FD07230F223240111C3609FA
:101110003031092A00DD07311820C0186A46815491
:10112000013BF1D2236806A9D8680822FFF764FDC5
:1011300023682749D8680322FFF75EFD254B7A22F2
:101140001A70254B00221A60244B1B7893422DD035
:101150001B4B23491B680122D868FFF74DFD25E092
:10116000111C3039C8B21C4B092804D81D682A014B
:10117000114319601AE0111C4139052903D81E6872
:10118000373A310106E0111C6139052904D8186885
:10119000573A01010A4308E02C2A03D10A4A196888
:1011A000116001E00B490A7000221A600D4B1A68A9
:1011B00001321A600C4B1A680132D5E5004000413B
:1011C0008802002069160000840200206D160000CD
:1011D0006F160000300200209002002088000020DE
:1011E000731600003C0200202C02002010B51C4B9E
:1011F00001201A78032402431A701A4B0F2219781F
:101200009143197019782143197017490C782043BC
:10121000087019780A401A701A7830210A431A7037
:10122000124B80211A6A0A431A62114B114A5A80E2
:101230005A7852B2002AFBDBC4220F480F499203AE
:10124000FEF762FF0E4A002313700E4A13700E4A17
:1012500013700E4A13700E4A13700E4A137010BDAD
:10126000D6440041BB440041D74400410004004043
:10127000000C004019400000001C00422AF600004B
:10128000980200201F030020990200209C020020E9
:10129000200300201D03002008B5C1B20248FEF75C
:1012A00061FF012008BDC046001C0042024B187EB1
:1012B0004007C00F7047C046001C004208B5FFF74A
:1012C000F5FF0028FBD00248FEF752FF08BDC046DC
:1012D000001C004208B5FFF7E9FF0023984205D043
:1012E000FFF7ECFF031C233B5A425341181C08BD77
:1012F00070B5041C0D1C4618B44204D02078FFF7CA
:10130000CBFF0134F8E7281C70BD10B5041CFFF7B3
:10131000D5FF2070012010BD0B0A5840034B400040
:10132000C05A0902484080B27047C046A616000065
:10133000F7B50024051C0F1C261CBC4220D0FFF76B
:10134000BDFF114BC0B21B780190002B1AD1311C8C
:10135000FFF7E2FF0D4B061C1A88002A04D10C4A45
:1013600011782A1C002907D001996A1C2970802F46
:1013700002D11988013919800134A4B2151CDCE7A7
:10138000301C00E00120FEBD1D0300209A02002059
:101390001E030020F0B53E4E85B0002203900C1CC9
:1013A00032703C4B914201D1012201E03A490C805C
:1013B0001A707F231C4201D080349C43FFF77EFFCC
:1013C0003378C0B2002B07D000253570FFF776FFC9
:1013D0003378C0B2AB4236D1432803D0712853D002
:1013E0001528EBD1012300930120FFF755FF00984A
:1013F000FFF752FF00998025C843C0B2FFF74CFFAA
:10140000039B00270293244A1388002B1DD12149F6
:1014100001930978002918D10198FFF73DFF391C85
:101420000198FFF779FF013D071C002DEBD1000A61
:10143000C0B2FFF731FFF8B2FFF72EFFFFF73EFF14
:101440003378002B0AD035701FE00299013B0978F0
:101450001380029B019101330293DDE7C0B206289D
:1014600007D1009B03990133DBB280310093803CAC
:101470000391002CB8D10420FFF70EFFFFF71EFFE9
:10148000044B01251C7000E00025281C05B0F0BDB0
:101490001D0300201E0300209A020020F0B5384CE6
:1014A00087B0002301902370994201D1012301E00C
:1014B000344A1180344A642613704320FFF7ECFE4F
:1014C000324FFFF7F3FE002803D1002F03D0013F76
:1014D000F7E7002F03D1013E002EEED14DE00125AC
:1014E000FFF7ECFE2378002B38D1C0B20290012820
:1014F00005D004283DD10620FFF7CEFE39E005AE29
:101500000221301CFFF714FF01988021FFF710FF24
:1015100023780390002B18D1FFF7D0FE0702FFF7C6
:10152000CDFEBFB223783F18BFB2012B0DD0039B75
:101530009F4207D13378AB4204D1EB437278DBB2E0
:101540009A4204D01820FFF7A7FE002303E00620EC
:10155000FFF7A2FE029B2278002A02D00026267006
:101560000BE0012B05D1019A6B1C8032DDB2019298
:10157000B6E7054A002313700126301C07B0F0BD02
:101580001D0300209A0200201E03002000350C00DD
:1015900010B50023934203D0CC5CC4540133F9E767
:1015A00010BD031C8218934202D019700133FAE770
:1015B00070470023C25C0133002AFBD1581E7047DC
:1015C000F8B5C046F8BC08BC9E467047F8B5C046A2
:1015D000F8BC08BC9E467047040309044172647558
:1015E000696E6F204C4C430041726475696E6F20C8
:1015F0004D4B52466F7831323030000012010002FC
:1016000002000040412350000002010200010000DE
:101610000800000010000000200000004000000052
:101620008000000000010000000200000004000033
:1016300099120000BD120000AD120000F11200006E
:101640000B130000951300009D140000760020008D
:101650004D617220313020323031370031323A3230
:10166000303A313700580A0D00590A0D005A00234C
:101670000A0D003E00322E3000000000210B000059
:101680003D0B0000590B00007D0B0000990B000082
:101690007D0B0000C10B00005B41726475696E6FC9
:1016A0003A58595A5D0000002110422063308440AE
:1016B000A550C660E770088129914AA16BB18CC121
:1016C000ADD1CEE1EFF13112100273325222B55298
:1016D0009442F772D662399318837BB35AA3BDD371
:1016E0009CC3FFF3DEE36224433420040114E66468
:1016F000C774A44485546AA54BB528850995EEE5C1
:10170000CFF5ACC58DD55336722611163006D77677
:10171000F6669556B4465BB77AA719973887DFF710
:10172000FEE79DD7BCC7C448E5588668A77840083F
:10173000611802282338CCC9EDD98EE9AFF9488960
:1017400069990AA92BB9F55AD44AB77A966A711AD7
:10175000500A333A122AFDDBDCCBBFFB9EEB799BB0
:10176000588B3BBB1AABA66C877CE44CC55C222C27
:10177000033C600C411CAEED8FFDECCDCDDD2AAD00
:101780000BBD688D499D977EB66ED55EF44E133EB7
:10179000322E511E700E9FFFBEEFDDDFFCCF1BBF50
:1017A0003AAF599F788F8891A981CAB1EBA10CD12A
:1017B0002DC14EF16FE18010A100C230E320045032
:1017C000254046706760B9839893FBA3DAB33DC3A5
:1017D0001CD37FE35EF3B1029012F322D232354282
:1017E000145277625672EAB5CBA5A89589856EF535
:1017F0004FE52CD50DC5E234C324A01481046674D2
:10180000476424540544DBA7FAB79987B8975FE784
:101810007EF71DC73CD7D326F2369106B016576621
:101820007676154634564CD96DC90EF92FE9C8990C
:10183000E9898AB9ABA94458654806782768C01871
:10184000E1088238A3287DCB5CDB3FEB1EFBF98BE4
:10185000D89BBBAB9ABB754A545A376A167AF10AC1
:10186000D01AB32A923A2EFD0FED6CDD4DCDAABDF4
:101870008BADE89DC98D267C076C645C454CA23C11
:10188000832CE01CC10C1FEF3EFF5DCF7CDF9BAFC4
:10189000BABFD98FF89F176E367E554E745E932E61
:0C18A000B23ED10EF01E0000000000005F
:1018AC000114000009024300020100803209040007
:1018BC0000010202000005240010010424020005AE
:1018CC00240600010524010001070583030800FF1D
:1018DC0009040100020A0000000705810240000013
:1018EC00070502024000000000C2010000000800D1
:0C18FC0069000000410000000000000036
:0400000300000615DE
:00000001FF

View file

@ -27,6 +27,8 @@
#include "board_definitions_genuino_mkr1000.h"
#elif defined(BOARD_ID_arduino_mkrzero)
#include "board_definitions_arduino_mkrzero.h"
#elif defined(BOARD_ID_arduino_mkrfox1200)
#include "board_definitions_arduino_mkrfox1200.h"
#else
#error You must define a BOARD_ID and add the corresponding definitions in board_definitions.h
#endif

View file

@ -0,0 +1,81 @@
/*
Copyright (c) 2016 Arduino LLC. All right reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _BOARD_DEFINITIONS_H_
#define _BOARD_DEFINITIONS_H_
/*
* USB device definitions
*/
#define STRING_PRODUCT "Arduino MKRFox1200"
#define USB_VID_HIGH 0x23
#define USB_VID_LOW 0x41
#define USB_PID_HIGH 0x00
#define USB_PID_LOW 0x50
/*
* If BOOT_DOUBLE_TAP_ADDRESS is defined the bootloader is started by
* quickly tapping two times on the reset button.
* BOOT_DOUBLE_TAP_ADDRESS must point to a free SRAM cell that must not
* be touched from the loaded application.
*/
#define BOOT_DOUBLE_TAP_ADDRESS (0x20007FFCul)
#define BOOT_DOUBLE_TAP_DATA (*((volatile uint32_t *) BOOT_DOUBLE_TAP_ADDRESS))
/*
* If BOOT_LOAD_PIN is defined the bootloader is started if the selected
* pin is tied LOW.
*/
//#define BOOT_LOAD_PIN PIN_PA21
//#define BOOT_LOAD_PIN PIN_PA15
#define BOOT_USART_MODULE SERCOM5
#define BOOT_USART_BUS_CLOCK_INDEX PM_APBCMASK_SERCOM5
#define BOOT_USART_PER_CLOCK_INDEX GCLK_CLKCTRL_ID_SERCOM5_CORE_Val
#define BOOT_USART_PAD_SETTINGS UART_RX_PAD3_TX_PAD2
#define BOOT_USART_PAD3 PINMUX_PB23D_SERCOM5_PAD3
#define BOOT_USART_PAD2 PINMUX_PB22D_SERCOM5_PAD2
#define BOOT_USART_PAD1 PINMUX_UNUSED
#define BOOT_USART_PAD0 PINMUX_UNUSED
/* Master clock frequency */
#define CPU_FREQUENCY (48000000ul)
#define VARIANT_MCK CPU_FREQUENCY
/* Frequency of the board main oscillator */
#define VARIANT_MAINOSC (32768ul)
/* Calibration values for DFLL48 pll */
#define NVM_SW_CALIB_DFLL48M_COARSE_VAL (58)
#define NVM_SW_CALIB_DFLL48M_FINE_VAL (64)
/*
* LEDs definitions
*/
// PA20 (digital pin 6)
#define BOARD_LED_PORT (0)
#define BOARD_LED_PIN (20)
// No RX/TX led
//#define BOARD_LEDRX_PORT
//#define BOARD_LEDRX_PIN
//#define BOARD_LEDTX_PORT
//#define BOARD_LEDTX_PIN
#endif // _BOARD_DEFINITIONS_H_

View file

@ -13,5 +13,8 @@ mv -v samd21_sam_ba_genuino_mkr1000.* ../mkr1000/
BOARD_ID=arduino_mkrzero NAME=samd21_sam_ba_arduino_mkrzero make clean all
mv -v samd21_sam_ba_arduino_mkrzero.* ../mkrzero/
BOARD_ID=arduino_mkrfox1200 NAME=samd21_sam_ba_arduino_mkrfox1200 make clean all
mv -v samd21_sam_ba_arduino_mkrfox1200.* ../mkrfox1200/
echo Done building bootloaders!

View file

@ -240,13 +240,13 @@ void SERCOM::enableSPI()
void SERCOM::disableSPI()
{
//Setting the enable bit to 0
sercom->SPI.CTRLA.bit.ENABLE = 0;
while(sercom->SPI.SYNCBUSY.bit.ENABLE)
{
//Waiting then enable bit from SYNCBUSY is equal to 0;
}
//Setting the enable bit to 0
sercom->SPI.CTRLA.bit.ENABLE = 0;
}
void SERCOM::setDataOrderSPI(SercomDataOrder dataOrder)

View file

@ -48,6 +48,7 @@ public:
inline void runInStandby() { usb.CTRLA.bit.RUNSTDBY = 1; }
inline void noRunInStandby() { usb.CTRLA.bit.RUNSTDBY = 0; }
inline void wakeupHost() { usb.CTRLB.bit.UPRSM = 1; }
// USB speed
inline void setFullSpeed() { usb.CTRLB.bit.SPDCONF = USB_DEVICE_CTRLB_SPDCONF_FS_Val; }

View file

@ -65,6 +65,8 @@ public:
bool configured();
bool connected();
void standby();
// Setup API
bool handleClassInterfaceSetup(USBSetup &setup);
bool handleStandardSetup(USBSetup &setup);

View file

@ -259,6 +259,11 @@ bool USBDeviceClass::sendDescriptor(USBSetup &setup)
return true;
}
void USBDeviceClass::standby() {
usbd.noRunInStandby();
}
void USBDeviceClass::handleEndpoint(uint8_t ep)
{
#if defined(CDC_ENABLED)

View file

@ -258,7 +258,7 @@ _Pragma("pack()")
* idVendor, idProduct, bcdDevice, iManufacturer, iProduct, iSerialNumber, bNumConfigurations */
#define D_CONFIG(_totalLength,_interfaces) \
{ 9, 2, _totalLength,_interfaces, 1, 0, USB_CONFIG_BUS_POWERED, USB_CONFIG_POWER_MA(500) }
{ 9, 2, _totalLength,_interfaces, 1, 0, USB_CONFIG_BUS_POWERED | USB_CONFIG_REMOTE_WAKEUP, USB_CONFIG_POWER_MA(500) }
/* Table 9-10. Standard Configuration Descriptor
* bLength, bDescriptorType, wTotalLength, bNumInterfaces, bConfigurationValue, iConfiguration
* bmAttributes, bMaxPower */

View file

@ -31,7 +31,7 @@ Uart::Uart(SERCOM *_s, uint8_t _pinRX, uint8_t _pinTX, SercomRXPad _padRX, Serco
void Uart::begin(unsigned long baudrate)
{
begin(baudrate, (uint8_t)SERIAL_8N1);
begin(baudrate, SERIAL_8N1);
}
void Uart::begin(unsigned long baudrate, uint16_t config)

View file

@ -241,7 +241,7 @@ void SystemInit( void )
/* ----------------------------------------------------------------------------------------------
* 6) Modify PRESCaler value of OSC8M to have 8MHz
*/
SYSCTRL->OSC8M.bit.PRESC = SYSCTRL_OSC8M_PRESC_1_Val ;
SYSCTRL->OSC8M.bit.PRESC = SYSCTRL_OSC8M_PRESC_0_Val ; //CMSIS 4.5 changed the prescaler defines
SYSCTRL->OSC8M.bit.ONDEMAND = 0 ;
/* ----------------------------------------------------------------------------------------------

View file

@ -308,7 +308,7 @@ void analogWrite(uint32_t pin, uint32_t value)
Tc* TCx = (Tc*) GetTC(pinDesc.ulPWMChannel);
TCx->COUNT8.CC[tcChannel].reg = (uint8_t) value;
syncTC_8(TCx);
} else {
} else {
Tcc* TCCx = (Tcc*) GetTC(pinDesc.ulPWMChannel);
TCCx->CTRLBSET.bit.LUPD = 1;
syncTCC(TCCx);

View file

@ -32,12 +32,12 @@
{
"packager": "arduino",
"name": "bossac",
"version": "1.6.1-arduino"
"version": "1.7.0"
},
{
"packager": "arduino",
"name": "openocd",
"version": "0.9.0-arduino5-static"
"version": "0.9.0-arduino6-static"
},
{
"packager": "arduino",
@ -48,6 +48,11 @@
"packager": "arduino",
"name": "CMSIS-Atmel",
"version": "1.1.0"
},
{
"packager": "arduino",
"name": "arduinoOTA",
"version": "1.2.0"
}
]
}

View file

@ -32,12 +32,12 @@
{
"packager": "arduino",
"name": "bossac",
"version": "1.6.1-arduino"
"version": "1.7.0"
},
{
"packager": "arduino",
"name": "openocd",
"version": "0.9.0-arduino5-static"
"version": "0.9.0-arduino6-static"
},
{
"packager": "arduino",
@ -48,6 +48,11 @@
"packager": "arduino",
"name": "CMSIS-Atmel",
"version": "1.1.0"
},
{
"packager": "arduino",
"name": "arduinoOTA",
"version": "1.2.0"
}
]
}

View file

@ -0,0 +1,73 @@
/*
Usage
This example demonstrates how to use the SAMD SDU library to update a
sketch on an Arduino/Genuino Zero, MKRZero or MKR1000 board using an
SD card. It prints out the date and time the sketch was compiled at
to both Serial and Serial1.
Circuit:
* Arduino MKRZero board with SD card
OR
* Arduino/Genuino Zero or MKR1000 board
* SD shield or breakout connected with CS pin of 4
* SD card
Non-Arduino/Genuino Zero, MKRZero or MKR1000 board are NOT supported.
Steps to update sketch via SD card:
1) Upload this sketch or another sketch that includes the SDU library
via #include <SDU.h>
2) Update the sketch as desired. For this example the sketch prints out
the compiled date and time so no updates are needed.
3) In the IDE select: Sketch -> Export compiled Binary
4) Copy the .bin file from the sketch's folder to the SD card and rename
the file to UPDATE.bin. Eject the SD card from your PC.
5) Insert the SD card into the board, shield or breakout and press the
reset button or power cycle the board. The SDU library will then update
the sketch on the board with the contents of UPDATE.bin
created 23 March 2017
by Sandeep Mistry
*/
/*
Include the SDU library
This will add some code to the sketch before setup() is called
to check if an SD card is present and UPDATE.bin exists on the
SD card.
If UPDATE.bin is present, the file is used to update the sketch
running on the board. After this UPDATE.bin is deleted from the
SD card.
*/
#include <SDU.h>
String message;
void setup() {
Serial.begin(9600);
Serial1.begin(9600);
// wait a bit
delay(1000);
message += "Sketch compile date and time: ";
message += __DATE__;
message += " ";
message += __TIME__;
// print out the sketch compile date and time on the serial port
Serial.println(message);
Serial1.println(message);
}
void loop() {
// add you own code here
}

View file

@ -0,0 +1,92 @@
/*
Copyright (c) 2017 Arduino LLC. All right reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <SD.h>
#include <FlashStorage.h>
#define SDU_START 0x2000
#define SDU_SIZE 0x4000
#define SKETCH_START (uint32_t*)(SDU_START + SDU_SIZE)
#ifndef SDCARD_SS_PIN
#define SDCARD_SS_PIN 4
#endif
#define UPDATE_FILE "UPDATE.BIN"
FlashClass flash;
// Initialize C library
extern "C" void __libc_init_array(void);
int main() {
init();
__libc_init_array();
delay(1);
if (SD.begin(SDCARD_SS_PIN) && SD.exists(UPDATE_FILE)) {
File updateFile = SD.open(UPDATE_FILE);
uint32_t updateSize = updateFile.size();
bool updateFlashed = false;
if (updateSize > SDU_SIZE) {
// skip the SDU section
updateFile.seek(SDU_SIZE);
updateSize -= SDU_SIZE;
uint32_t flashAddress = (uint32_t)SKETCH_START;
// erase the pages
flash.erase((void*)flashAddress, updateSize);
uint8_t buffer[512];
// write the pages
for (uint32_t i = 0; i < updateSize; i += sizeof(buffer)) {
updateFile.read(buffer, sizeof(buffer));
flash.write((void*)flashAddress, buffer, sizeof(buffer));
flashAddress += sizeof(buffer);
}
updateFlashed = true;
}
updateFile.close();
if (updateFlashed) {
SD.remove(UPDATE_FILE);
}
}
// jump to the sketch
__set_MSP(*SKETCH_START);
//Reset vector table address
SCB->VTOR = ((uint32_t)(SKETCH_START) & SCB_VTOR_TBLOFF_Msk);
// address of Reset_Handler is written by the linker at the beginning of the .text section (see linker script)
uint32_t resetHandlerAddress = (uint32_t) * (SKETCH_START + 1);
// jump to reset handler
asm("bx %0"::"r"(resetHandlerAddress));
}

View file

@ -0,0 +1,27 @@
#!/bin/sh -x
ARDUINO=arduino
SKETCH_NAME="SDUBoot.ino"
SKETCH="$PWD/$SKETCH_NAME"
BUILD_PATH="$PWD/build"
OUTPUT_PATH="../../src/boot"
if [[ "$OSTYPE" == "darwin"* ]]; then
ARDUINO="/Applications/Arduino.app/Contents/MacOS/Arduino"
fi
buildSDUBootSketch() {
BOARD=$1
DESTINATION=$2
$ARDUINO --verify --board $BOARD --preserve-temp-files --pref build.path="$BUILD_PATH" $SKETCH
cat "$BUILD_PATH/$SKETCH_NAME.bin" | xxd -i > $DESTINATION
rm -rf "$BUILD_PATH"
}
mkdir -p "$OUTPUT_PATH"
buildSDUBootSketch "arduino:samd:arduino_zero_edbg" "$OUTPUT_PATH/zero.h"
buildSDUBootSketch "arduino:samd:mkr1000" "$OUTPUT_PATH/mkr1000.h"
buildSDUBootSketch "arduino:samd:mkrzero" "$OUTPUT_PATH/mkrzero.h"
buildSDUBootSketch "arduino:samd:mkrfox1200" "$OUTPUT_PATH/mkrfox1200.h"

View file

@ -0,0 +1,17 @@
#######################################
# Syntax Coloring Map For SDU
#######################################
#######################################
# Datatypes (KEYWORD1)
#######################################
SDU KEYWORD1
#######################################
# Methods and Functions (KEYWORD2)
#######################################
#######################################
# Constants (LITERAL1)
#######################################

View file

@ -0,0 +1,9 @@
name=SDU
version=1.0.0
author=Arduino
maintainer=Arduino <info@arduino.cc>
sentence=Update the sketch on your board from an SD card
paragraph=Requires an SD card
category=Other
url=http://www.arduino.cc/en/Reference/SDU
architectures=samd

36
libraries/SDU/src/SDU.cpp Normal file
View file

@ -0,0 +1,36 @@
/*
Copyright (c) 2017 Arduino LLC. All right reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <Arduino.h>
#include "SDU.h"
__attribute__ ((section(".sketch_boot")))
unsigned char sduBoot[0x4000] = {
#if defined(ARDUINO_SAMD_ZERO)
#include "boot/zero.h"
#elif defined(ARDUINO_SAMD_MKR1000)
#include "boot/mkr1000.h"
#elif defined(ARDUINO_SAMD_MKRZERO)
#include "boot/mkrzero.h"
#elif defined(ARDUINO_SAMD_MKRFox1200)
#include "boot/mkrfox1200.h"
#else
#error "Unsupported board!"
#endif
};

24
libraries/SDU/src/SDU.h Normal file
View file

@ -0,0 +1,24 @@
/*
Copyright (c) 2017 Arduino LLC. All right reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _SDU_H_INCLUDED
#define _SDU_H_INCLUDED
// nothing for now
#endif

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -20,7 +20,7 @@
# https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5---3rd-party-Hardware-specification
name=Adafruit SAMD (32-bits ARM Cortex-M0+) Boards
version=1.0.15
version=1.0.16
# Compile variables
# -----------------
@ -143,11 +143,14 @@ tools.bossac.upload.pattern="{path}/{cmd}" {upload.verbose} --port={serial.port.
tools.bossac_remote.upload.pattern=/usr/bin/run-bossac {upload.verbose} --port=ttyATH0 -U {upload.native_usb} -e -w -v /tmp/sketch.bin -R
tools.bossac.network_cmd={runtime.tools.arduinoOTA.path}/bin/arduinoOTA
tools.bossac.upload.network_pattern="{network_cmd}" -address {serial.port} -port 65280 -username arduino -password "{network.password}" -sketch "{build.path}/{build.project_name}.bin" -upload /sketch -b
#
# OpenOCD sketch upload
#
tools.openocd.path={runtime.tools.openocd-0.9.0-arduino5-static.path}
tools.openocd.path={runtime.tools.openocd-0.9.0-arduino6-static.path}
tools.openocd.cmd=bin/openocd
tools.openocd.cmd.windows=bin/openocd.exe
@ -155,6 +158,9 @@ tools.openocd.upload.params.verbose=-d2
tools.openocd.upload.params.quiet=-d0
tools.openocd.upload.pattern="{path}/{cmd}" {upload.verbose} -s "{path}/share/openocd/scripts/" -f "{runtime.platform.path}/variants/{build.variant}/{build.openocdscript}" -c "telnet_port disabled; program {{{build.path}/{build.project_name}.bin}} verify reset 0x2000; shutdown"
tools.openocd.network_cmd={runtime.tools.arduinoOTA.path}/bin/arduinoOTA
tools.openocd.upload.network_pattern={network_cmd} -address {serial.port} -port 65280 -username arduino -password "{network.password}" -sketch "{build.path}/{build.project_name}.bin" -upload /sketch -b
# Program flashes the binary at 0x0000, so use the linker script without_bootloader
tools.openocd.program.params.verbose=-d2
tools.openocd.program.params.quiet=-d0
@ -174,7 +180,7 @@ tools.openocd.bootloader.pattern="{path}/{cmd}" {bootloader.verbose} -s "{path}/
# FIXME: this programmer is a workaround for default options being overwritten by uploadUsingPreferences
#
tools.openocd-withbootsize.path={runtime.tools.openocd-0.9.0-arduino5-static.path}
tools.openocd-withbootsize.path={runtime.tools.openocd-0.9.0-arduino6-static.path}
tools.openocd-withbootsize.cmd=bin/openocd
tools.openocd-withbootsize.cmd.windows=bin/openocd.exe

View file

@ -67,6 +67,9 @@ SECTIONS
{
__text_start__ = .;
KEEP(*(.sketch_boot))
. = ALIGN(0x2000);
KEEP(*(.isr_vector))
*(.text*)

View file

@ -67,6 +67,9 @@ SECTIONS
{
__text_start__ = .;
KEEP(*(.sketch_boot))
. = ALIGN(0x2000);
KEEP(*(.isr_vector))
*(.text*)

View file

@ -0,0 +1,31 @@
#
# Arduino Zero OpenOCD script.
#
# Copyright (c) 2014-2015 Arduino LLC. All right reserved.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# Define 'reset' command
define reset
info reg
break main
# End of 'reset' command
end
target remote | openocd -c "interface cmsis-dap" -c "set CHIPNAME at91samd21g18" -f target/at91samdXX.cfg -c "gdb_port pipe; log_output openocd.log"

View file

@ -0,0 +1,216 @@
/*
Copyright (c) 2014-2015 Arduino LLC. All right reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/* Linker script to configure memory regions.
* Need modifying for a specific board.
* FLASH.ORIGIN: starting address of flash
* FLASH.LENGTH: length of flash
* RAM.ORIGIN: starting address of RAM bank 0
* RAM.LENGTH: length of RAM bank 0
*/
MEMORY
{
FLASH (rx) : ORIGIN = 0x00000000+0x2000, LENGTH = 0x00040000-0x2000 /* First 8KB used by bootloader */
RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00008000
}
/* Linker script to place sections and symbol values. Should be used together
* with other linker script that defines memory regions FLASH and RAM.
* It references following symbols, which must be defined in code:
* Reset_Handler : Entry of reset handler
*
* It defines following symbols, which code can use without definition:
* __exidx_start
* __exidx_end
* __copy_table_start__
* __copy_table_end__
* __zero_table_start__
* __zero_table_end__
* __etext
* __data_start__
* __preinit_array_start
* __preinit_array_end
* __init_array_start
* __init_array_end
* __fini_array_start
* __fini_array_end
* __data_end__
* __bss_start__
* __bss_end__
* __end__
* end
* __HeapLimit
* __StackLimit
* __StackTop
* __stack
*/
ENTRY(Reset_Handler)
SECTIONS
{
.text :
{
__text_start__ = .;
KEEP(*(.sketch_boot))
. = ALIGN(0x2000);
KEEP(*(.isr_vector))
*(.text*)
KEEP(*(.init))
KEEP(*(.fini))
/* .ctors */
*crtbegin.o(.ctors)
*crtbegin?.o(.ctors)
*(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors)
*(SORT(.ctors.*))
*(.ctors)
/* .dtors */
*crtbegin.o(.dtors)
*crtbegin?.o(.dtors)
*(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors)
*(SORT(.dtors.*))
*(.dtors)
*(.rodata*)
KEEP(*(.eh_frame*))
} > FLASH
.ARM.extab :
{
*(.ARM.extab* .gnu.linkonce.armextab.*)
} > FLASH
__exidx_start = .;
.ARM.exidx :
{
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
} > FLASH
__exidx_end = .;
/* To copy multiple ROM to RAM sections,
* uncomment .copy.table section and,
* define __STARTUP_COPY_MULTIPLE in startup_ARMCMx.S */
/*
.copy.table :
{
. = ALIGN(4);
__copy_table_start__ = .;
LONG (__etext)
LONG (__data_start__)
LONG (__data_end__ - __data_start__)
LONG (__etext2)
LONG (__data2_start__)
LONG (__data2_end__ - __data2_start__)
__copy_table_end__ = .;
} > FLASH
*/
/* To clear multiple BSS sections,
* uncomment .zero.table section and,
* define __STARTUP_CLEAR_BSS_MULTIPLE in startup_ARMCMx.S */
/*
.zero.table :
{
. = ALIGN(4);
__zero_table_start__ = .;
LONG (__bss_start__)
LONG (__bss_end__ - __bss_start__)
LONG (__bss2_start__)
LONG (__bss2_end__ - __bss2_start__)
__zero_table_end__ = .;
} > FLASH
*/
__etext = .;
.data : AT (__etext)
{
__data_start__ = .;
*(vtable)
*(.data*)
. = ALIGN(4);
/* preinit data */
PROVIDE_HIDDEN (__preinit_array_start = .);
KEEP(*(.preinit_array))
PROVIDE_HIDDEN (__preinit_array_end = .);
. = ALIGN(4);
/* init data */
PROVIDE_HIDDEN (__init_array_start = .);
KEEP(*(SORT(.init_array.*)))
KEEP(*(.init_array))
PROVIDE_HIDDEN (__init_array_end = .);
. = ALIGN(4);
/* finit data */
PROVIDE_HIDDEN (__fini_array_start = .);
KEEP(*(SORT(.fini_array.*)))
KEEP(*(.fini_array))
PROVIDE_HIDDEN (__fini_array_end = .);
KEEP(*(.jcr*))
. = ALIGN(16);
/* All data end */
__data_end__ = .;
} > RAM
.bss :
{
. = ALIGN(4);
__bss_start__ = .;
*(.bss*)
*(COMMON)
. = ALIGN(4);
__bss_end__ = .;
} > RAM
.heap (COPY):
{
__end__ = .;
PROVIDE(end = .);
*(.heap*)
__HeapLimit = .;
} > RAM
/* .stack_dummy section doesn't contains any symbols. It is only
* used for linker to calculate size of stack sections, and assign
* values to stack symbols later */
.stack_dummy (COPY):
{
*(.stack*)
} > RAM
/* Set stack top to end of RAM, and stack limit move down by
* size of stack_dummy section */
__StackTop = ORIGIN(RAM) + LENGTH(RAM);
__StackLimit = __StackTop - SIZEOF(.stack_dummy);
PROVIDE(__stack = __StackTop);
__ram_end__ = ORIGIN(RAM) + LENGTH(RAM) -1 ;
/* Check if data + heap + stack exceeds RAM limit */
ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack")
}

View file

@ -0,0 +1,214 @@
/*
Copyright (c) 2014-2015 Arduino LLC. All right reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/* Linker script to configure memory regions.
* Need modifying for a specific board.
* FLASH.ORIGIN: starting address of flash
* FLASH.LENGTH: length of flash
* RAM.ORIGIN: starting address of RAM bank 0
* RAM.LENGTH: length of RAM bank 0
*/
MEMORY
{
FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 0x00040000
RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00008000
}
/* Linker script to place sections and symbol values. Should be used together
* with other linker script that defines memory regions FLASH and RAM.
* It references following symbols, which must be defined in code:
* Reset_Handler : Entry of reset handler
*
* It defines following symbols, which code can use without definition:
* __exidx_start
* __exidx_end
* __copy_table_start__
* __copy_table_end__
* __zero_table_start__
* __zero_table_end__
* __etext
* __data_start__
* __preinit_array_start
* __preinit_array_end
* __init_array_start
* __init_array_end
* __fini_array_start
* __fini_array_end
* __data_end__
* __bss_start__
* __bss_end__
* __end__
* end
* __HeapLimit
* __StackLimit
* __StackTop
* __stack
* __ram_end__
*/
ENTRY(Reset_Handler)
SECTIONS
{
.text :
{
__text_start__ = .;
KEEP(*(.isr_vector))
*(.text*)
KEEP(*(.init))
KEEP(*(.fini))
/* .ctors */
*crtbegin.o(.ctors)
*crtbegin?.o(.ctors)
*(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors)
*(SORT(.ctors.*))
*(.ctors)
/* .dtors */
*crtbegin.o(.dtors)
*crtbegin?.o(.dtors)
*(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors)
*(SORT(.dtors.*))
*(.dtors)
*(.rodata*)
KEEP(*(.eh_frame*))
} > FLASH
.ARM.extab :
{
*(.ARM.extab* .gnu.linkonce.armextab.*)
} > FLASH
__exidx_start = .;
.ARM.exidx :
{
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
} > FLASH
__exidx_end = .;
/* To copy multiple ROM to RAM sections,
* uncomment .copy.table section and,
* define __STARTUP_COPY_MULTIPLE in startup_ARMCMx.S */
/*
.copy.table :
{
. = ALIGN(4);
__copy_table_start__ = .;
LONG (__etext)
LONG (__data_start__)
LONG (__data_end__ - __data_start__)
LONG (__etext2)
LONG (__data2_start__)
LONG (__data2_end__ - __data2_start__)
__copy_table_end__ = .;
} > FLASH
*/
/* To clear multiple BSS sections,
* uncomment .zero.table section and,
* define __STARTUP_CLEAR_BSS_MULTIPLE in startup_ARMCMx.S */
/*
.zero.table :
{
. = ALIGN(4);
__zero_table_start__ = .;
LONG (__bss_start__)
LONG (__bss_end__ - __bss_start__)
LONG (__bss2_start__)
LONG (__bss2_end__ - __bss2_start__)
__zero_table_end__ = .;
} > FLASH
*/
__etext = .;
.data : AT (__etext)
{
__data_start__ = .;
*(vtable)
*(.data*)
. = ALIGN(4);
/* preinit data */
PROVIDE_HIDDEN (__preinit_array_start = .);
KEEP(*(.preinit_array))
PROVIDE_HIDDEN (__preinit_array_end = .);
. = ALIGN(4);
/* init data */
PROVIDE_HIDDEN (__init_array_start = .);
KEEP(*(SORT(.init_array.*)))
KEEP(*(.init_array))
PROVIDE_HIDDEN (__init_array_end = .);
. = ALIGN(4);
/* finit data */
PROVIDE_HIDDEN (__fini_array_start = .);
KEEP(*(SORT(.fini_array.*)))
KEEP(*(.fini_array))
PROVIDE_HIDDEN (__fini_array_end = .);
KEEP(*(.jcr*))
. = ALIGN(16);
/* All data end */
__data_end__ = .;
} > RAM
.bss :
{
. = ALIGN(4);
__bss_start__ = .;
*(.bss*)
*(COMMON)
. = ALIGN(4);
__bss_end__ = .;
} > RAM
.heap (COPY):
{
__end__ = .;
PROVIDE(end = .);
*(.heap*)
__HeapLimit = .;
} > RAM
/* .stack_dummy section doesn't contains any symbols. It is only
* used for linker to calculate size of stack sections, and assign
* values to stack symbols later */
.stack_dummy (COPY):
{
*(.stack*)
} > RAM
/* Set stack top to end of RAM, and stack limit move down by
* size of stack_dummy section */
__StackTop = ORIGIN(RAM) + LENGTH(RAM) ;
__StackLimit = __StackTop - SIZEOF(.stack_dummy);
PROVIDE(__stack = __StackTop);
__ram_end__ = ORIGIN(RAM) + LENGTH(RAM) -1 ;
/* Check if data + heap + stack exceeds RAM limit */
ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack")
}

View file

@ -0,0 +1,30 @@
#
# Arduino Zero OpenOCD script.
#
# Copyright (c) 2014-2015 Arduino LLC. All right reserved.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
source [find interface/cmsis-dap.cfg]
# chip name
set CHIPNAME at91samd21g18
set ENDIAN little
# choose a port here
set telnet_port 0
source [find target/at91samdXX.cfg]

View file

@ -0,0 +1,21 @@
/*
Copyright (c) 2014-2015 Arduino LLC. All right reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
// API compatibility
#include "variant.h"

View file

@ -0,0 +1,178 @@
/*
Copyright (c) 2014-2015 Arduino LLC. All right reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "variant.h"
const PinDescription g_APinDescription[] = {
/*
+------------+------------------+--------+-----------------+--------+-----------------------+---------+---------+--------+--------+----------+----------+
| Pin number | MKR Board pin | PIN | Notes | Peri.A | Peripheral B | Perip.C | Perip.D | Peri.E | Peri.F | Periph.G | Periph.H |
| | | | | EIC | ADC | AC | PTC | DAC | SERCOMx | SERCOMx | TCCx | TCCx | COM | AC/GLCK |
| | | | |(EXTINT)|(AIN)|(AIN)| | | (x/PAD) | (x/PAD) | (x/WO) | (x/WO) | | |
+------------+------------------+--------+-----------------+--------+-----+-----+-----+-----+---------+---------+--------+--------+----------+----------+
| 00 | D0 | PA22 | | *06 | | | X10 | | 3/00 | 5/00 |* TC4/0 | TCC0/4 | | GCLK_IO6 |
| 01 | D1 | PA23 | | *07 | | | X11 | | 3/01 | 5/01 |* TC4/1 | TCC0/5 | USB/SOF | GCLK_IO7 |
| 02 | D2 | PA10 | | 10 | *18 | | X02 | | 0/02 | 2/02 |*TCC1/0 | TCC0/2 | I2S/SCK0 | GCLK_IO4 |
| 03 | D3 | PA11 | | 11 | *19 | | X03 | | 0/03 | 2/03 |*TCC1/1 | TCC0/3 | I2S/FS0 | GCLK_IO5 |
| 04 | D4 | PB10 | | *10 | | | | | | 4/02 |* TC5/0 | TCC0/4 | I2S/MCK1 | GCLK_IO4 |
| 05 | D5 | PB11 | | *11 | | | | | | 4/03 |* TC5/1 | TCC0/5 | I2S/SCK1 | GCLK_IO5 |
| 06 | D6 | PA20 | LED_BUILTIN | *04 | | | X08 | | 5/02 | 3/02 | |*TCC0/6 | I2S/SCK0 | GCLK_IO4 |
| 07 | D7 | PA21 | | *05 | | | X09 | | 5/03 | 3/03 | |*TCC0/7 | I2S/FS0 | GCLK_IO5 |
+------------+------------------+--------+-----------------+--------+-----+-----+-----+-----+---------+---------+--------+--------+----------+----------+
*/
{ PORTA, 22, PIO_DIGITAL, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER ), No_ADC_Channel, PWM4_CH0, TC4_CH0, EXTERNAL_INT_6 },
{ PORTA, 23, PIO_DIGITAL, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER ), No_ADC_Channel, PWM4_CH1, TC4_CH1, EXTERNAL_INT_7 },
{ PORTA, 10, PIO_DIGITAL, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER ), ADC_Channel18, PWM1_CH0, TCC1_CH0, EXTERNAL_INT_NONE },
{ PORTA, 11, PIO_DIGITAL, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER ), ADC_Channel19, PWM1_CH1, TCC1_CH1, EXTERNAL_INT_NONE },
{ PORTB, 10, PIO_DIGITAL, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER ), No_ADC_Channel, PWM5_CH0, TC5_CH0, EXTERNAL_INT_10 },
{ PORTB, 11, PIO_DIGITAL, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER ), No_ADC_Channel, PWM5_CH1, TC5_CH1, EXTERNAL_INT_11 },
{ PORTA, 20, PIO_DIGITAL, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER_ALT), No_ADC_Channel, PWM0_CH6, TCC0_CH6, EXTERNAL_INT_4 },
{ PORTA, 21, PIO_DIGITAL, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER_ALT), No_ADC_Channel, PWM0_CH7, TCC0_CH7, EXTERNAL_INT_5 },
/*
+------------+------------------+--------+-----------------+--------+-----------------------+---------+---------+--------+--------+----------+----------+
| Pin number | MKR Board pin | PIN | Notes | Peri.A | Peripheral B | Perip.C | Perip.D | Peri.E | Peri.F | Periph.G | Periph.H |
| | | | | EIC | ADC | AC | PTC | DAC | SERCOMx | SERCOMx | TCCx | TCCx | COM | AC/GLCK |
| | | | |(EXTINT)|(AIN)|(AIN)| | | (x/PAD) | (x/PAD) | (x/WO) | (x/WO) | | |
+------------+------------------+--------+-----------------+--------+-----+-----+-----+-----+---------+---------+--------+--------+----------+----------+
| | SPI | | | | | | | | | | | | | |
| 08 | MOSI | PA16 | | *00 | | | X04 | | *1/00 | 3/00 |*TCC2/0 | TCC0/6 | | GCLK_IO2 |
| 09 | SCK | PA17 | | *01 | | | X05 | | *1/01 | 3/01 | TCC2/1 | TCC0/7 | | GCLK_IO3 |
| 10 | MISO | PA19 | | 03 | | | X07 | | *1/03 | 3/03 |* TC3/1 | TCC0/3 | I2S/SD0 | AC/CMP1 |
+------------+------------------+--------+-----------------+--------------------+-----+-----+---------+---------+--------+--------+----------+----------+
| | Wire | | | | | | | | | | | | | |
| 11 | SDA | PA08 | | NMI | *16 | | X00 | | *0/00 | 2/00 | TCC0/0 | TCC1/2 | I2S/SD1 | |
| 12 | SCL | PA09 | | 09 | *17 | | X01 | | *0/01 | 2/01 | TCC0/1 | TCC1/3 | I2S/MCK0 | |
+------------+------------------+--------+-----------------+--------+-----+-----+-----+-----+---------+---------+--------+--------+----------+----------+
| | Serial1 | | | | | | | | | | | | | |
| 13 | RX | PB23 | | 07 | | | | | | *5/03 | | | | GCLK_IO1 |
| 14 | TX | PB22 | | 06 | | | | | | *5/02 | | | | GCLK_IO0 |
+------------+------------------+--------+-----------------+--------+-----+-----+-----+-----+---------+---------+--------+--------+----------+----------+
*/
// DIPO=3 DOPO=0
{ PORTA, 16, PIO_SERCOM, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER ), No_ADC_Channel, PWM2_CH0, TCC2_CH0, EXTERNAL_INT_0 }, // MOSI: SERCOM1/PAD[0]
{ PORTA, 17, PIO_SERCOM, (PIN_ATTR_DIGITAL ), No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_1 }, // SCK: SERCOM1/PAD[1]
{ PORTA, 19, PIO_SERCOM, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER ), No_ADC_Channel, PWM3_CH1, TC3_CH1, EXTERNAL_INT_NONE }, // MISO: SERCOM1/PAD[3]
// PINOUT=0
{ PORTA, 8, PIO_SERCOM, (PIN_ATTR_DIGITAL ), ADC_Channel16, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NMI }, // SDA: SERCOM0/PAD[0]
{ PORTA, 9, PIO_SERCOM, (PIN_ATTR_DIGITAL ), ADC_Channel17, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // SCL: SERCOM0/PAD[1]
// RXPO=3 TXPO=1
{ PORTB, 23, PIO_SERCOM_ALT, (PIN_ATTR_DIGITAL ), No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // RX: SERCOM5/PAD[3]
{ PORTB, 22, PIO_SERCOM_ALT, (PIN_ATTR_DIGITAL ), No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // TX: SERCOM5/PAD[2]
/*
+------------+------------------+--------+-----------------+--------+-----------------------+---------+---------+--------+--------+----------+----------+
| Pin number | MKR Board pin | PIN | Notes | Peri.A | Peripheral B | Perip.C | Perip.D | Peri.E | Peri.F | Periph.G | Periph.H |
| | | | | EIC | ADC | AC | PTC | DAC | SERCOMx | SERCOMx | TCCx | TCCx | COM | AC/GLCK |
| | | | |(EXTINT)|(AIN)|(AIN)| | | (x/PAD) | (x/PAD) | (x/WO) | (x/WO) | | |
+------------+------------------+--------+-----------------+--------+-----+-----+-----+-----+---------+---------+--------+--------+----------+----------+
| 15 | A0 / DAC0 | PA02 | | 02 | *00 | | Y00 | OUT | | | | | | |
| 16 | A1 | PB02 | | *02 | *10 | | Y08 | | | 5/00 | | | | |
| 17 | A2 | PB03 | | *03 | *11 | | Y09 | | | 5/01 | | | | |
| 18 | A3 | PA04 | | 04 | *04 | 00 | Y02 | | | 0/00 |*TCC0/0 | | | |
| 19 | A4 | PA05 | | 05 | *05 | 01 | Y03 | | | 0/01 |*TCC0/1 | | | |
| 20 | A5 | PA06 | | 06 | *06 | 02 | Y04 | | | 0/02 | TCC1/0 | | | |
| 21 | A6 | PA07 | | 07 | *07 | 03 | Y05 | | | 0/03 | TCC1/1 | | I2S/SD0 | |
+------------+------------------+--------+-----------------+--------+-----+-----+-----+-----+---------+---------+--------+--------+----------+----------+
*/
{ PORTA, 2, PIO_ANALOG, (PIN_ATTR_DIGITAL|PIN_ATTR_ANALOG /*DAC*/ ), ADC_Channel0, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE },
{ PORTB, 2, PIO_ANALOG, (PIN_ATTR_DIGITAL ), ADC_Channel10, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_2 },
{ PORTB, 3, PIO_ANALOG, (PIN_ATTR_DIGITAL ), ADC_Channel11, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_3 },
{ PORTA, 4, PIO_ANALOG, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER ), ADC_Channel4, PWM0_CH0, TCC0_CH0, EXTERNAL_INT_NONE },
{ PORTA, 5, PIO_ANALOG, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER ), ADC_Channel5, PWM0_CH1, TCC0_CH1, EXTERNAL_INT_NONE },
{ PORTA, 6, PIO_ANALOG, (PIN_ATTR_DIGITAL ), ADC_Channel6, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE },
{ PORTA, 7, PIO_ANALOG, (PIN_ATTR_DIGITAL ), ADC_Channel7, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE },
/*
+------------+------------------+--------+-----------------+--------+-----------------------+---------+---------+--------+--------+----------+----------+
| Pin number | MKR Board pin | PIN | Notes | Peri.A | Peripheral B | Perip.C | Perip.D | Peri.E | Peri.F | Periph.G | Periph.H |
| | | | | EIC | ADC | AC | PTC | DAC | SERCOMx | SERCOMx | TCCx | TCCx | COM | AC/GLCK |
| | | | |(EXTINT)|(AIN)|(AIN)| | | (x/PAD) | (x/PAD) | (x/WO) | (x/WO) | | |
+------------+------------------+--------+-----------------+--------+-----+-----+-----+-----+---------+---------+--------+--------+----------+----------+
| | USB | | | | | | | | | | | | | |
| 22 | | PA24 | USB N | 12 | | | | | 3/02 | 5/02 | TC5/0 | TCC1/2 | USB/DM | |
| 23 | | PA25 | USB P | 13 | | | | | 3/03 | 5/03 | TC5/1 | TCC1/3 | USB/DP | |
| 24 | | PA18 | USB ID | 02 | | | X06 | | 1/02 | 3/02 | TC3/0 | TCC0/2 | | AC/CMP0 |
+------------+------------------+--------+-----------------+--------+-----+-----+-----+-----+---------+---------+--------+--------+----------+----------+
| 25 | AREF | PA03 | | 03 | 01 | | Y01 | | | | | | | |
+------------+------------------+--------+-----------------+--------+-----+-----+-----+-----+---------+---------+--------+--------+----------+----------+
*/
{ PORTA, 24, PIO_COM, (PIN_ATTR_NONE ), No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // USB/DM
{ PORTA, 25, PIO_COM, (PIN_ATTR_NONE ), No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // USB/DP
{ PORTA, 18, PIO_DIGITAL, (PIN_ATTR_DIGITAL ), No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE },
{ PORTA, 3, PIO_DIGITAL, (PIN_ATTR_DIGITAL ), No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // DAC/VREFP
/*
+------------+------------------+--------+-----------------+--------+-----------------------+---------+---------+--------+--------+----------+----------+
| Pin number | MKR Board pin | PIN | Notes | Peri.A | Peripheral B | Perip.C | Perip.D | Peri.E | Peri.F | Periph.G | Periph.H |
| | | | | EIC | ADC | AC | PTC | DAC | SERCOMx | SERCOMx | TCCx | TCCx | COM | AC/GLCK |
| | | | |(EXTINT)|(AIN)|(AIN)| | | (x/PAD) | (x/PAD) | (x/WO) | (x/WO) | | |
+------------+------------------+--------+-----------------+--------+-----+-----+-----+-----+---------+---------+--------+--------+----------+----------+
| | SD SPI | | | | | | | | | | | | | |
| 26 | | PA12 | SIGFOX SCK | 12 | | | | | *2/00 | 4/00 | TCC2/0 | TCC0/6 | | AC/CMP0 |
| 27 | | PA13 | SIGFOX MOSI | 13 | | | | | *2/01 | 4/01 | TCC2/1 | TCC0/7 | | AC/CMP1 |
| 28 | | PA14 | SIGFOX SS | 14 | | | | | 2/02 | 4/02 | TC3/0 | TCC0/4 | | GCLK_IO0 |
| 29 | | PA15 | SIGFOX MISO | 15 | | | | | *2/03 | 4/03 | TC3/1 | TCC0/5 | | GCLK_IO1 |
| 30 | | PA27 | SIGFOX RES | 15 | | | | | | | | | | GCLK_IO0 |
| 31 | | PA28 | SIGFOX PWRON | 08 | | | | | | | | | | GCLK_IO0 |
| 32 | | PB08 | ADC_BATTERY | 08 | 02 | | Y14 | | | 4/00 | TC4/0 | | | |
| 33 | | PB09 | SIGFOX EVENT | *09 | 03 | | Y15 | | | 4/01 | TC4/1 | | | |
+------------+------------------+--------+-----------------+--------+-----+-----+-----+-----+---------+---------+--------+--------+----------+----------+
| | 32768Hz Crystal | | | | | | | | | | | | | |
| 34 | | PA00 | XIN32 | 00 | | | | | | 1/00 | TCC2/0 | | | |
| 35 | | PA01 | XOUT32 | 01 | | | | | | 1/01 | TCC2/1 | | | |
+------------+------------------+--------+-----------------+--------+-----+-----+-----+-----+---------+---------+--------+--------+----------+----------+
*/
// DIPO=3 DOPO=0
{ PORTA, 12, PIO_SERCOM, (PIN_ATTR_NONE ), No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // MOSI: SERCOM2/PAD[0]
{ PORTA, 13, PIO_SERCOM, (PIN_ATTR_NONE ), No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // SCK: SERCOM2/PAD[1]
{ PORTA, 14, PIO_DIGITAL, (PIN_ATTR_NONE ), No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // SS: as GPIO
{ PORTA, 15, PIO_SERCOM, (PIN_ATTR_NONE ), No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // MISO: SERCOM2/PAD[3]
{ PORTA, 27, PIO_DIGITAL, (PIN_ATTR_NONE ), No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE },
{ PORTA, 28, PIO_DIGITAL, (PIN_ATTR_NONE ), No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE },
{ PORTB, 8, PIO_ANALOG, (PIN_ATTR_DIGITAL|PIN_ATTR_ANALOG ), ADC_Channel2, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE },
{ PORTB, 9, PIO_ANALOG, (PIN_ATTR_PWM|PIN_ATTR_TIMER ), ADC_Channel3, PWM4_CH1, TC4_CH1, EXTERNAL_INT_9 },
{ PORTA, 0, PIO_DIGITAL, (PIN_ATTR_NONE ), No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE },
{ PORTA, 1, PIO_DIGITAL, (PIN_ATTR_NONE ), No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE },
};
const void* g_apTCInstances[TCC_INST_NUM + TC_INST_NUM]={ TCC0, TCC1, TCC2, TC3, TC4, TC5 };
// Multi-serial objects instantiation
SERCOM sercom0(SERCOM0);
SERCOM sercom1(SERCOM1);
SERCOM sercom2(SERCOM2);
SERCOM sercom3(SERCOM3);
SERCOM sercom4(SERCOM4);
SERCOM sercom5(SERCOM5);
// Serial1
Uart Serial1(&sercom5, PIN_SERIAL1_RX, PIN_SERIAL1_TX, PAD_SERIAL1_RX, PAD_SERIAL1_TX);
void SERCOM5_Handler()
{
Serial1.IrqHandler();
}

View file

@ -0,0 +1,203 @@
/*
Copyright (c) 2014-2015 Arduino LLC. All right reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#pragma once
// The definitions here needs a SAMD core >=1.6.10
#define ARDUINO_SAMD_VARIANT_COMPLIANCE 10610
#include <WVariant.h>
// General definitions
// -------------------
// Frequency of the board main oscillator
#define VARIANT_MAINOSC (32768ul)
// Master clock frequency
#define VARIANT_MCK (48000000ul)
// Pins
// ----
// Number of pins defined in PinDescription array
#define PINS_COUNT (26u)
#define NUM_DIGITAL_PINS (15u)
#define NUM_ANALOG_INPUTS (7u)
#define NUM_ANALOG_OUTPUTS (1u)
// Low-level pin register query macros
// -----------------------------------
#define digitalPinToPort(P) (&(PORT->Group[g_APinDescription[P].ulPort]))
#define digitalPinToBitMask(P) (1 << g_APinDescription[P].ulPin)
//#define analogInPinToBit(P) ()
#define portOutputRegister(port) (&(port->OUT.reg))
#define portInputRegister(port) (&(port->IN.reg))
#define portModeRegister(port) (&(port->DIR.reg))
#define digitalPinHasPWM(P) (g_APinDescription[P].ulPWMChannel != NOT_ON_PWM || g_APinDescription[P].ulTCChannel != NOT_ON_TIMER)
/*
* digitalPinToTimer(..) is AVR-specific and is not defined for SAMD
* architecture. If you need to check if a pin supports PWM you must
* use digitalPinHasPWM(..).
*
* https://github.com/arduino/Arduino/issues/1833
*/
// #define digitalPinToTimer(P)
//Battery
#define ADC_BATTERY (32u)
// LEDs
// ----
#define PIN_LED (6u)
#define LED_BUILTIN PIN_LED
// Analog pins
// -----------
#define PIN_A0 (15u)
#define PIN_A1 (16u)
#define PIN_A2 (17u)
#define PIN_A3 (18u)
#define PIN_A4 (19u)
#define PIN_A5 (20u)
#define PIN_A6 (21u)
static const uint8_t A0 = PIN_A0;
static const uint8_t A1 = PIN_A1;
static const uint8_t A2 = PIN_A2;
static const uint8_t A3 = PIN_A3;
static const uint8_t A4 = PIN_A4;
static const uint8_t A5 = PIN_A5;
static const uint8_t A6 = PIN_A6;
#define ADC_RESOLUTION 12
// SPI Interfaces
// --------------
#define SPI_INTERFACES_COUNT 2
// SPI
#define PIN_SPI_MISO (10u)
#define PIN_SPI_MOSI (8u)
#define PIN_SPI_SCK (9u)
#define PIN_SPI_SS (4u)
#define PERIPH_SPI sercom1
#define PAD_SPI_TX SPI_PAD_0_SCK_1
#define PAD_SPI_RX SERCOM_RX_PAD_3
static const uint8_t SS = PIN_SPI_SS; // SPI Slave SS not used. Set here only for reference.
static const uint8_t MOSI = PIN_SPI_MOSI;
static const uint8_t MISO = PIN_SPI_MISO;
static const uint8_t SCK = PIN_SPI_SCK;
// SPI1: Connected to SIGFOX module
#define PIN_SPI1_MISO (29u)
#define PIN_SPI1_MOSI (26u)
#define PIN_SPI1_SCK (27u)
#define PIN_SPI1_SS (28u)
#define PIN_SIGFOX_RES (30u)
#define PIN_SIGFOX_PWRON (31u)
#define PIN_SIGFOX_EVENT (33u)
#define PERIPH_SPI1 sercom2
#define PAD_SPI1_TX SPI_PAD_0_SCK_1
#define PAD_SPI1_RX SERCOM_RX_PAD_3
static const uint8_t SS1 = PIN_SPI1_SS;
static const uint8_t MOSI1 = PIN_SPI1_MOSI;
static const uint8_t MISO1 = PIN_SPI1_MISO;
static const uint8_t SCK1 = PIN_SPI1_SCK;
// Needed for SIGFOX module library
#define SIGFOX_SPI SPI1
#define SIGFOX_MISO_PIN PIN_SPI1_MISO
#define SIGFOX_MOSI_PIN PIN_SPI1_MOSI
#define SIGFOX_SCK_PIN PIN_SPI1_SCK
#define SIGFOX_SS_PIN PIN_SPI1_SS
#define SIGFOX_RES_PIN PIN_SIGFOX_RES
#define SIGFOX_PWRON_PIN PIN_SIGFOX_PWRON
#define SIGFOX_EVENT_PIN PIN_SIGFOX_EVENT
// Wire Interfaces
// ---------------
#define WIRE_INTERFACES_COUNT 1
// Wire
#define PIN_WIRE_SDA (11u)
#define PIN_WIRE_SCL (12u)
#define PERIPH_WIRE sercom0
#define WIRE_IT_HANDLER SERCOM0_Handler
// USB
// ---
#define PIN_USB_DM (22ul)
#define PIN_USB_DP (23ul)
#define PIN_USB_HOST_ENABLE (24ul)
// I2S Interfaces
// --------------
#define I2S_INTERFACES_COUNT 1
#define I2S_DEVICE 0
#define I2S_CLOCK_GENERATOR 3
#define PIN_I2S_SD (PIN_A6)
#define PIN_I2S_SCK (2u)
#define PIN_I2S_FS (3u)
// Serial ports
// ------------
#ifdef __cplusplus
#include "SERCOM.h"
#include "Uart.h"
// Instances of SERCOM
extern SERCOM sercom0;
extern SERCOM sercom1;
extern SERCOM sercom2;
extern SERCOM sercom3;
extern SERCOM sercom4;
extern SERCOM sercom5;
// Serial1
extern Uart Serial1;
#define PIN_SERIAL1_RX (13ul)
#define PIN_SERIAL1_TX (14ul)
#define PAD_SERIAL1_TX (UART_TX_PAD_2)
#define PAD_SERIAL1_RX (SERCOM_RX_PAD_3)
#endif // __cplusplus
// These serial port names are intended to allow libraries and architecture-neutral
// sketches to automatically default to the correct port name for a particular type
// of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN,
// the first hardware serial port whose RX/TX pins are not dedicated to another use.
//
// SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor
//
// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial
//
// SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library
//
// SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins.
//
// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX
// pins are NOT connected to anything by default.
#define SERIAL_PORT_USBVIRTUAL SerialUSB
#define SERIAL_PORT_MONITOR SerialUSB
#define SERIAL_PORT_HARDWARE Serial1
#define SERIAL_PORT_HARDWARE_OPEN Serial1
// Alias Serial to SerialUSB
#define Serial SerialUSB

View file

@ -67,6 +67,9 @@ SECTIONS
{
__text_start__ = .;
KEEP(*(.sketch_boot))
. = ALIGN(0x2000);
KEEP(*(.isr_vector))
*(.text*)