aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2019-01-15 12:42:18 -0500
committerKevin O'Connor <kevin@koconnor.net>2019-01-28 20:02:16 -0500
commitf6ce875818a1341ff7a0279699505453d8ca0db4 (patch)
tree0c376ad5785d83a4380f1bfceda39a31eded3e2e /lib
parente47ba6374adcd8d9c54f90b68b2c6b6ea829ff69 (diff)
downloadkutter-f6ce875818a1341ff7a0279699505453d8ca0db4.tar.gz
kutter-f6ce875818a1341ff7a0279699505453d8ca0db4.tar.xz
kutter-f6ce875818a1341ff7a0279699505453d8ca0db4.zip
lib: Update samd51 to work with gcc and bootloaders
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'lib')
-rw-r--r--lib/README4
-rw-r--r--lib/samd51/samd51.patch68
-rw-r--r--lib/samd51/samd51a/gcc/gcc/samd51g19a_flash.ld2
-rw-r--r--lib/samd51/samd51a/gcc/gcc/samd51j19a_flash.ld2
-rw-r--r--lib/samd51/samd51a/gcc/gcc/samd51n19a_flash.ld2
-rw-r--r--lib/samd51/samd51a/gcc/gcc/samd51p20a_flash.ld2
-rw-r--r--lib/samd51/samd51a/gcc/gcc/startup_samd51.c2
7 files changed, 76 insertions, 6 deletions
diff --git a/lib/README b/lib/README
index c11bb66f..771a55e1 100644
--- a/lib/README
+++ b/lib/README
@@ -36,7 +36,9 @@ bootloader. See samd21.patch for the modifications.
The samd51 directory contains code from the
Atmel.SAMD51_DFP.1.1.96.atpack zip file found at:
http://packs.download.atmel.com/
-version 1.1.96 (extracted on 20190110).
+version 1.1.96 (extracted on 20190110). It has been modified to
+compile with gcc's LTO feature and to work with chips that have a
+bootloader. See samd51.patch for the modifications.
The lpc176x directory contains code from the mbed project:
https://github.com/ARMmbed/mbed-os
diff --git a/lib/samd51/samd51.patch b/lib/samd51/samd51.patch
new file mode 100644
index 00000000..482e313b
--- /dev/null
+++ b/lib/samd51/samd51.patch
@@ -0,0 +1,68 @@
+diff --git a/lib/samd51/samd51.patch b/lib/samd51/samd51.patch
+new file mode 100644
+index 00000000..e69de29b
+diff --git a/lib/samd51/samd51a/gcc/gcc/samd51g19a_flash.ld b/lib/samd51/samd51a/gcc/gcc/samd51g19a_flash.ld
+index bee9c68d..551597dc 100644
+--- a/lib/samd51/samd51a/gcc/gcc/samd51g19a_flash.ld
++++ b/lib/samd51/samd51a/gcc/gcc/samd51g19a_flash.ld
+@@ -35,7 +35,7 @@ SEARCH_DIR(.)
+ /* Memory Spaces Definitions */
+ MEMORY
+ {
+- rom (rx) : ORIGIN = 0x00000000, LENGTH = 0x00080000
++ rom (rx) : ORIGIN = 0x00000000 + FLASH_START, LENGTH = 0x00080000 - FLASH_START
+ ram (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00030000
+ bkupram (rwx) : ORIGIN = 0x47000000, LENGTH = 0x00002000
+ qspi (rwx) : ORIGIN = 0x04000000, LENGTH = 0x01000000
+diff --git a/lib/samd51/samd51a/gcc/gcc/samd51j19a_flash.ld b/lib/samd51/samd51a/gcc/gcc/samd51j19a_flash.ld
+index 3dfbe0d4..07ee9864 100644
+--- a/lib/samd51/samd51a/gcc/gcc/samd51j19a_flash.ld
++++ b/lib/samd51/samd51a/gcc/gcc/samd51j19a_flash.ld
+@@ -35,7 +35,7 @@ SEARCH_DIR(.)
+ /* Memory Spaces Definitions */
+ MEMORY
+ {
+- rom (rx) : ORIGIN = 0x00000000, LENGTH = 0x00080000
++ rom (rx) : ORIGIN = 0x00000000 + FLASH_START, LENGTH = 0x00080000 - FLASH_START
+ ram (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00030000
+ bkupram (rwx) : ORIGIN = 0x47000000, LENGTH = 0x00002000
+ qspi (rwx) : ORIGIN = 0x04000000, LENGTH = 0x01000000
+diff --git a/lib/samd51/samd51a/gcc/gcc/samd51n19a_flash.ld b/lib/samd51/samd51a/gcc/gcc/samd51n19a_flash.ld
+index ae77ba71..1c595648 100644
+--- a/lib/samd51/samd51a/gcc/gcc/samd51n19a_flash.ld
++++ b/lib/samd51/samd51a/gcc/gcc/samd51n19a_flash.ld
+@@ -35,7 +35,7 @@ SEARCH_DIR(.)
+ /* Memory Spaces Definitions */
+ MEMORY
+ {
+- rom (rx) : ORIGIN = 0x00000000, LENGTH = 0x00080000
++ rom (rx) : ORIGIN = 0x00000000 + FLASH_START, LENGTH = 0x00080000 - FLASH_START
+ ram (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00030000
+ bkupram (rwx) : ORIGIN = 0x47000000, LENGTH = 0x00002000
+ qspi (rwx) : ORIGIN = 0x04000000, LENGTH = 0x01000000
+diff --git a/lib/samd51/samd51a/gcc/gcc/samd51p20a_flash.ld b/lib/samd51/samd51a/gcc/gcc/samd51p20a_flash.ld
+index 60f73b47..4d8ad695 100644
+--- a/lib/samd51/samd51a/gcc/gcc/samd51p20a_flash.ld
++++ b/lib/samd51/samd51a/gcc/gcc/samd51p20a_flash.ld
+@@ -35,7 +35,7 @@ SEARCH_DIR(.)
+ /* Memory Spaces Definitions */
+ MEMORY
+ {
+- rom (rx) : ORIGIN = 0x00000000, LENGTH = 0x00100000
++ rom (rx) : ORIGIN = 0x00000000 + FLASH_START, LENGTH = 0x00100000 - FLASH_START
+ ram (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00040000
+ bkupram (rwx) : ORIGIN = 0x47000000, LENGTH = 0x00002000
+ qspi (rwx) : ORIGIN = 0x04000000, LENGTH = 0x01000000
+diff --git a/lib/samd51/samd51a/gcc/gcc/startup_samd51.c b/lib/samd51/samd51a/gcc/gcc/startup_samd51.c
+index d00bd7a2..42575901 100644
+--- a/lib/samd51/samd51a/gcc/gcc/startup_samd51.c
++++ b/lib/samd51/samd51a/gcc/gcc/startup_samd51.c
+@@ -235,7 +235,7 @@ void SDHC1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler
+ #endif
+
+ /* Exception Table */
+-__attribute__ ((section(".vectors")))
++__attribute__ ((section(".vectors"))) __attribute__((externally_visible))
+ const DeviceVectors exception_table = {
+
+ /* Configure Initial Stack Pointer, using linker-generated symbols */
diff --git a/lib/samd51/samd51a/gcc/gcc/samd51g19a_flash.ld b/lib/samd51/samd51a/gcc/gcc/samd51g19a_flash.ld
index bee9c68d..551597dc 100644
--- a/lib/samd51/samd51a/gcc/gcc/samd51g19a_flash.ld
+++ b/lib/samd51/samd51a/gcc/gcc/samd51g19a_flash.ld
@@ -35,7 +35,7 @@ SEARCH_DIR(.)
/* Memory Spaces Definitions */
MEMORY
{
- rom (rx) : ORIGIN = 0x00000000, LENGTH = 0x00080000
+ rom (rx) : ORIGIN = 0x00000000 + FLASH_START, LENGTH = 0x00080000 - FLASH_START
ram (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00030000
bkupram (rwx) : ORIGIN = 0x47000000, LENGTH = 0x00002000
qspi (rwx) : ORIGIN = 0x04000000, LENGTH = 0x01000000
diff --git a/lib/samd51/samd51a/gcc/gcc/samd51j19a_flash.ld b/lib/samd51/samd51a/gcc/gcc/samd51j19a_flash.ld
index 3dfbe0d4..07ee9864 100644
--- a/lib/samd51/samd51a/gcc/gcc/samd51j19a_flash.ld
+++ b/lib/samd51/samd51a/gcc/gcc/samd51j19a_flash.ld
@@ -35,7 +35,7 @@ SEARCH_DIR(.)
/* Memory Spaces Definitions */
MEMORY
{
- rom (rx) : ORIGIN = 0x00000000, LENGTH = 0x00080000
+ rom (rx) : ORIGIN = 0x00000000 + FLASH_START, LENGTH = 0x00080000 - FLASH_START
ram (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00030000
bkupram (rwx) : ORIGIN = 0x47000000, LENGTH = 0x00002000
qspi (rwx) : ORIGIN = 0x04000000, LENGTH = 0x01000000
diff --git a/lib/samd51/samd51a/gcc/gcc/samd51n19a_flash.ld b/lib/samd51/samd51a/gcc/gcc/samd51n19a_flash.ld
index ae77ba71..1c595648 100644
--- a/lib/samd51/samd51a/gcc/gcc/samd51n19a_flash.ld
+++ b/lib/samd51/samd51a/gcc/gcc/samd51n19a_flash.ld
@@ -35,7 +35,7 @@ SEARCH_DIR(.)
/* Memory Spaces Definitions */
MEMORY
{
- rom (rx) : ORIGIN = 0x00000000, LENGTH = 0x00080000
+ rom (rx) : ORIGIN = 0x00000000 + FLASH_START, LENGTH = 0x00080000 - FLASH_START
ram (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00030000
bkupram (rwx) : ORIGIN = 0x47000000, LENGTH = 0x00002000
qspi (rwx) : ORIGIN = 0x04000000, LENGTH = 0x01000000
diff --git a/lib/samd51/samd51a/gcc/gcc/samd51p20a_flash.ld b/lib/samd51/samd51a/gcc/gcc/samd51p20a_flash.ld
index 60f73b47..4d8ad695 100644
--- a/lib/samd51/samd51a/gcc/gcc/samd51p20a_flash.ld
+++ b/lib/samd51/samd51a/gcc/gcc/samd51p20a_flash.ld
@@ -35,7 +35,7 @@ SEARCH_DIR(.)
/* Memory Spaces Definitions */
MEMORY
{
- rom (rx) : ORIGIN = 0x00000000, LENGTH = 0x00100000
+ rom (rx) : ORIGIN = 0x00000000 + FLASH_START, LENGTH = 0x00100000 - FLASH_START
ram (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00040000
bkupram (rwx) : ORIGIN = 0x47000000, LENGTH = 0x00002000
qspi (rwx) : ORIGIN = 0x04000000, LENGTH = 0x01000000
diff --git a/lib/samd51/samd51a/gcc/gcc/startup_samd51.c b/lib/samd51/samd51a/gcc/gcc/startup_samd51.c
index d00bd7a2..42575901 100644
--- a/lib/samd51/samd51a/gcc/gcc/startup_samd51.c
+++ b/lib/samd51/samd51a/gcc/gcc/startup_samd51.c
@@ -235,7 +235,7 @@ void SDHC1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler
#endif
/* Exception Table */
-__attribute__ ((section(".vectors")))
+__attribute__ ((section(".vectors"))) __attribute__((externally_visible))
const DeviceVectors exception_table = {
/* Configure Initial Stack Pointer, using linker-generated symbols */