aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2018-07-27 19:21:02 -0400
committerKevin O'Connor <kevin@koconnor.net>2018-08-07 00:02:44 -0400
commit71db5fbe316feb863b5c67bb7f9bb928c0decbe2 (patch)
tree32be38f8423228353a21bc4bcd38b684bfcb0514
parent5633e6c249270f6c2361a754e8c330c88c014ecf (diff)
downloadkutter-71db5fbe316feb863b5c67bb7f9bb928c0decbe2.tar.gz
kutter-71db5fbe316feb863b5c67bb7f9bb928c0decbe2.tar.xz
kutter-71db5fbe316feb863b5c67bb7f9bb928c0decbe2.zip
lib: Update samd21 code with local changes
A minor change is necessary to work with GCC's -flto and to work with common bootloaders. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
-rw-r--r--lib/README4
-rw-r--r--lib/samd21/samd21.patch26
-rw-r--r--lib/samd21/samd21a/gcc/gcc/samd21g18a_flash.ld2
-rw-r--r--lib/samd21/samd21a/gcc/gcc/startup_samd21.c2
4 files changed, 31 insertions, 3 deletions
diff --git a/lib/README b/lib/README
index 38eaadb2..5976b7cc 100644
--- a/lib/README
+++ b/lib/README
@@ -21,7 +21,9 @@ compile with gcc's LTO feature. See sam3x.patch for the modifications.
The samd21 directory contains code from the
Atmel.SAMD21_DFP.1.3.304.atpack zip file found at:
http://packs.download.atmel.com/
-version 1.3.304 (extracted on 20180725).
+version 1.3.304 (extracted on 20180725). It has been modified to
+compile with gcc's LTO feature and to work with chips that have a
+bootloader. See samd21.patch for the modifications.
The lpc176x directory contains code from the mbed project:
https://github.com/ARMmbed/mbed-os
diff --git a/lib/samd21/samd21.patch b/lib/samd21/samd21.patch
new file mode 100644
index 00000000..ae7d7670
--- /dev/null
+++ b/lib/samd21/samd21.patch
@@ -0,0 +1,26 @@
+diff --git a/lib/samd21/samd21a/gcc/gcc/samd21g18a_flash.ld b/lib/samd21/samd21a/gcc/gcc/samd21g18a_flash.ld
+index c6f289e7..34dfb6ba 100644
+--- a/lib/samd21/samd21a/gcc/gcc/samd21g18a_flash.ld
++++ b/lib/samd21/samd21a/gcc/gcc/samd21g18a_flash.ld
+@@ -35,7 +35,7 @@ SEARCH_DIR(.)
+ /* Memory Spaces Definitions */
+ MEMORY
+ {
+- rom (rx) : ORIGIN = 0x00000000, LENGTH = 0x00040000
++ rom (rx) : ORIGIN = 0x00000000 + FLASH_START , LENGTH = 0x00040000 - FLASH_START
+ ram (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00008000
+ }
+
+diff --git a/lib/samd21/samd21a/gcc/gcc/startup_samd21.c b/lib/samd21/samd21a/gcc/gcc/startup_samd21.c
+index 3dce0edd..a480077f 100644
+--- a/lib/samd21/samd21a/gcc/gcc/startup_samd21.c
++++ b/lib/samd21/samd21a/gcc/gcc/startup_samd21.c
+@@ -105,7 +105,7 @@ void PTC_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler
+ void I2S_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
+
+ /* 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/samd21/samd21a/gcc/gcc/samd21g18a_flash.ld b/lib/samd21/samd21a/gcc/gcc/samd21g18a_flash.ld
index c6f289e7..34dfb6ba 100644
--- a/lib/samd21/samd21a/gcc/gcc/samd21g18a_flash.ld
+++ b/lib/samd21/samd21a/gcc/gcc/samd21g18a_flash.ld
@@ -35,7 +35,7 @@ SEARCH_DIR(.)
/* Memory Spaces Definitions */
MEMORY
{
- rom (rx) : ORIGIN = 0x00000000, LENGTH = 0x00040000
+ rom (rx) : ORIGIN = 0x00000000 + FLASH_START , LENGTH = 0x00040000 - FLASH_START
ram (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00008000
}
diff --git a/lib/samd21/samd21a/gcc/gcc/startup_samd21.c b/lib/samd21/samd21a/gcc/gcc/startup_samd21.c
index 3dce0edd..a480077f 100644
--- a/lib/samd21/samd21a/gcc/gcc/startup_samd21.c
+++ b/lib/samd21/samd21a/gcc/gcc/startup_samd21.c
@@ -105,7 +105,7 @@ void PTC_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler
void I2S_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
/* Exception Table */
-__attribute__ ((section(".vectors")))
+__attribute__ ((section(".vectors"))) __attribute__((externally_visible))
const DeviceVectors exception_table = {
/* Configure Initial Stack Pointer, using linker-generated symbols */