Skip to content

Conversation

@sago35
Copy link
Member

@sago35 sago35 commented May 4, 2020

In this PR, I'll correct the linker script.

ROM size of the atsamd51j20a is 1024KB, not 512KB.
RAM size is 256KB, not 192KB.

@sago35
Copy link
Member Author

sago35 commented May 4, 2020

The difference from atsamd51.ld is the following.

$ diff -u targets/atsamd51.ld targets/atsamd51j20a.ld
--- targets/atsamd51.ld Sun Feb 23 23:46:31 2020
+++ targets/atsamd51j20a.ld     Tue May 05 08:00:40 2020
@@ -1,8 +1,8 @@

 MEMORY
 {
-    FLASH_TEXT (rw) : ORIGIN = 0x00000000+0x4000, LENGTH = 0x00080000-0x4000  /* First 16KB used by bootloader */
-    RAM (xrw)       : ORIGIN = 0x20000000, LENGTH = 0x00030000
+    FLASH_TEXT (rw) : ORIGIN = 0x00000000+0x4000, LENGTH = 0x00100000-0x4000  /* First 16KB used by bootloader */
+    RAM (xrw)       : ORIGIN = 0x20000000, LENGTH = 0x00040000
 }

 _stack_size = 4K;

@sago35
Copy link
Member Author

sago35 commented May 4, 2020

ATSAMDJ20A is only used in pyportal.json, so it only affects pyportal.

$ git rev-parse HEAD
5561b2258b452e0b0fe72b5dea51506e119f8dfa

$ grep inherit.*samd51 targets/*
targets/feather-m4.json:    "inherits": ["atsamd51j19a"],
targets/itsybitsy-m4.json:    "inherits": ["atsamd51g19a"],
targets/metro-m4-airlift.json:    "inherits": ["atsamd51j19a"],
targets/pybadge.json:    "inherits": ["atsamd51j19a"],
targets/pyportal.json:    "inherits": ["atsamd51j20a"],

$ grep amd51.*ld targets/*
targets/atsamd51g19a.json:      "linkerscript": "targets/atsamd51.ld",
targets/atsamd51j19a.json:      "linkerscript": "targets/atsamd51.ld",
targets/atsamd51j20a.json:      "linkerscript": "targets/atsamd51j20a.ld",

@sago35
Copy link
Member Author

sago35 commented May 4, 2020

The data sheet can be found below.

P.17 ~ P.18
Configuration Summary
http://ww1.microchip.com/downloads/en/DeviceDoc/60001507E.pdf

Device ROM RAM
atsamd51j19 512KB 192KB
atsamd51g19 512KB 192KB
atsamd51j20 1024KB 256KB

@aykevl
Copy link
Member

aykevl commented May 7, 2020

Thank you, looks good to me!

@aykevl aykevl merged commit 5ed0f67 into tinygo-org:dev May 7, 2020
@sago35 sago35 deleted the fix-pyportal-ld branch May 7, 2020 23:21
@niaow niaow added this to the v0.14 milestone Jun 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants