include examples/demo/demo.mk
#include examples/at91sam7/at91sam7s.mk
#include examples/at91sam7/at91sam7x.mk
+#include examples/lm3s1968/lm3s1968.mk
#include examples/avr-kern/avr-kern.mk
#include examples/triface/triface.mk
#include examples/benchmark/kernel-only_arm/kernel-only_arm.mk
* invalidate any other reasons why the executable file might be covered by
* the GNU General Public License.
*
- * Copyright 2007 Develer S.r.l. (http://www.develer.com/)
+ * Copyright 2010 Develer S.r.l. (http://www.develer.com/)
*
* -->
*
- * \version $Id$
+ * \brief LM3S1968 Cortex-M3 testcase
*
- * \author Manuele Fanelli <qwert@develer.com>
- *
- * \brief LM3S168 porting test.
+ * \author Andrea Righi <arighi@develer.com>
*/
-#include "bertos/cpu/detect.h"
+#include <cpu/irq.h>
+#include "io/lm3s.h"
+#include "drv/timer.h"
+
+extern unsigned long ticks;
-int main (void)
+int main(void)
{
- int c;
+ timer_hw_init();
+
+ /* Enable the GPIO port that is used for the on-board LED */
+ SYSCTL_RCGC2_R = SYSCTL_RCGC2_GPIOG;
+ /*
+ * Perform a dummy read to insert a few cycles delay before enabling
+ * the peripheral.
+ */
+ (void)SYSCTL_RCGC2_R;
+ /* Enable the GPIO pin for the LED */
+ GPIO_PORTG_DIR_R = 0x04;
+ GPIO_PORTG_DEN_R = 0x04;
- for (;;)
- c++;
- return 0;
+ while(1)
+ {
+ /* Turn on the LED */
+ if ((ticks & 0x04) == 0x04)
+ GPIO_PORTG_DATA_R |= 0x04;
+ /* Turn off the LED */
+ else if ((ticks & 0x04) == 0)
+ GPIO_PORTG_DATA_R &= ~0x04;
+ }
}
# Set to 1 for debug builds
lm3s1968_DEBUG = 0
-
# Our target application
TRG += lm3s1968
lm3s1968_CSRC = \
examples/lm3s1968/lm3s1968.c \
- #bertos/cpu/cortex-m3/startup_lm3s.c
+ bertos/cpu/cortex-m3/drv/irq.c \
+ bertos/cpu/cortex-m3/drv/timer.c \
+ bertos/cpu/cortex-m3/startup_lm3s.c
# This is an hosted application
lm3s1968_PREFIX = arm-none-eabi-
-lm3s1968_CPPAFLAGS = -O0 -g -gdwarf-2 -g -gen-debug -mthumb
-lm3s1968_CPPFLAGS = -O0 -D'ARCH=0' -D__ARM_LM3S1968__ -D'CPU_FREQ=(48023000L)' -g3 -gdwarf-2 -fverbose-asm -mthumb -Iexamples/lm3s1968 -Ibertos/cpu/cortex-m3
-lm3s1968_LDFLAGS = -nostartfiles -T examples/lm3s1968/standalone.ld -Wl,--no-warn-mismatch
+lm3s1968_CPPAFLAGS = -O0 -g -gdwarf-2 -g -gen-debug -mthumb -fno-strict-aliasing -fwrapv
+lm3s1968_CPPFLAGS = -O0 -D'ARCH=0' -D__ARM_LM3S1968__ -D'CPU_FREQ=(48023000L)' -g3 -gdwarf-2 -fverbose-asm -mthumb -Iexamples/lm3s1968 -Ibertos/cpu/cortex-m3 -fno-strict-aliasing -fwrapv
+lm3s1968_LDFLAGS = -nostartfiles -T bertos/cpu/cortex-m3/scripts/lm3s1968_rom.ld -Wl,--no-warn-mismatch -fno-strict-aliasing -fwrapv
lm3s1968_CPU = cortex-m3
+lm3s1968_PROGRAMMER_CPU = lm3s1968
+lm3s1968_PROGRAMMER_TYPE = lm3s1968
+lm3s1968_FLASH_SCRIPT = bertos/prg_scripts/arm/flash-cortex.sh
+lm3s1968_STOPFLASH_SCRIPT = bertos/prg_scripts/arm/stopopenocd.sh
+lm3s1968_DEBUG_SCRIPT = bertos/prg_scripts/arm/debug.sh
+lm3s1968_STOPDEBUG_SCRIPT = bertos/prg_scripts/arm/stopopenocd.sh
+
+# Debug stuff
+ifeq ($(demo_DEBUG),0)
+ demo_CFLAGS += -Os -fomit-frame-pointer
+ demo_CXXFLAGS += -Os -fomit-frame-pointer
+endif