aboutsummaryrefslogtreecommitdiffstats
path: root/lib/sam4e/sam4e.patch
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2018-12-26 15:46:25 -0500
committerKevin O'Connor <kevin@koconnor.net>2019-01-07 19:33:26 -0500
commite278552d44e2d795e335ec33f898c9d6e1413688 (patch)
tree1abf075ce7c6d8f9b2de64126cb0b7e2076748f1 /lib/sam4e/sam4e.patch
parent70bbdf93347c814ae39b1cd04d04fd66706a8b7e (diff)
downloadkutter-e278552d44e2d795e335ec33f898c9d6e1413688.tar.gz
kutter-e278552d44e2d795e335ec33f898c9d6e1413688.tar.xz
kutter-e278552d44e2d795e335ec33f898c9d6e1413688.zip
lib: Rename lib/cmsis-sam4e/ to lib/sam4e/
This is in preparation for merging the sam3 and sam4 code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'lib/sam4e/sam4e.patch')
-rw-r--r--lib/sam4e/sam4e.patch56
1 files changed, 56 insertions, 0 deletions
diff --git a/lib/sam4e/sam4e.patch b/lib/sam4e/sam4e.patch
new file mode 100644
index 00000000..6e4d7b9b
--- /dev/null
+++ b/lib/sam4e/sam4e.patch
@@ -0,0 +1,56 @@
+--- a/lib/sam4e/gcc/gcc/startup_sam4e.c
++++ b/lib/sam4e/gcc/gcc/startup_sam4e.c
+@@ -104,7 +105,7 @@ void GMAC_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
+ void UART1_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 */
+@@ -135,6 +136,7 @@ const DeviceVectors exception_table = {
+ (void*) PMC_Handler, /* 5 Power Management Controller */
+ (void*) EFC_Handler, /* 6 Enhanced Embedded Flash Controller */
+ (void*) UART0_Handler, /* 7 UART 0 */
++ (void*) Dummy_Handler, /* 8 Dummy */
+ (void*) PIOA_Handler, /* 9 Parallel I/O Controller A */
+ (void*) PIOB_Handler, /* 10 Parallel I/O Controller B */
+ (void*) PIOC_Handler, /* 11 Parallel I/O Controller C */
+@@ -166,6 +168,10 @@ const DeviceVectors exception_table = {
+ (void*) CAN0_Handler, /* 37 CAN0 */
+ (void*) CAN1_Handler, /* 38 CAN1 */
+ (void*) AES_Handler, /* 39 AES */
++ (void*) Dummy_Handler, /* 40 Dummy */
++ (void*) Dummy_Handler, /* 41 Dummy */
++ (void*) Dummy_Handler, /* 42 Dummy */
++ (void*) Dummy_Handler, /* 43 Dummy */
+ (void*) GMAC_Handler, /* 44 EMAC */
+ (void*) UART1_Handler /* 45 UART */
+ };
+@@ -198,7 +204,7 @@ void Reset_Handler(void)
+ SCB->VTOR = ((uint32_t) pSrc & SCB_VTOR_TBLOFF_Msk);
+
+ /* Initialize the C library */
+- __libc_init_array();
++ // __libc_init_array();
+
+ /* Branch to main function */
+ main();
+diff --git a/lib/sam4e/include/component/afec.h b/lib/sam4e/include/component/afec.h
+index 34c4e61d..9a4f8f96 100644
+--- a/lib/sam4e/include/component/afec.h
++++ b/lib/sam4e/include/component/afec.h
+@@ -59,9 +59,9 @@ typedef struct {
+ RoReg Reserved2[1];
+ RwReg AFE_CDOR; /**< \brief (Afec Offset: 0x5C) Channel DC Offset Register */
+ RwReg AFE_DIFFR; /**< \brief (Afec Offset: 0x60) Channel Differential Register */
+- RoReg AFE_CSELR; /**< \brief (Afec Offset: 0x64) Channel Register Selection */
++ RwReg AFE_CSELR; /**< \brief (Afec Offset: 0x64) Channel Register Selection */
+ RoReg AFE_CDR; /**< \brief (Afec Offset: 0x68) Channel Data Register */
+- RoReg AFE_COCR; /**< \brief (Afec Offset: 0x6C) Channel Offset Compensation Register */
++ RwReg AFE_COCR; /**< \brief (Afec Offset: 0x6C) Channel Offset Compensation Register */
+ RwReg AFE_TEMPMR; /**< \brief (Afec Offset: 0x70) Temperature Sensor Mode Register */
+ RwReg AFE_TEMPCWR; /**< \brief (Afec Offset: 0x74) Temperature Compare Window Register */
+ RoReg Reserved3[7];
+