aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchrysn2012-04-19 13:14:54 +0200
committerchrysn2012-04-19 13:15:34 +0200
commit705cdab7d702772829fd4cff37cf22bab9f59ddb (patch)
treef5fe9d4017cb9b919c0b81db4a06ece521cff08a
parent43acfc531a30874f080a41769778fc56bbcb45e4 (diff)
extend the cmsis emulation layer to compile with the complete efm32lib
most of this is non-functional but just a list of stubs that are absolutely required to make it compile
-rw-r--r--examples/efm32/tinygecko/efm32-tg-stk3300/miniblink-efm32lib/core_cm3.h59
-rw-r--r--examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/Makefile26
-rw-r--r--examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/core_cm3.c8
l---------examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/core_cm3.h1
l---------examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_acmp.c1
l---------examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_adc.c1
l---------examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_aes.c1
l---------examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_assert.c1
l---------examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_burtc.c1
l---------examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_cmu.c1
l---------examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_dac.c1
l---------examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_dbg.c1
l---------examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_dma.c1
l---------examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_ebi.c1
l---------examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_emu.c1
l---------examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_gpio.c1
l---------examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_i2c.c1
l---------examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_int.c1
l---------examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_lcd.c1
l---------examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_lesense.c1
l---------examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_letimer.c1
l---------examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_leuart.c1
l---------examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_mpu.c1
l---------examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_msc.c1
l---------examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_opamp.c1
l---------examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_pcnt.c1
l---------examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_prs.c1
l---------examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_rmu.c1
l---------examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_rtc.c1
l---------examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_system.c1
l---------examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_timer.c1
l---------examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_usart.c1
l---------examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_vcmp.c1
l---------examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_wdog.c1
-rw-r--r--examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/gdbinit14
-rw-r--r--examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/test.c115
36 files changed, 253 insertions, 0 deletions
diff --git a/examples/efm32/tinygecko/efm32-tg-stk3300/miniblink-efm32lib/core_cm3.h b/examples/efm32/tinygecko/efm32-tg-stk3300/miniblink-efm32lib/core_cm3.h
index 6a3fdbb..2ce1662 100644
--- a/examples/efm32/tinygecko/efm32-tg-stk3300/miniblink-efm32lib/core_cm3.h
+++ b/examples/efm32/tinygecko/efm32-tg-stk3300/miniblink-efm32lib/core_cm3.h
@@ -1,3 +1,6 @@
+#ifndef OPENCMSIS_CORECM3_H
+#define OPENCMSIS_CORECM3_H
+
/* the original core_cm3.h is nonfree by arm; this provides libopencm3 variant of the symbols efm32lib needs of CMSIS. */
#include <stdint.h>
@@ -26,6 +29,8 @@ typedef struct
__IO uint32_t AIRCR;
__IO uint32_t SCR;
__IO uint32_t CCR;
+ __IO uint8_t SHPR[12]; /* FIXME: how is this properly indexed? */
+ __IO uint32_t SHCSR;
} SCB_TypeDef;
#define SCB ((SCB_TypeDef *) SCB_BASE)
/* from libopencm3/cm3/memorymap.h */
@@ -39,3 +44,57 @@ typedef struct
/* needed by efm32_cmu.h, probably it's just what gcc provides anyway */
#define __CLZ(div) __builtin_clz(div)
+
+/* needed by efm32_aes.c. __builtin_bswap32 does the same thing as the rev instruction according to https://bugzilla.mozilla.org/show_bug.cgi?id=600106 */
+#define __REV(x) __builtin_bswap32(x)
+
+/* stubs for efm32_cmu.c */
+uint32_t SystemCoreClockGet(void);
+uint32_t SystemHFClockGet(void);
+
+uint32_t SystemLFRCOClockGet(void);
+uint32_t SystemLFXOClockGet(void);
+
+/* stubs for efm32_dbg.h */
+typedef struct
+{
+ uint32_t DHCSR;
+} CoreDebug_TypeDef;
+#define CoreDebug ((CoreDebug_TypeDef *) 0)
+#define CoreDebug_DHCSR_C_DEBUGEN_Msk 0
+
+/* stubs for efm32_dma */
+
+#define NVIC_ClearPendingIRQ(irq) 1
+#define NVIC_EnableIRQ(irq) 1
+#define NVIC_DisableIRQ(irq) 1
+
+/* stubs for efm32_int */
+
+#define __enable_irq() 1
+#define __disable_irq() 1
+
+/* stubs for efm32_mpu */
+
+#define SCB_SHCSR_MEMFAULTENA_Msk 0
+
+typedef struct
+{
+ uint32_t CTRL;
+ uint32_t RNR;
+ uint32_t RBAR;
+ uint32_t RASR;
+} MPU_TypeDef;
+#define MPU ((MPU_TypeDef *) 0)
+#define MPU_CTRL_ENABLE_Msk 0
+#define MPU_RASR_XN_Pos 0
+#define MPU_RASR_AP_Pos 0
+#define MPU_RASR_TEX_Pos 0
+#define MPU_RASR_S_Pos 0
+#define MPU_RASR_C_Pos 0
+#define MPU_RASR_B_Pos 0
+#define MPU_RASR_SRD_Pos 0
+#define MPU_RASR_SIZE_Pos 0
+#define MPU_RASR_ENA_Pos 0
+
+#endif
diff --git a/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/Makefile b/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/Makefile
new file mode 100644
index 0000000..181e15a
--- /dev/null
+++ b/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/Makefile
@@ -0,0 +1,26 @@
+##
+## This file is part of the libopencm3 project.
+##
+## Copyright (C) 2009 Uwe Hermann <uwe@hermann-uwe.de>
+## Copyright (C) 2012 chrysn <chrysn@fsfe.org>
+##
+## 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 3 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, see <http://www.gnu.org/licenses/>.
+##
+
+BINARY = test
+
+OBJS += core_cm3.o $(patsubst %.c,%.o,$(wildcard efm32_*.c))
+CFLAGS += -I/tmp/EFM32_CMSIS_2.4.1/efm32lib/inc/ -I /tmp/EFM32_CMSIS_2.4.1/CMSIS/CM3/DeviceSupport/EnergyMicro/EFM32/ -DEFM32G880F128 -I.
+
+include ../Makefile.include
diff --git a/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/core_cm3.c b/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/core_cm3.c
new file mode 100644
index 0000000..8b412ad
--- /dev/null
+++ b/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/core_cm3.c
@@ -0,0 +1,8 @@
+#include "core_cm3.h"
+
+/* stubs for efm32_cmu.c */
+uint32_t SystemCoreClockGet(void) {return 1;}
+uint32_t SystemHFClockGet(void) {return 1;}
+
+uint32_t SystemLFRCOClockGet(void) {return 1;}
+uint32_t SystemLFXOClockGet(void) {return 1;}
diff --git a/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/core_cm3.h b/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/core_cm3.h
new file mode 120000
index 0000000..b7a19ea
--- /dev/null
+++ b/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/core_cm3.h
@@ -0,0 +1 @@
+../../efm32-tg-stk3300/miniblink-efm32lib/core_cm3.h \ No newline at end of file
diff --git a/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_acmp.c b/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_acmp.c
new file mode 120000
index 0000000..1e1fcef
--- /dev/null
+++ b/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_acmp.c
@@ -0,0 +1 @@
+/tmp/EFM32_CMSIS_2.4.1/efm32lib/src/efm32_acmp.c \ No newline at end of file
diff --git a/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_adc.c b/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_adc.c
new file mode 120000
index 0000000..00fca91
--- /dev/null
+++ b/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_adc.c
@@ -0,0 +1 @@
+/tmp/EFM32_CMSIS_2.4.1/efm32lib/src/efm32_adc.c \ No newline at end of file
diff --git a/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_aes.c b/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_aes.c
new file mode 120000
index 0000000..5048a82
--- /dev/null
+++ b/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_aes.c
@@ -0,0 +1 @@
+/tmp/EFM32_CMSIS_2.4.1/efm32lib/src/efm32_aes.c \ No newline at end of file
diff --git a/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_assert.c b/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_assert.c
new file mode 120000
index 0000000..d5de54d
--- /dev/null
+++ b/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_assert.c
@@ -0,0 +1 @@
+/tmp/EFM32_CMSIS_2.4.1/efm32lib/src/efm32_assert.c \ No newline at end of file
diff --git a/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_burtc.c b/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_burtc.c
new file mode 120000
index 0000000..8a73bbd
--- /dev/null
+++ b/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_burtc.c
@@ -0,0 +1 @@
+/tmp/EFM32_CMSIS_2.4.1/efm32lib/src/efm32_burtc.c \ No newline at end of file
diff --git a/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_cmu.c b/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_cmu.c
new file mode 120000
index 0000000..168574b
--- /dev/null
+++ b/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_cmu.c
@@ -0,0 +1 @@
+/tmp/EFM32_CMSIS_2.4.1/efm32lib/src/efm32_cmu.c \ No newline at end of file
diff --git a/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_dac.c b/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_dac.c
new file mode 120000
index 0000000..7e12e03
--- /dev/null
+++ b/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_dac.c
@@ -0,0 +1 @@
+/tmp/EFM32_CMSIS_2.4.1/efm32lib/src/efm32_dac.c \ No newline at end of file
diff --git a/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_dbg.c b/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_dbg.c
new file mode 120000
index 0000000..1e0b9ae
--- /dev/null
+++ b/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_dbg.c
@@ -0,0 +1 @@
+/tmp/EFM32_CMSIS_2.4.1/efm32lib/src/efm32_dbg.c \ No newline at end of file
diff --git a/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_dma.c b/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_dma.c
new file mode 120000
index 0000000..c72b91c
--- /dev/null
+++ b/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_dma.c
@@ -0,0 +1 @@
+/tmp/EFM32_CMSIS_2.4.1/efm32lib/src/efm32_dma.c \ No newline at end of file
diff --git a/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_ebi.c b/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_ebi.c
new file mode 120000
index 0000000..c9d26bb
--- /dev/null
+++ b/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_ebi.c
@@ -0,0 +1 @@
+/tmp/EFM32_CMSIS_2.4.1/efm32lib/src/efm32_ebi.c \ No newline at end of file
diff --git a/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_emu.c b/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_emu.c
new file mode 120000
index 0000000..7a8b76e
--- /dev/null
+++ b/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_emu.c
@@ -0,0 +1 @@
+/tmp/EFM32_CMSIS_2.4.1/efm32lib/src/efm32_emu.c \ No newline at end of file
diff --git a/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_gpio.c b/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_gpio.c
new file mode 120000
index 0000000..0b2df21
--- /dev/null
+++ b/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_gpio.c
@@ -0,0 +1 @@
+/tmp/EFM32_CMSIS_2.4.1/efm32lib/src/efm32_gpio.c \ No newline at end of file
diff --git a/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_i2c.c b/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_i2c.c
new file mode 120000
index 0000000..681adc3
--- /dev/null
+++ b/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_i2c.c
@@ -0,0 +1 @@
+/tmp/EFM32_CMSIS_2.4.1/efm32lib/src/efm32_i2c.c \ No newline at end of file
diff --git a/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_int.c b/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_int.c
new file mode 120000
index 0000000..176d6cf
--- /dev/null
+++ b/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_int.c
@@ -0,0 +1 @@
+/tmp/EFM32_CMSIS_2.4.1/efm32lib/src/efm32_int.c \ No newline at end of file
diff --git a/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_lcd.c b/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_lcd.c
new file mode 120000
index 0000000..4d6026b
--- /dev/null
+++ b/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_lcd.c
@@ -0,0 +1 @@
+/tmp/EFM32_CMSIS_2.4.1/efm32lib/src/efm32_lcd.c \ No newline at end of file
diff --git a/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_lesense.c b/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_lesense.c
new file mode 120000
index 0000000..8c7ea28
--- /dev/null
+++ b/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_lesense.c
@@ -0,0 +1 @@
+/tmp/EFM32_CMSIS_2.4.1/efm32lib/src/efm32_lesense.c \ No newline at end of file
diff --git a/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_letimer.c b/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_letimer.c
new file mode 120000
index 0000000..aa5eca6
--- /dev/null
+++ b/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_letimer.c
@@ -0,0 +1 @@
+/tmp/EFM32_CMSIS_2.4.1/efm32lib/src/efm32_letimer.c \ No newline at end of file
diff --git a/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_leuart.c b/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_leuart.c
new file mode 120000
index 0000000..64b3a57
--- /dev/null
+++ b/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_leuart.c
@@ -0,0 +1 @@
+/tmp/EFM32_CMSIS_2.4.1/efm32lib/src/efm32_leuart.c \ No newline at end of file
diff --git a/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_mpu.c b/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_mpu.c
new file mode 120000
index 0000000..141dcfb
--- /dev/null
+++ b/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_mpu.c
@@ -0,0 +1 @@
+/tmp/EFM32_CMSIS_2.4.1/efm32lib/src/efm32_mpu.c \ No newline at end of file
diff --git a/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_msc.c b/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_msc.c
new file mode 120000
index 0000000..c1f750e
--- /dev/null
+++ b/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_msc.c
@@ -0,0 +1 @@
+/tmp/EFM32_CMSIS_2.4.1/efm32lib/src/efm32_msc.c \ No newline at end of file
diff --git a/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_opamp.c b/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_opamp.c
new file mode 120000
index 0000000..b6a558b
--- /dev/null
+++ b/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_opamp.c
@@ -0,0 +1 @@
+/tmp/EFM32_CMSIS_2.4.1/efm32lib/src/efm32_opamp.c \ No newline at end of file
diff --git a/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_pcnt.c b/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_pcnt.c
new file mode 120000
index 0000000..2df78bd
--- /dev/null
+++ b/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_pcnt.c
@@ -0,0 +1 @@
+/tmp/EFM32_CMSIS_2.4.1/efm32lib/src/efm32_pcnt.c \ No newline at end of file
diff --git a/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_prs.c b/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_prs.c
new file mode 120000
index 0000000..15b98fe
--- /dev/null
+++ b/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_prs.c
@@ -0,0 +1 @@
+/tmp/EFM32_CMSIS_2.4.1/efm32lib/src/efm32_prs.c \ No newline at end of file
diff --git a/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_rmu.c b/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_rmu.c
new file mode 120000
index 0000000..242f40d
--- /dev/null
+++ b/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_rmu.c
@@ -0,0 +1 @@
+/tmp/EFM32_CMSIS_2.4.1/efm32lib/src/efm32_rmu.c \ No newline at end of file
diff --git a/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_rtc.c b/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_rtc.c
new file mode 120000
index 0000000..9ec9a46
--- /dev/null
+++ b/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_rtc.c
@@ -0,0 +1 @@
+/tmp/EFM32_CMSIS_2.4.1/efm32lib/src/efm32_rtc.c \ No newline at end of file
diff --git a/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_system.c b/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_system.c
new file mode 120000
index 0000000..74114f4
--- /dev/null
+++ b/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_system.c
@@ -0,0 +1 @@
+/tmp/EFM32_CMSIS_2.4.1/efm32lib/src/efm32_system.c \ No newline at end of file
diff --git a/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_timer.c b/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_timer.c
new file mode 120000
index 0000000..b81acaa
--- /dev/null
+++ b/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_timer.c
@@ -0,0 +1 @@
+/tmp/EFM32_CMSIS_2.4.1/efm32lib/src/efm32_timer.c \ No newline at end of file
diff --git a/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_usart.c b/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_usart.c
new file mode 120000
index 0000000..7c78c2c
--- /dev/null
+++ b/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_usart.c
@@ -0,0 +1 @@
+/tmp/EFM32_CMSIS_2.4.1/efm32lib/src/efm32_usart.c \ No newline at end of file
diff --git a/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_vcmp.c b/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_vcmp.c
new file mode 120000
index 0000000..e3b6650
--- /dev/null
+++ b/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_vcmp.c
@@ -0,0 +1 @@
+/tmp/EFM32_CMSIS_2.4.1/efm32lib/src/efm32_vcmp.c \ No newline at end of file
diff --git a/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_wdog.c b/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_wdog.c
new file mode 120000
index 0000000..12c48f1
--- /dev/null
+++ b/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/efm32_wdog.c
@@ -0,0 +1 @@
+/tmp/EFM32_CMSIS_2.4.1/efm32lib/src/efm32_wdog.c \ No newline at end of file
diff --git a/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/gdbinit b/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/gdbinit
new file mode 100644
index 0000000..7ccaa72
--- /dev/null
+++ b/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/gdbinit
@@ -0,0 +1,14 @@
+# gets set when loading the file, without this i get the "Remote 'g' packet
+# reply is too long" errors
+set arm abi AAPCS
+
+target remote localhost:2331
+monitor speed auto
+# this seems to be less about the architecture and more about how to
+# communicate with gdb. "set endian big" works just as well.
+monitor endian little
+
+# sometimes this doesn't work, then the gdbserver has to be restarted
+monitor reset
+monitor go
+monitor halt
diff --git a/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/test.c b/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/test.c
new file mode 100644
index 0000000..02954bb
--- /dev/null
+++ b/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/test.c
@@ -0,0 +1,115 @@
+/*
+ * This file is part of the libopencm3 project.
+ *
+ * Copyright (C) 2009 Uwe Hermann <uwe@hermann-uwe.de>
+ * Copyright (C) 2012 chrysn <chrysn@fsfe.org>
+ *
+ * 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 3 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <efm32_acmp.h>
+#include <efm32_adc.h>
+#include <efm32_aes.h>
+#include <efm32_assert.h>
+#include <efm32_bitband.h>
+#include <efm32_burtc.h>
+#include <efm32_chip.h>
+#include <efm32_cmu.h>
+#include <efm32_common.h>
+#include <efm32_dac.h>
+#include <efm32_dbg.h>
+#include <efm32_dma.h>
+#include <efm32_ebi.h>
+#include <efm32_emu.h>
+#include <efm32_gpio.h>
+#include <efm32_i2c.h>
+#include <efm32_int.h>
+#include <efm32_lcd.h>
+#include <efm32_lesense.h>
+#include <efm32_letimer.h>
+#include <efm32_leuart.h>
+#include <efm32_mpu.h>
+#include <efm32_msc.h>
+#include <efm32_opamp.h>
+#include <efm32_pcnt.h>
+#include <efm32_prs.h>
+#include <efm32_rmu.h>
+#include <efm32_rtc.h>
+#include <efm32_system.h>
+#include <efm32_timer.h>
+#include <efm32_usart.h>
+#include <efm32_vcmp.h>
+#include <efm32_version.h>
+#include <efm32_wdog.h>
+
+#include <stdio.h>
+
+void setup(void);
+void led_toggle(void);
+bool button_is_pressed(void);
+void debug(int a);
+
+#define LOG_SIZE 1024
+volatile char logbuffer[LOG_SIZE];
+
+int main(void)
+{
+ int x;
+ int n_pressed = 0;
+
+ setup();
+
+ while(1) {
+ if (button_is_pressed())
+ {
+ for(x = 0; x < 200000; ++x) asm("mov r0,r0"); /* no-op, prevent compiler from optimizing this away */
+ n_pressed += 1;
+ debug(n_pressed);
+ }
+ led_toggle();
+ };
+}
+
+void debug(int a)
+{
+ snprintf(logbuffer, LOG_SIZE, "Data %d.\n", a);
+}
+
+void setup(void)
+{
+ // Before GPIO works, according to d0034_efm32tg_reference_manual.pdf
+ // note in section 28.3.7, we'll have to enable GPIO in CMU_HFPERCLKEN0
+
+ CMU->HFPERCLKEN0 |= _CMU_HFPERCLKEN0_GPIO_MASK;
+
+ GPIO_PinModeSet(gpioPortE, 1, gpioModePushPull, 0);
+ GPIO_PinModeSet(gpioPortE, 2, gpioModePushPull, 0);
+
+ GPIO_PinModeSet(gpioPortE, 0, gpioModeInputPull, 1); /* pull up */
+
+ // Counter-blink the other user LED
+
+ GPIO_PinOutToggle(gpioPortE, 2);
+}
+
+void led_toggle(void)
+{
+ GPIO_PinOutToggle(gpioPortE, 1);
+ GPIO_PinOutToggle(gpioPortE, 2);
+}
+
+bool button_is_pressed(void)
+{
+ return !GPIO_PinInGet(gpioPortE, 0);
+}